vppinfra: implement CLIB_PAUSE () for aarch64 platforms 56/22356/2
authorjaszha03 <jason.zhang2@arm.com>
Fri, 27 Sep 2019 16:48:23 +0000 (11:48 -0500)
committerDamjan Marion <dmarion@me.com>
Fri, 27 Sep 2019 18:31:28 +0000 (18:31 +0000)
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>
src/vppinfra/lock.h

index 49e849b..3cfe11c 100644 (file)
@@ -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