Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc/include __cpu_simple_unlock: use __insn_barri...



details:   https://anonhg.NetBSD.org/src/rev/6cacb7b2c4c7
branches:  trunk
changeset: 555394:6cacb7b2c4c7
user:      pk <pk%NetBSD.org@localhost>
date:      Sun Nov 16 11:22:30 2003 +0000

description:
__cpu_simple_unlock: use __insn_barrier() instead of a "memory" clobber.

diffstat:

 sys/arch/sparc/include/lock.h |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (24 lines):

diff -r 98092e2f007e -r 6cacb7b2c4c7 sys/arch/sparc/include/lock.h
--- a/sys/arch/sparc/include/lock.h     Sun Nov 16 11:09:07 2003 +0000
+++ b/sys/arch/sparc/include/lock.h     Sun Nov 16 11:22:30 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock.h,v 1.12 2003/11/09 21:04:44 pk Exp $ */
+/*     $NetBSD: lock.h,v 1.13 2003/11/16 11:22:30 pk Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -109,10 +109,11 @@
 {
 
        /*
-        * Do `*alp = __SIMPLELOCK_UNLOCKED;' with a compiler barrier
-        * to prevent instruction re-ordering around the lock release.
+        * Insert compiler barrier to prevent instruction re-ordering
+        * around the lock release.
         */
-       __asm __volatile("st %%g0,[%0]" : : "r" (alp) : "memory");
+       __insn_barrier();
+       *alp = __SIMPLELOCK_UNLOCKED;
 }
 
 #endif /* _MACHINE_LOCK_H */



Home | Main Index | Thread Index | Old Index