diff options
author | Danny Lin <danny@kdrag0n.dev> | 2019-08-20 14:29:22 -0700 |
---|---|---|
committer | Danny Lin <danny@kdrag0n.dev> | 2019-08-20 14:43:56 -0700 |
commit | 0769517adb9901f56933ba2e828c22d8364fbf50 (patch) | |
tree | 34da26d028bb3a3d5a03ee423a53b7cd4abd5a76 | |
parent | 3d16b2322fbc2eb674a60e925d29a9a13d5240c7 (diff) | |
download | schbench-0769517adb9901f56933ba2e828c22d8364fbf50.tar.gz |
schbench: Add support for AArch64 CPUs
Instruction derived from the Linux kernel's cpu_relax() implementation
for arm64.
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
-rw-r--r-- | schbench.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -744,7 +744,14 @@ static void run_rps_thread(struct thread_data *worker_threads_mem) } } +#if defined(__x86_64__) || defined(__i386__) #define nop __asm__ __volatile__("rep;nop": : :"memory") +#elif defined(__aarch64__) +#define nop __asm__ __volatile__("yield" ::: "memory") +#else +#error Unsupported architecture +#endif + static void usec_spin(unsigned long spin_time) { struct timeval now; |