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/aarch64/atomic - atomic_*_{8, 16}_nv() m...
details: https://anonhg.NetBSD.org/src/rev/a4b2b8deb873
branches: trunk
changeset: 839155:a4b2b8deb873
user: ryo <ryo%NetBSD.org@localhost>
date: Fri Feb 08 06:56:56 2019 +0000
description:
- atomic_*_{8,16}_nv() must return a new value, not an old value.
- use "dmb sy" for atomic_*{8,16}_nv() in the same way as atomic_*{32,64}_nv().
diffstat:
common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diffs (37 lines):
diff -r b986ff3ba08f -r a4b2b8deb873 common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h
--- a/common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h Fri Feb 08 06:33:04 2019 +0000
+++ b/common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h Fri Feb 08 06:56:56 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_op_asm.h,v 1.2 2019/02/06 05:33:14 ryo Exp $ */
+/* $NetBSD: atomic_op_asm.h,v 1.3 2019/02/08 06:56:56 ryo Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -49,10 +49,10 @@
ENTRY_NP(_atomic_##OP##_8_nv) ;\
mov x4, x0 /* need r0 for return value */ ;\
1: ldxrb w0, [x4] /* load old value */ ;\
- INSN w2, w0, w1 /* calc new (return) value */ ;\
- stxrb w3, w2, [x4] /* try to store */ ;\
+ INSN w0, w0, w1 /* calc new (return) value */ ;\
+ stxrb w3, w0, [x4] /* try to store */ ;\
cbnz w3, 1b /* succeed? no, try again */ ;\
- dmb st ;\
+ dmb sy ;\
ret /* return new value */ ;\
END(_atomic_##OP##_8_nv)
@@ -71,10 +71,10 @@
ENTRY_NP(_atomic_##OP##_16_nv) ;\
mov x4, x0 /* need r0 for return value */ ;\
1: ldxrh w0, [x4] /* load old value */ ;\
- INSN w2, w0, w1 /* calc new (return) value */ ;\
- stxrh w3, w2, [x4] /* try to store */ ;\
+ INSN w0, w0, w1 /* calc new (return) value */ ;\
+ stxrh w3, w0, [x4] /* try to store */ ;\
cbnz w3, 1b /* succeed? no, try again */ ;\
- dmb st ;\
+ dmb sy ;\
ret /* return new value */ ;\
END(_atomic_##OP##_16_nv)
Home |
Main Index |
Thread Index |
Old Index