From ad76caf6420402e3c9242d29962b1f4897cbdcb6 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Mon, 25 Apr 2016 17:32:08 +0000 Subject: [PATCH] Use the yield instruction in the arm64 cpu_spinwait. This instruction is a hint to the hardware the software is not performing a task. Sponsored by: ABT Systems Ltd --- sys/arm64/include/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h index 520729c00247..764383785176 100644 --- a/sys/arm64/include/cpu.h +++ b/sys/arm64/include/cpu.h @@ -50,7 +50,7 @@ #define cpu_getstack(td) ((td)->td_frame->tf_sp) #define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) -#define cpu_spinwait() /* nothing */ +#define cpu_spinwait() __asm __volatile("yield" ::: "memory") /* Extract CPU affinity levels 0-3 */ #define CPU_AFF0(mpidr) (u_int)(((mpidr) >> 0) & 0xff)