diff options
| author | austinf <austinf@localhost> | 2009-03-21 21:15:54 +0000 |
|---|---|---|
| committer | austinf <austinf@localhost> | 2009-03-21 21:15:54 +0000 |
| commit | 6238304c324b26949f383518f036d6029efbb8ec (patch) | |
| tree | fd064dfe1194e18565d0af04e9dad78f53fdb5d7 /libc/sysdeps/linux/sparc | |
| parent | bd623c44decda992caabc8c15a22922e1be316bc (diff) | |
| download | uClibc-alpine-6238304c324b26949f383518f036d6029efbb8ec.tar.bz2 uClibc-alpine-6238304c324b26949f383518f036d6029efbb8ec.tar.xz | |
sparc atomic.h: resort to v7/v8 atomic operations in the static case,
since we have no _dl_hwcap to test whether we can use v9 at runtime
Diffstat (limited to 'libc/sysdeps/linux/sparc')
| -rw-r--r-- | libc/sysdeps/linux/sparc/bits/atomic.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/libc/sysdeps/linux/sparc/bits/atomic.h b/libc/sysdeps/linux/sparc/bits/atomic.h index ef553f727..f625eb92a 100644 --- a/libc/sysdeps/linux/sparc/bits/atomic.h +++ b/libc/sysdeps/linux/sparc/bits/atomic.h @@ -233,18 +233,20 @@ volatile unsigned char __sparc32_atomic_locks[64] #else -/* In libc.a/libpthread.a etc. we don't know if we'll be run on + + +/* + Here's what we'd like to do: + + In libc.a/libpthread.a etc. we don't know if we'll be run on pre-v9 or v9 CPU. To be interoperable with dynamically linked apps on v9 CPUs e.g. with process shared primitives, use cas insn - on v9 CPUs and ldstub on pre-v9. */ - -/* Avoid <ldsodefs.h> include here. */ -extern uint64_t _dl_hwcap __attribute__((weak)); -# define __ATOMIC_HWCAP_SPARC_V9 16 -# define __atomic_is_v9 \ - (__builtin_expect (&_dl_hwcap != 0, 1) \ - && __builtin_expect (_dl_hwcap & __ATOMIC_HWCAP_SPARC_V9, \ - __ATOMIC_HWCAP_SPARC_V9)) + on v9 CPUs and ldstub on pre-v9. + + However, we have no good way to test at run time that I know of, + so resort to the lowest common denominator (v7 ops) -austinf + */ +#define __atomic_is_v9 0 # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \ ({ \ |
