diff options
author | jaszha03 <jason.zhang2@arm.com> | 2019-09-27 11:48:23 -0500 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-09-27 18:31:28 +0000 |
commit | 18512b002da5da312aa2638b67a8ec4bb2c10236 (patch) | |
tree | 8352b21d647e6d3b03d9f43c4f42e0e654ed7266 | |
parent | b325983a4461dd806e86a31abc47533b09482157 (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>
-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 |