diff options
author | jaszha03 <jason.zhang2@arm.com> | 2019-09-27 11:48:23 -0500 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2019-10-11 11:44:48 +0000 |
commit | a3c45242b1bff2ae5bb9229af38143c16a32e443 (patch) | |
tree | 352029f4f848ec79c2bb0645e6e5c79fbf8792c4 /src | |
parent | 3642782a2748503f5b5ccf89d1575c1d489948ef (diff) |
vppinfra: implement CLIB_PAUSE () for aarch64 platforms
Define CLIB_PAUSE () to generate the "yield" instruction. No significant
performance changes were observed for clib_spinlock_t and clib_rwlock_t.
Type: feature
Change-Id: I59eb996e61c7a16007517e57e6996567302c1657
Signed-off-by: Jason Zhang <jason.zhang2@arm.com>
Reviewed-by: Lijian Zhang <Lijian.Zhang@arm.com>
(cherry picked from commit 18512b002da5da312aa2638b67a8ec4bb2c10236)
Diffstat (limited to 'src')
-rw-r--r-- | src/vppinfra/lock.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vppinfra/lock.h b/src/vppinfra/lock.h index 49e849b1bdd..3cfe11cba17 100644 --- a/src/vppinfra/lock.h +++ b/src/vppinfra/lock.h @@ -21,6 +21,8 @@ #if __x86_64__ #define CLIB_PAUSE() __builtin_ia32_pause () +#elif defined (__aarch64__) || defined (__arm__) +#define CLIB_PAUSE() __asm__ ("yield") #else #define CLIB_PAUSE() #endif |