Add missing __sync_lock_test_and_set_* aliases for PR lib/48601diff -r1.4 -r1.5 src/common/lib/libc/atomic/atomic_swap_32_cas.c
(martin)
--- src/common/lib/libc/atomic/atomic_swap_32_cas.c 2008/04/28 20:22:53 1.4
+++ src/common/lib/libc/atomic/atomic_swap_32_cas.c 2014/02/21 10:27:34 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_swap_32_cas.c,v 1.4 2008/04/28 20:22:53 martin Exp $ */ | 1 | /* $NetBSD: atomic_swap_32_cas.c,v 1.5 2014/02/21 10:27:34 martin Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2007 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -40,21 +40,22 @@ atomic_swap_32(volatile uint32_t *addr, | @@ -40,21 +40,22 @@ atomic_swap_32(volatile uint32_t *addr, | |||
40 | 40 | |||
41 | do { | 41 | do { | |
42 | old = *addr; | 42 | old = *addr; | |
43 | } while (atomic_cas_32(addr, old, new) != old); | 43 | } while (atomic_cas_32(addr, old, new) != old); | |
44 | 44 | |||
45 | return (old); | 45 | return (old); | |
46 | } | 46 | } | |
47 | 47 | |||
48 | #undef atomic_swap_32 | 48 | #undef atomic_swap_32 | |
49 | atomic_op_alias(atomic_swap_32,_atomic_swap_32) | 49 | atomic_op_alias(atomic_swap_32,_atomic_swap_32) | |
50 | #undef atomic_swap_uint | 50 | #undef atomic_swap_uint | |
51 | atomic_op_alias(atomic_swap_uint,_atomic_swap_32) | 51 | atomic_op_alias(atomic_swap_uint,_atomic_swap_32) | |
52 | __strong_alias(_atomic_swap_uint,_atomic_swap_32) | 52 | __strong_alias(_atomic_swap_uint,_atomic_swap_32) | |
53 | __strong_alias(__sync_lock_test_and_set_4,_atomic_swap_32) | |||
53 | #if !defined(_LP64) | 54 | #if !defined(_LP64) | |
54 | #undef atomic_swap_ulong | 55 | #undef atomic_swap_ulong | |
55 | atomic_op_alias(atomic_swap_ulong,_atomic_swap_32) | 56 | atomic_op_alias(atomic_swap_ulong,_atomic_swap_32) | |
56 | __strong_alias(_atomic_swap_ulong,_atomic_swap_32) | 57 | __strong_alias(_atomic_swap_ulong,_atomic_swap_32) | |
57 | #undef atomic_swap_ptr | 58 | #undef atomic_swap_ptr | |
58 | atomic_op_alias(atomic_swap_ptr,_atomic_swap_32) | 59 | atomic_op_alias(atomic_swap_ptr,_atomic_swap_32) | |
59 | __strong_alias(_atomic_swap_ptr,_atomic_swap_32) | 60 | __strong_alias(_atomic_swap_ptr,_atomic_swap_32) | |
60 | #endif /* _LP64 */ | 61 | #endif /* _LP64 */ |
--- src/common/lib/libc/atomic/atomic_swap_64_cas.c 2008/04/28 20:22:53 1.5
+++ src/common/lib/libc/atomic/atomic_swap_64_cas.c 2014/02/21 10:27:34 1.6
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: atomic_swap_64_cas.c,v 1.5 2008/04/28 20:22:53 martin Exp $ */ | 1 | /* $NetBSD: atomic_swap_64_cas.c,v 1.6 2014/02/21 10:27:34 martin Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2007 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2007 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe. | 8 | * by Jason R. Thorpe. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -43,19 +43,20 @@ atomic_swap_64(volatile uint64_t *addr, | @@ -43,19 +43,20 @@ atomic_swap_64(volatile uint64_t *addr, | |||
43 | do { | 43 | do { | |
44 | old = *addr; | 44 | old = *addr; | |
45 | } while (atomic_cas_64(addr, old, new) != old); | 45 | } while (atomic_cas_64(addr, old, new) != old); | |
46 | 46 | |||
47 | return (old); | 47 | return (old); | |
48 | } | 48 | } | |
49 | 49 | |||
50 | #undef atomic_swap_64 | 50 | #undef atomic_swap_64 | |
51 | atomic_op_alias(atomic_swap_64,_atomic_swap_64) | 51 | atomic_op_alias(atomic_swap_64,_atomic_swap_64) | |
52 | #if defined(_LP64) | 52 | #if defined(_LP64) | |
53 | #undef atomic_swap_ulong | 53 | #undef atomic_swap_ulong | |
54 | atomic_op_alias(atomic_swap_ulong,_atomic_swap_64) | 54 | atomic_op_alias(atomic_swap_ulong,_atomic_swap_64) | |
55 | __strong_alias(_atomic_swap_ulong,_atomic_swap_64) | 55 | __strong_alias(_atomic_swap_ulong,_atomic_swap_64) | |
56 | __strong_alias(__sync_lock_test_and_set_8,_atomic_swap_64) | |||
56 | #undef atomic_swap_ptr | 57 | #undef atomic_swap_ptr | |
57 | atomic_op_alias(atomic_swap_ptr,_atomic_swap_64) | 58 | atomic_op_alias(atomic_swap_ptr,_atomic_swap_64) | |
58 | __strong_alias(_atomic_swap_ptr,_atomic_swap_64) | 59 | __strong_alias(_atomic_swap_ptr,_atomic_swap_64) | |
59 | #endif /* _LP64 */ | 60 | #endif /* _LP64 */ | |
60 | 61 | |||
61 | #endif | 62 | #endif |