diff --git a/common/lib/libc/arch/sparc/atomic/Makefile.inc b/common/lib/libc/arch/sparc/atomic/Makefile.inc index dc2f64a26bd9..4b7da6619720 100644 --- a/common/lib/libc/arch/sparc/atomic/Makefile.inc +++ b/common/lib/libc/arch/sparc/atomic/Makefile.inc @@ -1,6 +1,16 @@ -# $NetBSD: Makefile.inc,v 1.3 2007/11/29 15:29:46 ad Exp $ +# $NetBSD: Makefile.inc,v 1.4 2007/12/22 23:19:40 mrg Exp $ -.if defined(LIB) && (${LIB} == "kern") +.include + +.if ${MACHINE} == "sparc64" + +SPARC64DIR= ${.PARSEDIR}/../../sparc64/atomic +.PATH: ${SPARC64DIR} + +.include "${SPARC64DIR}/Makefile.inc" + +.else +. if defined(LIB) && (${LIB} == "kern") SRCS+= atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \ atomic_and_32_nv_cas.c atomic_dec_32_cas.c atomic_dec_32_nv_cas.c \ @@ -8,4 +18,6 @@ SRCS+= atomic_add_32_cas.c atomic_add_32_nv_cas.c atomic_and_32_cas.c \ atomic_or_32_nv_cas.c atomic_swap_32_cas.c \ atomic_cas.S membar_ops.S +. endif + .endif diff --git a/common/lib/libc/arch/sparc/atomic/atomic_op_asm.h b/common/lib/libc/arch/sparc/atomic/atomic_op_asm.h index bf491d775b5b..7a6bdc9d9cee 100644 --- a/common/lib/libc/arch/sparc/atomic/atomic_op_asm.h +++ b/common/lib/libc/arch/sparc/atomic/atomic_op_asm.h @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_op_asm.h,v 1.2 2007/11/29 02:01:22 ad Exp $ */ +/* $NetBSD: atomic_op_asm.h,v 1.3 2007/12/22 23:19:40 mrg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -43,12 +43,30 @@ #if defined(_KERNEL) -#define ATOMIC_OP_ALIAS(a,s) STRONG_ALIAS(a,s) +#define ATOMIC_OP_ALIAS(a,s) STRONG_ALIAS(a,s) + +#ifdef __sparc64__ +#define ATOMIC_OP_ALIAS_SIZE(a,s) STRONG_ALIAS(a,s/**/_64) +#else +#define ATOMIC_OP_ALIAS_SIZE(a,s) STRONG_ALIAS(a,s/**/_32) +#endif #else /* _KERNEL */ -#define ATOMIC_OP_ALIAS(a,s) WEAK_ALIAS(a,s) +#define ATOMIC_OP_ALIAS(a,s) WEAK_ALIAS(a,s) + +#ifdef __sparc64__ +#define ATOMIC_OP_ALIAS_SIZE(a,s) WEAK_ALIAS(a,s/**/_64) +#else +#define ATOMIC_OP_ALIAS_SIZE(a,s) WEAK_ALIAS(a,s/**/_32) +#endif #endif /* _KERNEL */ +#ifdef __sparc64__ +#define STRONG_ALIAS_SIZE(a,s) STRONG_ALIAS(a,s/**/_64) +#else +#define STRONG_ALIAS_SIZE(a,s) STRONG_ALIAS(a,s/**/_32) +#endif + #endif /* _ATOMIC_OP_ASM_H_ */ diff --git a/common/lib/libc/arch/sparc64/atomic/atomic_add.S b/common/lib/libc/arch/sparc64/atomic/atomic_add.S index 6834c4201c28..5c90fe83fabd 100644 --- a/common/lib/libc/arch/sparc64/atomic/atomic_add.S +++ b/common/lib/libc/arch/sparc64/atomic/atomic_add.S @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_add.S,v 1.2 2007/11/28 17:29:31 ad Exp $ */ +/* $NetBSD: atomic_add.S,v 1.3 2007/12/22 23:19:40 mrg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -68,14 +68,16 @@ ENTRY_NOPROFILE(_atomic_add_64) retl add %o1, %o2, %o0 ATOMIC_OP_ALIAS(atomic_add_64,_atomic_add_64) -ATOMIC_OP_ALIAS(atomic_add_long,_atomic_add_64) -STRONG_ALIAS(_atomic_add_long,_atomic_add_64) -ATOMIC_OP_ALIAS(atomic_add_ptr,_atomic_add_64) -STRONG_ALIAS(_atomic_add_ptr,_atomic_add_64) ATOMIC_OP_ALIAS(atomic_add_64_nv,_atomic_add_64) STRONG_ALIAS(_atomic_add_64_nv,_atomic_add_64) -ATOMIC_OP_ALIAS(atomic_add_long_nv,_atomic_add_64) -STRONG_ALIAS(_atomic_add_long_nv,_atomic_add_64) -ATOMIC_OP_ALIAS(atomic_add_ptr_nv,_atomic_add_64) -STRONG_ALIAS(_atomic_add_ptr_nv,_atomic_add_64) + +ATOMIC_OP_ALIAS_SIZE(atomic_add_long,_atomic_add) +STRONG_ALIAS_SIZE(_atomic_add_long,_atomic_add) +ATOMIC_OP_ALIAS_SIZE(atomic_add_ptr,_atomic_add) +STRONG_ALIAS_SIZE(_atomic_add_ptr,_atomic_add) + +ATOMIC_OP_ALIAS_SIZE(atomic_add_long_nv,_atomic_add) +STRONG_ALIAS_SIZE(_atomic_add_long_nv,_atomic_add) +ATOMIC_OP_ALIAS_SIZE(atomic_add_ptr_nv,_atomic_add) +STRONG_ALIAS_SIZE(_atomic_add_ptr_nv,_atomic_add) diff --git a/common/lib/libc/arch/sparc64/atomic/atomic_and.S b/common/lib/libc/arch/sparc64/atomic/atomic_and.S index 98bb56835129..a8a46a7997a5 100644 --- a/common/lib/libc/arch/sparc64/atomic/atomic_and.S +++ b/common/lib/libc/arch/sparc64/atomic/atomic_and.S @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_and.S,v 1.2 2007/11/28 17:29:32 ad Exp $ */ +/* $NetBSD: atomic_and.S,v 1.3 2007/12/22 23:19:40 mrg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -68,10 +68,12 @@ ENTRY_NOPROFILE(_atomic_and_64) retl and %o1, %o2, %o0 ATOMIC_OP_ALIAS(atomic_and_64,_atomic_and_64) -ATOMIC_OP_ALIAS(atomic_and_ulong,_atomic_and_64) -STRONG_ALIAS(_atomic_and_ulong,_atomic_and_64) ATOMIC_OP_ALIAS(atomic_and_64_nv,_atomic_and_64) STRONG_ALIAS(_atomic_and_64_nv,_atomic_and_64) -ATOMIC_OP_ALIAS(atomic_and_ulong_nv,_atomic_and_64) -STRONG_ALIAS(_atomic_and_ulong_nv,_atomic_and_64) + +ATOMIC_OP_ALIAS_SIZE(atomic_and_ulong,_atomic_and) +STRONG_ALIAS_SIZE(_atomic_and_ulong,_atomic_and) + +ATOMIC_OP_ALIAS_SIZE(atomic_and_ulong_nv,_atomic_and) +STRONG_ALIAS_SIZE(_atomic_and_ulong_nv,_atomic_and) diff --git a/common/lib/libc/arch/sparc64/atomic/atomic_cas.S b/common/lib/libc/arch/sparc64/atomic/atomic_cas.S index 305aa24deeb0..8e82d97303d3 100644 --- a/common/lib/libc/arch/sparc64/atomic/atomic_cas.S +++ b/common/lib/libc/arch/sparc64/atomic/atomic_cas.S @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas.S,v 1.2 2007/11/28 17:29:32 ad Exp $ */ +/* $NetBSD: atomic_cas.S,v 1.3 2007/12/22 23:19:40 mrg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -53,7 +53,8 @@ ENTRY_NOPROFILE(_atomic_cas_64) retl mov %o2, %o0 ATOMIC_OP_ALIAS(atomic_cas_64,_atomic_cas_64) -ATOMIC_OP_ALIAS(atomic_cas_ulong,_atomic_cas_64) -STRONG_ALIAS(_atomic_cas_ulong,_atomic_cas_64) -ATOMIC_OP_ALIAS(atomic_cas_ptr,_atomic_cas_64) -STRONG_ALIAS(_atomic_cas_ptr,_atomic_cas_64) + +ATOMIC_OP_ALIAS_SIZE(atomic_cas_ulong,_atomic_cas) +STRONG_ALIAS_SIZE(_atomic_cas_ulong,_atomic_cas) +ATOMIC_OP_ALIAS_SIZE(atomic_cas_ptr,_atomic_cas) +STRONG_ALIAS_SIZE(_atomic_cas_ptr,_atomic_cas) diff --git a/common/lib/libc/arch/sparc64/atomic/atomic_dec.S b/common/lib/libc/arch/sparc64/atomic/atomic_dec.S index 4541015d94f7..4fd3ac54943b 100644 --- a/common/lib/libc/arch/sparc64/atomic/atomic_dec.S +++ b/common/lib/libc/arch/sparc64/atomic/atomic_dec.S @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_dec.S,v 1.3 2007/11/30 17:11:48 ad Exp $ */ +/* $NetBSD: atomic_dec.S,v 1.4 2007/12/22 23:19:41 mrg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -68,14 +68,16 @@ ENTRY_NOPROFILE(_atomic_dec_64) retl add %o2, -1, %o0 ATOMIC_OP_ALIAS(atomic_dec_64,_atomic_dec_64) -ATOMIC_OP_ALIAS(atomic_dec_ulong,_atomic_dec_64) -STRONG_ALIAS(_atomic_dec_ulong,_atomic_dec_64) -ATOMIC_OP_ALIAS(atomic_dec_ptr,_atomic_dec_64) -STRONG_ALIAS(_atomic_dec_ptr,_atomic_dec_64) ATOMIC_OP_ALIAS(atomic_dec_64_nv,_atomic_dec_64) STRONG_ALIAS(_atomic_dec_64_nv,_atomic_dec_64) -ATOMIC_OP_ALIAS(atomic_dec_ulong_nv,_atomic_dec_64) -STRONG_ALIAS(_atomic_dec_ulong_nv,_atomic_dec_64) -ATOMIC_OP_ALIAS(atomic_dec_ptr_nv,_atomic_dec_64) -STRONG_ALIAS(_atomic_dec_ptr_nv,_atomic_dec_64) + +ATOMIC_OP_ALIAS_SIZE(atomic_dec_ulong,_atomic_dec) +STRONG_ALIAS_SIZE(_atomic_dec_ulong,_atomic_dec) +ATOMIC_OP_ALIAS_SIZE(atomic_dec_ptr,_atomic_dec) +STRONG_ALIAS_SIZE(_atomic_dec_ptr,_atomic_dec) + +ATOMIC_OP_ALIAS_SIZE(atomic_dec_ulong_nv,_atomic_dec) +STRONG_ALIAS_SIZE(_atomic_dec_ulong_nv,_atomic_dec) +ATOMIC_OP_ALIAS_SIZE(atomic_dec_ptr_nv,_atomic_dec) +STRONG_ALIAS_SIZE(_atomic_dec_ptr_nv,_atomic_dec) diff --git a/common/lib/libc/arch/sparc64/atomic/atomic_inc.S b/common/lib/libc/arch/sparc64/atomic/atomic_inc.S index 727cca8df2fc..4227d42e81bf 100644 --- a/common/lib/libc/arch/sparc64/atomic/atomic_inc.S +++ b/common/lib/libc/arch/sparc64/atomic/atomic_inc.S @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_inc.S,v 1.2 2007/11/28 17:29:32 ad Exp $ */ +/* $NetBSD: atomic_inc.S,v 1.3 2007/12/22 23:19:41 mrg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -68,14 +68,16 @@ ENTRY_NOPROFILE(_atomic_inc_64) retl add %o2, 1, %o0 ATOMIC_OP_ALIAS(atomic_inc_64,_atomic_inc_64) -ATOMIC_OP_ALIAS(atomic_inc_ulong,_atomic_inc_64) -STRONG_ALIAS(_atomic_inc_ulong,_atomic_inc_64) -ATOMIC_OP_ALIAS(atomic_inc_ptr,_atomic_inc_64) -STRONG_ALIAS(_atomic_inc_ptr,_atomic_inc_64) ATOMIC_OP_ALIAS(atomic_inc_64_nv,_atomic_inc_64) STRONG_ALIAS(_atomic_inc_64_nv,_atomic_inc_64) -ATOMIC_OP_ALIAS(atomic_inc_ulong_nv,_atomic_inc_64) -STRONG_ALIAS(_atomic_inc_ulong_nv,_atomic_inc_64) -ATOMIC_OP_ALIAS(atomic_inc_ptr_nv,_atomic_inc_64) -STRONG_ALIAS(_atomic_inc_ptr_nv,_atomic_inc_64) + +ATOMIC_OP_ALIAS_SIZE(atomic_inc_ulong,_atomic_inc) +STRONG_ALIAS_SIZE(_atomic_inc_ulong,_atomic_inc) +ATOMIC_OP_ALIAS_SIZE(atomic_inc_ptr,_atomic_inc) +STRONG_ALIAS_SIZE(_atomic_inc_ptr,_atomic_inc) + +ATOMIC_OP_ALIAS_SIZE(atomic_inc_ulong_nv,_atomic_inc) +STRONG_ALIAS_SIZE(_atomic_inc_ulong_nv,_atomic_inc) +ATOMIC_OP_ALIAS_SIZE(atomic_inc_ptr_nv,_atomic_inc) +STRONG_ALIAS_SIZE(_atomic_inc_ptr_nv,_atomic_inc) diff --git a/common/lib/libc/arch/sparc64/atomic/atomic_op_asm.h b/common/lib/libc/arch/sparc64/atomic/atomic_op_asm.h index 7239eeb7d330..d9d1213edc1b 100644 --- a/common/lib/libc/arch/sparc64/atomic/atomic_op_asm.h +++ b/common/lib/libc/arch/sparc64/atomic/atomic_op_asm.h @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_op_asm.h,v 1.2 2007/11/28 17:29:32 ad Exp $ */ +/* $NetBSD: atomic_op_asm.h,v 1.3 2007/12/22 23:19:41 mrg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -43,12 +43,30 @@ #if defined(_KERNEL) -#define ATOMIC_OP_ALIAS(a,s) STRONG_ALIAS(a,s) +#define ATOMIC_OP_ALIAS(a,s) STRONG_ALIAS(a,s) + +#ifdef __sparc64__ +#define ATOMIC_OP_ALIAS_SIZE(a,s) STRONG_ALIAS(a,s/**/_64) +#else +#define ATOMIC_OP_ALIAS_SIZE(a,s) STRONG_ALIAS(a,s/**/_32) +#endif #else /* _KERNEL */ -#define ATOMIC_OP_ALIAS(a,s) WEAK_ALIAS(a,s) +#define ATOMIC_OP_ALIAS(a,s) WEAK_ALIAS(a,s) + +#ifdef __sparc64__ +#define ATOMIC_OP_ALIAS_SIZE(a,s) WEAK_ALIAS(a,s/**/_64) +#else +#define ATOMIC_OP_ALIAS_SIZE(a,s) WEAK_ALIAS(a,s/**/_32) +#endif #endif /* _KERNEL */ +#ifdef __sparc64__ +#define STRONG_ALIAS_SIZE(a,s) STRONG_ALIAS(a,s/**/_64) +#else +#define STRONG_ALIAS_SIZE(a,s) STRONG_ALIAS(a,s/**/_32) +#endif + #endif /* _ATOMIC_OP_ASM_H_ */ diff --git a/common/lib/libc/arch/sparc64/atomic/atomic_or.S b/common/lib/libc/arch/sparc64/atomic/atomic_or.S index cff724cc1412..eb084fb5268f 100644 --- a/common/lib/libc/arch/sparc64/atomic/atomic_or.S +++ b/common/lib/libc/arch/sparc64/atomic/atomic_or.S @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_or.S,v 1.2 2007/11/28 17:29:33 ad Exp $ */ +/* $NetBSD: atomic_or.S,v 1.3 2007/12/22 23:19:41 mrg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -68,10 +68,12 @@ ENTRY_NOPROFILE(_atomic_or_64) retl or %o1, %o2, %o0 ATOMIC_OP_ALIAS(atomic_or_64,_atomic_or_64) -ATOMIC_OP_ALIAS(atomic_or_ulong,_atomic_or_64) -STRONG_ALIAS(_atomic_or_ulong,_atomic_or_64) ATOMIC_OP_ALIAS(atomic_or_64_nv,_atomic_or_64) STRONG_ALIAS(_atomic_or_64_nv,_atomic_or_64) -ATOMIC_OP_ALIAS(atomic_or_ulong_nv,_atomic_or_64) -STRONG_ALIAS(_atomic_or_ulong_nv,_atomic_or_64) + +ATOMIC_OP_ALIAS_SIZE(atomic_or_ulong,_atomic_or) +STRONG_ALIAS(_atomic_or_ulong,_atomic_or) + +ATOMIC_OP_ALIAS_SIZE(atomic_or_ulong_nv,_atomic_or) +STRONG_ALIAS_SIZE(_atomic_or_ulong_nv,_atomic_or) diff --git a/common/lib/libc/arch/sparc64/atomic/atomic_swap.S b/common/lib/libc/arch/sparc64/atomic/atomic_swap.S index 3bf06fb14561..cadf71311c21 100644 --- a/common/lib/libc/arch/sparc64/atomic/atomic_swap.S +++ b/common/lib/libc/arch/sparc64/atomic/atomic_swap.S @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_swap.S,v 1.2 2007/11/28 17:29:33 ad Exp $ */ +/* $NetBSD: atomic_swap.S,v 1.3 2007/12/22 23:19:41 mrg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -63,7 +63,8 @@ ENTRY_NOPROFILE(_atomic_swap_64) retl mov %o3, %o0 ATOMIC_OP_ALIAS(atomic_swap_64,_atomic_swap_64) -ATOMIC_OP_ALIAS(atomic_swap_ulong,_atomic_swap_64) -STRONG_ALIAS(_atomic_swap_ulong,_atomic_swap_64) -ATOMIC_OP_ALIAS(atomic_swap_ptr,_atomic_swap_64) -STRONG_ALIAS(_atomic_swap_ptr,_atomic_swap_64) + +ATOMIC_OP_ALIAS_SIZE(atomic_swap_ulong,_atomic_swap) +STRONG_ALIAS_SIZE(_atomic_swap_ulong,_atomic_swap) +ATOMIC_OP_ALIAS_SIZE(atomic_swap_ptr,_atomic_swap) +STRONG_ALIAS_SIZE(_atomic_swap_ptr,_atomic_swap)