Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/common/lib/libc Try to hide the C runtime implementation spe...
details: https://anonhg.NetBSD.org/src/rev/4b27b6845d09
branches: trunk
changeset: 326924:4b27b6845d09
user: martin <martin%NetBSD.org@localhost>
date: Sat Feb 22 17:08:30 2014 +0000
description:
Try to hide the C runtime implementation specific __sync_* ops from librump,
to avoid duplicates.
diffstat:
common/lib/libc/arch/arm/atomic/atomic_add_32.S | 10 +++++-----
common/lib/libc/arch/arm/atomic/atomic_and_32.S | 6 +++---
common/lib/libc/arch/arm/atomic/atomic_op_asm.h | 12 +++++++++++-
common/lib/libc/arch/arm/atomic/atomic_or_32.S | 6 +++---
common/lib/libc/arch/m68k/atomic/atomic_add.S | 8 ++++----
common/lib/libc/arch/m68k/atomic/atomic_and.S | 8 ++++----
common/lib/libc/arch/m68k/atomic/atomic_cas.S | 8 ++++----
common/lib/libc/arch/m68k/atomic/atomic_nand.S | 8 ++++----
common/lib/libc/arch/m68k/atomic/atomic_op_asm.h | 13 ++++++++++++-
common/lib/libc/arch/m68k/atomic/atomic_or.S | 8 ++++----
common/lib/libc/arch/m68k/atomic/atomic_sub.S | 8 ++++----
common/lib/libc/arch/m68k/atomic/atomic_swap.S | 8 ++++----
common/lib/libc/arch/m68k/atomic/atomic_xor.S | 8 ++++----
common/lib/libc/atomic/atomic_add_32_cas.c | 8 ++++++--
common/lib/libc/atomic/atomic_add_32_nv_cas.c | 4 ++--
common/lib/libc/atomic/atomic_add_64_nv_cas.c | 4 ++--
common/lib/libc/atomic/atomic_and_32_cas.c | 8 ++++++--
common/lib/libc/atomic/atomic_and_32_nv_cas.c | 4 ++--
common/lib/libc/atomic/atomic_and_64_nv_cas.c | 4 ++--
common/lib/libc/atomic/atomic_init_testset.c | 10 +++++-----
common/lib/libc/atomic/atomic_op_namespace.h | 12 +++++++++++-
common/lib/libc/atomic/atomic_or_32_cas.c | 8 ++++++--
common/lib/libc/atomic/atomic_or_32_nv_cas.c | 4 ++--
common/lib/libc/atomic/atomic_or_64_nv_cas.c | 4 ++--
common/lib/libc/atomic/atomic_swap_32_cas.c | 4 ++--
common/lib/libc/atomic/atomic_swap_64_cas.c | 4 ++--
common/lib/libc/atomic/membar_ops_nop.c | 4 ++--
27 files changed, 118 insertions(+), 75 deletions(-)
diffs (truncated from 732 to 300 lines):
diff -r d43e837c4a70 -r 4b27b6845d09 common/lib/libc/arch/arm/atomic/atomic_add_32.S
--- a/common/lib/libc/arch/arm/atomic/atomic_add_32.S Sat Feb 22 16:14:38 2014 +0000
+++ b/common/lib/libc/arch/arm/atomic/atomic_add_32.S Sat Feb 22 17:08:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_add_32.S,v 1.6 2013/11/08 22:42:52 matt Exp $ */
+/* $NetBSD: atomic_add_32.S,v 1.7 2014/02/22 17:08:30 martin Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
ATOMIC_OP_ALIAS(atomic_add_int,_atomic_add_32)
ATOMIC_OP_ALIAS(atomic_add_long,_atomic_add_32)
ATOMIC_OP_ALIAS(atomic_add_ptr,_atomic_add_32)
-STRONG_ALIAS(__sync_fetch_and_add_4,_atomic_add_32)
+CRT_ALIAS(__sync_fetch_and_add_4,_atomic_add_32)
STRONG_ALIAS(_atomic_add_int,_atomic_add_32)
STRONG_ALIAS(_atomic_add_long,_atomic_add_32)
STRONG_ALIAS(_atomic_add_ptr,_atomic_add_32)
@@ -65,7 +65,7 @@
ATOMIC_OP_ALIAS(atomic_sub_int,_atomic_sub_32)
ATOMIC_OP_ALIAS(atomic_sub_long,_atomic_sub_32)
ATOMIC_OP_ALIAS(atomic_sub_ptr,_atomic_sub_32)
-STRONG_ALIAS(__sync_fetch_and_sub_4,_atomic_sub_32)
+CRT_ALIAS(__sync_fetch_and_sub_4,_atomic_sub_32)
STRONG_ALIAS(_atomic_sub_int,_atomic_sub_32)
STRONG_ALIAS(_atomic_sub_long,_atomic_sub_32)
STRONG_ALIAS(_atomic_sub_ptr,_atomic_sub_32)
@@ -92,7 +92,7 @@
ATOMIC_OP_ALIAS(atomic_add_int_nv,_atomic_add_32_nv)
ATOMIC_OP_ALIAS(atomic_add_long_nv,_atomic_add_32_nv)
ATOMIC_OP_ALIAS(atomic_add_ptr_nv,_atomic_add_32_nv)
-STRONG_ALIAS(__sync_add_and_fetch_4,_atomic_add_32_nv)
+CRT_ALIAS(__sync_add_and_fetch_4,_atomic_add_32_nv)
STRONG_ALIAS(_atomic_add_int_nv,_atomic_add_32_nv)
STRONG_ALIAS(_atomic_add_long_nv,_atomic_add_32_nv)
STRONG_ALIAS(_atomic_add_ptr_nv,_atomic_add_32_nv)
@@ -101,7 +101,7 @@
ATOMIC_OP_ALIAS(atomic_sub_int_nv,_atomic_sub_32_nv)
ATOMIC_OP_ALIAS(atomic_sub_long_nv,_atomic_sub_32_nv)
ATOMIC_OP_ALIAS(atomic_sub_ptr_nv,_atomic_sub_32_nv)
-STRONG_ALIAS(__sync_sub_and_fetch_4,_atomic_sub_32_nv)
+CRT_ALIAS(__sync_sub_and_fetch_4,_atomic_sub_32_nv)
STRONG_ALIAS(_atomic_sub_int_nv,_atomic_sub_32_nv)
STRONG_ALIAS(_atomic_sub_long_nv,_atomic_sub_32_nv)
STRONG_ALIAS(_atomic_sub_ptr_nv,_atomic_sub_32_nv)
diff -r d43e837c4a70 -r 4b27b6845d09 common/lib/libc/arch/arm/atomic/atomic_and_32.S
--- a/common/lib/libc/arch/arm/atomic/atomic_and_32.S Sat Feb 22 16:14:38 2014 +0000
+++ b/common/lib/libc/arch/arm/atomic/atomic_and_32.S Sat Feb 22 17:08:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_and_32.S,v 1.6 2013/11/08 22:42:52 matt Exp $ */
+/* $NetBSD: atomic_and_32.S,v 1.7 2014/02/22 17:08:30 martin Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
ATOMIC_OP_ALIAS(atomic_and_32,_atomic_and_32)
ATOMIC_OP_ALIAS(atomic_and_uint,_atomic_and_32)
ATOMIC_OP_ALIAS(atomic_and_ulong,_atomic_and_32)
-STRONG_ALIAS(__sync_fetch_and_and_4,_atomic_and_32)
+CRT_ALIAS(__sync_fetch_and_and_4,_atomic_and_32)
STRONG_ALIAS(_atomic_and_uint,_atomic_and_32)
STRONG_ALIAS(_atomic_and_ulong,_atomic_and_32)
@@ -73,7 +73,7 @@
ATOMIC_OP_ALIAS(atomic_and_32_nv,_atomic_and_32_nv)
ATOMIC_OP_ALIAS(atomic_and_uint_nv,_atomic_and_32_nv)
ATOMIC_OP_ALIAS(atomic_and_ulong_nv,_atomic_and_32_nv)
-STRONG_ALIAS(__sync_and_and_fetch_4,_atomic_and_32_nv)
+CRT_ALIAS(__sync_and_and_fetch_4,_atomic_and_32_nv)
STRONG_ALIAS(_atomic_and_uint_nv,_atomic_and_32_nv)
STRONG_ALIAS(_atomic_and_ulong_nv,_atomic_and_32_nv)
diff -r d43e837c4a70 -r 4b27b6845d09 common/lib/libc/arch/arm/atomic/atomic_op_asm.h
--- a/common/lib/libc/arch/arm/atomic/atomic_op_asm.h Sat Feb 22 16:14:38 2014 +0000
+++ b/common/lib/libc/arch/arm/atomic/atomic_op_asm.h Sat Feb 22 17:08:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_op_asm.h,v 1.4 2013/11/08 22:42:52 matt Exp $ */
+/* $NetBSD: atomic_op_asm.h,v 1.5 2014/02/22 17:08:30 martin Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -44,10 +44,16 @@
#if defined(_KERNEL)
#define ATOMIC_OP_ALIAS(a,s) STRONG_ALIAS(a,s)
+#ifdef _HARDKERNEL
+#define CRT_ALIAS(a,s) STRONG_ALIAS(a,s)
+#endif
#else /* _KERNEL */
#define ATOMIC_OP_ALIAS(a,s) WEAK_ALIAS(a,s)
+#ifdef _LIBC
+#define CRT_ALIAS(a,s) STRONG_ALIAS(a,s)
+#endif
#endif /* _KERNEL */
@@ -67,4 +73,8 @@
#define THI r5
#endif
+#ifndef CRT_ALIAS
+#define CRT_ALIAS(a,s)
+#endif
+
#endif /* _ATOMIC_OP_ASM_H_ */
diff -r d43e837c4a70 -r 4b27b6845d09 common/lib/libc/arch/arm/atomic/atomic_or_32.S
--- a/common/lib/libc/arch/arm/atomic/atomic_or_32.S Sat Feb 22 16:14:38 2014 +0000
+++ b/common/lib/libc/arch/arm/atomic/atomic_or_32.S Sat Feb 22 17:08:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_or_32.S,v 1.6 2013/11/08 22:42:52 matt Exp $ */
+/* $NetBSD: atomic_or_32.S,v 1.7 2014/02/22 17:08:30 martin Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -50,7 +50,7 @@
ATOMIC_OP_ALIAS(atomic_or_32,_atomic_or_32)
ATOMIC_OP_ALIAS(atomic_or_uint,_atomic_or_32)
ATOMIC_OP_ALIAS(atomic_or_ulong,_atomic_or_32)
-STRONG_ALIAS(__sync_fetch_and_or_4,_atomic_or_32)
+CRT_ALIAS(__sync_fetch_and_or_4,_atomic_or_32)
STRONG_ALIAS(_atomic_or_uint,_atomic_or_32)
STRONG_ALIAS(_atomic_or_ulong,_atomic_or_32)
@@ -72,7 +72,7 @@
ATOMIC_OP_ALIAS(atomic_or_32_nv,_atomic_or_32_nv)
ATOMIC_OP_ALIAS(atomic_or_uint_nv,_atomic_or_32_nv)
ATOMIC_OP_ALIAS(atomic_or_ulong_nv,_atomic_or_32_nv)
-STRONG_ALIAS(__sync_or_and_fetch_4,_atomic_or_32_nv)
+CRT_ALIAS(__sync_or_and_fetch_4,_atomic_or_32_nv)
STRONG_ALIAS(_atomic_or_uint_nv,_atomic_or_32_nv)
STRONG_ALIAS(_atomic_or_ulong_nv,_atomic_or_32_nv)
diff -r d43e837c4a70 -r 4b27b6845d09 common/lib/libc/arch/m68k/atomic/atomic_add.S
--- a/common/lib/libc/arch/m68k/atomic/atomic_add.S Sat Feb 22 16:14:38 2014 +0000
+++ b/common/lib/libc/arch/m68k/atomic/atomic_add.S Sat Feb 22 17:08:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_add.S,v 1.8 2014/02/20 20:39:01 martin Exp $ */
+/* $NetBSD: atomic_add.S,v 1.9 2014/02/22 17:08:30 martin Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
STRONG_ALIAS(_atomic_add_long_nv,_atomic_add_32_nv)
ATOMIC_OP_ALIAS(atomic_add_ptr_nv,_atomic_add_32_nv)
STRONG_ALIAS(_atomic_add_ptr_nv,_atomic_add_32_nv)
-STRONG_ALIAS(__sync_add_and_fetch_4,_atomic_add_32_nv)
+CRT_ALIAS(__sync_add_and_fetch_4,_atomic_add_32_nv)
ENTRY(__sync_fetch_and_add_4)
movl 4(%sp), %a0
@@ -89,7 +89,7 @@
rts
END(_atomic_add_16_nv)
-STRONG_ALIAS(__sync_add_and_fetch_2,_atomic_add_16_nv)
+CRT_ALIAS(__sync_add_and_fetch_2,_atomic_add_16_nv)
ENTRY(__sync_fetch_and_add_2)
movl 4(%sp), %a0
@@ -111,7 +111,7 @@
rts
END(_atomic_add_8_nv)
-STRONG_ALIAS(__sync_add_and_fetch_1,_atomic_add_8_nv)
+CRT_ALIAS(__sync_add_and_fetch_1,_atomic_add_8_nv)
ENTRY(__sync_fetch_and_add_1)
movl 4(%sp), %a0
diff -r d43e837c4a70 -r 4b27b6845d09 common/lib/libc/arch/m68k/atomic/atomic_and.S
--- a/common/lib/libc/arch/m68k/atomic/atomic_and.S Sat Feb 22 16:14:38 2014 +0000
+++ b/common/lib/libc/arch/m68k/atomic/atomic_and.S Sat Feb 22 17:08:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_and.S,v 1.9 2014/02/20 20:39:01 martin Exp $ */
+/* $NetBSD: atomic_and.S,v 1.10 2014/02/22 17:08:30 martin Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
STRONG_ALIAS(_atomic_and_ulong_nv,_atomic_and_32_nv)
ATOMIC_OP_ALIAS(atomic_and_ptr_nv,_atomic_and_32_nv)
STRONG_ALIAS(_atomic_and_ptr_nv,_atomic_and_32_nv)
-STRONG_ALIAS(__sync_and_and_fetch_4,_atomic_and_32_nv)
+CRT_ALIAS(__sync_and_and_fetch_4,_atomic_and_32_nv)
ENTRY(__sync_fetch_and_and_4)
movl 4(%sp), %a0
@@ -88,7 +88,7 @@
rts
END(_atomic_and_16_nv)
-STRONG_ALIAS(__sync_and_and_fetch_2,_atomic_and_16_nv)
+CRT_ALIAS(__sync_and_and_fetch_2,_atomic_and_16_nv)
ENTRY(__sync_fetch_and_and_2)
movl 4(%sp), %a0
@@ -111,7 +111,7 @@
rts
END(_atomic_and_8_nv)
-STRONG_ALIAS(__sync_and_and_fetch_1,_atomic_and_8_nv)
+CRT_ALIAS(__sync_and_and_fetch_1,_atomic_and_8_nv)
ENTRY(__sync_fetch_and_and_1)
movl 4(%sp), %a0
diff -r d43e837c4a70 -r 4b27b6845d09 common/lib/libc/arch/m68k/atomic/atomic_cas.S
--- a/common/lib/libc/arch/m68k/atomic/atomic_cas.S Sat Feb 22 16:14:38 2014 +0000
+++ b/common/lib/libc/arch/m68k/atomic/atomic_cas.S Sat Feb 22 17:08:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_cas.S,v 1.9 2014/02/20 16:33:23 martin Exp $ */
+/* $NetBSD: atomic_cas.S,v 1.10 2014/02/22 17:08:30 martin Exp $ */
/*-
* Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
STRONG_ALIAS(_atomic_cas_ulong,_atomic_cas_32)
ATOMIC_OP_ALIAS(atomic_cas_ptr,_atomic_cas_32)
STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_32)
-STRONG_ALIAS(__sync_val_compare_and_swap_4,_atomic_cas_32)
+CRT_ALIAS(__sync_val_compare_and_swap_4,_atomic_cas_32)
ATOMIC_OP_ALIAS(atomic_cas_32_ni,_atomic_cas_32)
STRONG_ALIAS(_atomic_cas_32_ni,_atomic_cas_32)
@@ -85,7 +85,7 @@
END(_atomic_cas_16)
ATOMIC_OP_ALIAS(atomic_cas_16,_atomic_cas_16)
-STRONG_ALIAS(__sync_val_compare_and_swap_2,_atomic_cas_16)
+CRT_ALIAS(__sync_val_compare_and_swap_2,_atomic_cas_16)
ENTRY(__sync_bool_compare_and_swap_2)
movl 4(%sp), %a0
@@ -111,7 +111,7 @@
END(_atomic_cas_8)
ATOMIC_OP_ALIAS(atomic_cas_8,_atomic_cas_8)
-STRONG_ALIAS(__sync_val_compare_and_swap_1,_atomic_cas_8)
+CRT_ALIAS(__sync_val_compare_and_swap_1,_atomic_cas_8)
ENTRY(__sync_bool_compare_and_swap_1)
diff -r d43e837c4a70 -r 4b27b6845d09 common/lib/libc/arch/m68k/atomic/atomic_nand.S
--- a/common/lib/libc/arch/m68k/atomic/atomic_nand.S Sat Feb 22 16:14:38 2014 +0000
+++ b/common/lib/libc/arch/m68k/atomic/atomic_nand.S Sat Feb 22 17:08:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_nand.S,v 1.1 2014/02/20 20:39:01 martin Exp $ */
+/* $NetBSD: atomic_nand.S,v 1.2 2014/02/22 17:08:30 martin Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
STRONG_ALIAS(_atomic_nand_ulong,_atomic_nand_32_nv)
ATOMIC_OP_ALIAS(atomic_nand_ptr,_atomic_nand_32_nv)
STRONG_ALIAS(_atomic_nand_ptr,_atomic_nand_32_nv)
-STRONG_ALIAS(__sync_nand_and_fetch_4,_atomic_nand_32_nv)
+CRT_ALIAS(__sync_nand_and_fetch_4,_atomic_nand_32_nv)
ENTRY(__sync_fetch_and_nand_4)
movl 4(%sp), %a0
@@ -84,7 +84,7 @@
rts
END(_atomic_nand_16_nv)
-STRONG_ALIAS(__sync_nand_and_fetch_2,_atomic_nand_16_nv)
+CRT_ALIAS(__sync_nand_and_fetch_2,_atomic_nand_16_nv)
ENTRY(__sync_fetch_and_nand_2)
movl 4(%sp), %a0
@@ -109,7 +109,7 @@
rts
END(_atomic_nand_8_nv)
-STRONG_ALIAS(__sync_nand_and_fetch_1,_atomic_nand_8_nv)
+CRT_ALIAS(__sync_nand_and_fetch_1,_atomic_nand_8_nv)
ENTRY(__sync_fetch_and_nand_1)
movl 4(%sp), %a0
diff -r d43e837c4a70 -r 4b27b6845d09 common/lib/libc/arch/m68k/atomic/atomic_op_asm.h
--- a/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h Sat Feb 22 16:14:38 2014 +0000
+++ b/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h Sat Feb 22 17:08:30 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: atomic_op_asm.h,v 1.3 2008/04/28 20:22:52 martin Exp $ */
+/* $NetBSD: atomic_op_asm.h,v 1.4 2014/02/22 17:08:30 martin Exp $ */
/*-
* Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -37,11 +37,22 @@
#if defined(_KERNEL)
#define ATOMIC_OP_ALIAS(a,s) STRONG_ALIAS(a,s)
+#ifdef _HARDKERNEL
+#define CRT_ALIAS(a,s) STRONG_ALIAS(a,s)
+#endif
#else /* _KERNEL */
#define ATOMIC_OP_ALIAS(a,s) WEAK_ALIAS(a,s)
+#ifdef _LIBC
+#define CRT_ALIAS(a,s) STRONG_ALIAS(a,s)
Home |
Main Index |
Thread Index |
Old Index