Source-Changes-HG archive

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

[src/trunk]: src/common/lib/libc/arch/arm/atomic ARM ARM D7.3.2 - ensure all ...



details:   https://anonhg.NetBSD.org/src/rev/1fbdaa99bf50
branches:  trunk
changeset: 337488:1fbdaa99bf50
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Apr 17 07:03:40 2015 +0000

description:
ARM ARM D7.3.2 - ensure all previous accesses are observed before
the lock is cleared

diffstat:

 common/lib/libc/arch/arm/atomic/atomic_swap.S |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 02e0d506e1a3 -r 1fbdaa99bf50 common/lib/libc/arch/arm/atomic/atomic_swap.S
--- a/common/lib/libc/arch/arm/atomic/atomic_swap.S     Fri Apr 17 02:54:15 2015 +0000
+++ b/common/lib/libc/arch/arm/atomic/atomic_swap.S     Fri Apr 17 07:03:40 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atomic_swap.S,v 1.11 2014/06/28 20:18:55 joerg Exp $   */
+/*     $NetBSD: atomic_swap.S,v 1.12 2015/04/17 07:03:40 skrll Exp $   */
 
 /*-
  * Copyright (c) 2007,2012 The NetBSD Foundation, Inc.
@@ -87,6 +87,11 @@
 #if (!defined(_KERNEL) || defined(_RUMPKERNEL)) && !defined(_STANDALONE)
 ENTRY_NP(__sync_lock_release_4)
        mov     r1, #0
+#ifdef _ARM_ARCH_7
+       dmb
+#else
+       mcr     p15, 0, r3, c7, c10, 5  /* data memory barrier */
+#endif
        strb    r1, [r0]
        RET
 END(__sync_lock_release_4)
@@ -123,6 +128,11 @@
 #if (!defined(_KERNEL) || defined(_RUMPKERNEL)) && !defined(_STANDALONE)
 ENTRY_NP(__sync_lock_release_1)
        mov     r1, #0
+#ifdef _ARM_ARCH_7
+       dmb
+#else
+       mcr     p15, 0, r3, c7, c10, 5  /* data memory barrier */
+#endif
        strb    r1, [r0]
        RET
 END(__sync_lock_release_1)



Home | Main Index | Thread Index | Old Index