aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Wang <kevin.wang@arm.com>2017-12-08 13:43:27 +0800
committerDamjan Marion <dmarion.lists@gmail.com>2017-12-15 10:04:40 +0000
commit6390df300e6795e557f824e55b138837dabcf74b (patch)
treecfcd7e45ad540b866c5d7daadea2e638c3ab1f84
parent119dd3af4b067cbbe27f20f0508bd959291f0472 (diff)
implement clib_smp_pause() for arm and aarch64 platform
Change-Id: Ic9c1c70e06b953538ed43fc91ed26b6be82ce812 Signed-off-by: Kevin Wang <kevin.wang@arm.com>
-rw-r--r--src/vppinfra/smp.h2
-rw-r--r--src/vppinfra/timer.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/vppinfra/smp.h b/src/vppinfra/smp.h
index 7e703b3d6aa..e4ab66ad5c3 100644
--- a/src/vppinfra/smp.h
+++ b/src/vppinfra/smp.h
@@ -47,6 +47,8 @@
#if defined (i386) || defined (__x86_64__)
#define clib_smp_pause() do { asm volatile ("pause"); } while (0)
+#elif defined (__aarch64__) || defined (__arm__)
+#define clib_smp_pause() do { asm volatile ("isb" ::: "memory"); } while (0)
#endif
#ifndef clib_smp_pause
diff --git a/src/vppinfra/timer.c b/src/vppinfra/timer.c
index 0221cb749a1..85149dc6b00 100644
--- a/src/vppinfra/timer.c
+++ b/src/vppinfra/timer.c
@@ -41,6 +41,7 @@
#include <sys/param.h>
#include <vppinfra/vec.h>
+#include <vppinfra/smp.h>
#include <vppinfra/time.h>
#include <vppinfra/timer.h>
#include <vppinfra/error.h>
@@ -283,7 +284,7 @@ bar_t b = { limit:10 };
timer_call (bar, (any) & b, random_f64 ());
while (vec_len (timers) > 0)
- sched_yield ();
+ os_sched_yield ();
if (vec_len (foos) > 0)
{