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/sparc/atomic Provide _atomic_cas_{16, 8}_up
details: https://anonhg.NetBSD.org/src/rev/8418d2975414
branches: trunk
changeset: 326441:8418d2975414
user: martin <martin%NetBSD.org@localhost>
date: Wed Jan 29 13:06:36 2014 +0000
description:
Provide _atomic_cas_{16,8}_up
diffstat:
common/lib/libc/arch/sparc/atomic/Makefile.inc | 5 ++-
common/lib/libc/arch/sparc/atomic/atomic_cas_up.S | 26 ++++++++++++++++++++++-
2 files changed, 28 insertions(+), 3 deletions(-)
diffs (56 lines):
diff -r b428f2315792 -r 8418d2975414 common/lib/libc/arch/sparc/atomic/Makefile.inc
--- a/common/lib/libc/arch/sparc/atomic/Makefile.inc Wed Jan 29 12:56:28 2014 +0000
+++ b/common/lib/libc/arch/sparc/atomic/Makefile.inc Wed Jan 29 13:06:36 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.15 2012/11/28 21:39:59 martin Exp $
+# $NetBSD: Makefile.inc,v 1.16 2014/01/29 13:06:36 martin Exp $
.include <bsd.own.mk>
@@ -29,7 +29,8 @@
. endif
. if (${LIB} == "c" || ${LIB} == "pthread")
-CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP
+CPPFLAGS+= -D__HAVE_ASM_ATOMIC_CAS_UP -D__HAVE_ASM_ATOMIC_CAS_16_UP \
+ -D__HAVE_ASM_ATOMIC_CAS_8_UP
SRCS+= atomic_init_testset.c atomic_cas_up.S
. endif
diff -r b428f2315792 -r 8418d2975414 common/lib/libc/arch/sparc/atomic/atomic_cas_up.S
--- a/common/lib/libc/arch/sparc/atomic/atomic_cas_up.S Wed Jan 29 12:56:28 2014 +0000
+++ b/common/lib/libc/arch/sparc/atomic/atomic_cas_up.S Wed Jan 29 13:06:36 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas_up.S,v 1.1 2012/11/28 21:39:59 martin Exp $ */
+/* $NetBSD: atomic_cas_up.S,v 1.2 2014/01/29 13:06:36 martin Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -43,3 +43,27 @@
retl
mov %o3, %o0 ! return old value
+ENTRY(_atomic_cas_16_up)
+ .hidden _C_LABEL(_atomic_cas_16_up)
+RAS_START_ASM_HIDDEN(_atomic_cas_16)
+ lduh [%o0], %o3 ! get old value
+ cmp %o1, %o3 ! old == new?
+ beq,a 1f ! yes, do the store
+ sth %o2, [%o0] ! (in the delay slot)
+RAS_END_ASM_HIDDEN(_atomic_cas_16)
+1:
+ retl
+ mov %o3, %o0 ! return old value
+
+ENTRY(_atomic_cas_8_up)
+ .hidden _C_LABEL(_atomic_cas_8_up)
+RAS_START_ASM_HIDDEN(_atomic_cas_8)
+ ldub [%o0], %o3 ! get old value
+ cmp %o1, %o3 ! old == new?
+ beq,a 1f ! yes, do the store
+ stb %o2, [%o0] ! (in the delay slot)
+RAS_END_ASM_HIDDEN(_atomic_cas_8)
+1:
+ retl
+ mov %o3, %o0 ! return old value
+
Home |
Main Index |
Thread Index |
Old Index