Author: andrew
Date: Mon Apr 25 17:32:08 2016
New Revision: 298586
URL: https://svnweb.freebsd.org/changeset/base/298586

Log:
  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

Modified:
  head/sys/arm64/include/cpu.h

Modified: head/sys/arm64/include/cpu.h
==============================================================================
--- head/sys/arm64/include/cpu.h        Mon Apr 25 17:06:50 2016        
(r298585)
+++ head/sys/arm64/include/cpu.h        Mon Apr 25 17:32:08 2016        
(r298586)
@@ -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)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to