Module Name:    src
Committed By:   riastradh
Date:           Sun Feb 13 13:42:30 UTC 2022

Modified Files:
        src/sys/arch/alpha/include: lock.h

Log Message:
alpha: __cpu_simple_lock audit.

Add missing "cc" and "memory" asm clobbers to the compiler can't
reorder memory access around these.  The necessary memory barrier
instructions, mb, already appear in all the right places.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/alpha/include/lock.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/alpha/include/lock.h
diff -u src/sys/arch/alpha/include/lock.h:1.32 src/sys/arch/alpha/include/lock.h:1.33
--- src/sys/arch/alpha/include/lock.h:1.32	Sat Feb 12 17:17:53 2022
+++ src/sys/arch/alpha/include/lock.h	Sun Feb 13 13:42:30 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: lock.h,v 1.32 2022/02/12 17:17:53 riastradh Exp $ */
+/* $NetBSD: lock.h,v 1.33 2022/02/13 13:42:30 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@ __cpu_simple_lock(__cpu_simple_lock_t *a
 		"	# END __cpu_simple_lock\n"
 		: "=&r" (t0), "=m" (*alp)
 		: "i" (__SIMPLELOCK_LOCKED), "m" (*alp)
-		: "memory");
+		: "cc", "memory");
 }
 
 static __inline int
@@ -126,7 +126,7 @@ __cpu_simple_lock_try(__cpu_simple_lock_
 		"	# END __cpu_simple_lock_try"
 		: "=&r" (t0), "=r" (v0), "=m" (*alp)
 		: "i" (__SIMPLELOCK_LOCKED), "m" (*alp)
-		: "memory");
+		: "cc", "memory");
 
 	return (v0 != 0);
 }
@@ -140,7 +140,9 @@ __cpu_simple_unlock(__cpu_simple_lock_t 
 		"	mb			\n"
 		"	stl	$31, %0		\n"
 		"	# END __cpu_simple_unlock"
-		: "=m" (*alp));
+		: "=m" (*alp)
+		: /* no inputs */
+		: "memory");
 }
 
 #if defined(MULTIPROCESSOR)

Reply via email to