ARM ARM D7.3.2 - ensure all previous accesses are observed before

the lock is cleared
This commit is contained in:
skrll 2015-04-17 07:03:40 +00:00
parent 468ae3a280
commit bbef540942
1 changed files with 11 additions and 1 deletions

View File

@ -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 @@ STRONG_ALIAS(_atomic_swap_ptr,_atomic_swap_32)
#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 @@ STRONG_ALIAS(_atomic_swap_uchar,_atomic_swap_8)
#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)