Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/include Use the yield instruction as SPINLO...



details:   https://anonhg.NetBSD.org/src/rev/816317b1f451
branches:  trunk
changeset: 1023815:816317b1f451
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Sep 26 20:15:04 2021 +0000

description:
Use the yield instruction as SPINLOCK_BACKOFF_HOOK for aarch64.

diffstat:

 sys/arch/aarch64/include/lock.h |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 32cf5ca8de84 -r 816317b1f451 sys/arch/aarch64/include/lock.h
--- a/sys/arch/aarch64/include/lock.h   Sun Sep 26 20:14:07 2021 +0000
+++ b/sys/arch/aarch64/include/lock.h   Sun Sep 26 20:15:04 2021 +0000
@@ -1,6 +1,12 @@
-/* $NetBSD: lock.h,v 1.3 2015/06/26 18:27:52 matt Exp $ */
+/* $NetBSD: lock.h,v 1.4 2021/09/26 20:15:04 jmcneill Exp $ */
 
 #ifdef __aarch64__
+# ifdef _HARDKERNEL
+#  ifdef SPINLOCK_BACKOFF_HOOK
+#   undef SPINLOCK_BACKOFF_HOOK
+#  endif
+#  define SPINLOCK_BACKOFF_HOOK                asm volatile("yield" ::: "memory")
+# endif
 # include <sys/common_lock.h>
 #elif defined(__arm__)
 # include <arm/lock.h>



Home | Main Index | Thread Index | Old Index