summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-06-18 18:42:30 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-06-18 18:42:30 +0000
commita331f75240d2b6639f0a575f6575d9594080ce26 (patch)
tree5e865967f73438e03d347c1a77b9f481f7db188f
parent9802c1340125bbb2877e684e6a88360e099f0b4e (diff)
Add missing synchronization instructions.
ok mpi@
-rw-r--r--sys/arch/powerpc/powerpc/mutex.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arch/powerpc/powerpc/mutex.S b/sys/arch/powerpc/powerpc/mutex.S
index 4c5e1d626fe..d597d0218c4 100644
--- a/sys/arch/powerpc/powerpc/mutex.S
+++ b/sys/arch/powerpc/powerpc/mutex.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: mutex.S,v 1.15 2014/01/22 11:01:15 kettenis Exp $ */
+/* $OpenBSD: mutex.S,v 1.16 2014/06/18 18:42:29 kettenis Exp $ */
/*
* Copyright (c) 2007 Dale Rahn
@@ -63,6 +63,7 @@ ENTRY(mtx_enter)
.L_mutex_free:
stwcx. %r4,%r5,%r3 # old owner was 0 cond store
bne- .L_mutex_locked # branch if reserve cancelled
+ isync # memory barrier
#ifdef DIAGNOSTIC
lwz %r6,CI_MUTEX_LEVEL(%r4)
addi %r6,%r6,1 # curpcu->ci_mutex_level++
@@ -119,6 +120,7 @@ ENTRY(mtx_enter_try)
.L_mutex_try_free:
stwcx. %r4,%r5,%r3 # old owner was 0 cond store
bne- .L_mutex_try_locked # branch if reserve cancelled
+ isync # memory barrier
#ifdef DIAGNOSTIC
lwz %r6,CI_MUTEX_LEVEL(%r4)
addi %r6,%r6,1 # curpcu->ci_mutex_level++
@@ -152,6 +154,7 @@ ENTRY(mtx_leave)
li %r4,0
lwz %r5,MTX_OLDCPL(%r3)
stw %r4,MTX_OLDCPL(%r3)
+ sync # memory barrier
stw %r4,MTX_OWNER(%r3)
GET_CPUINFO(%r4)
#ifdef DIAGNOSTIC