summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2004-11-23 16:32:34 +0000
committercognet <cognet@FreeBSD.org>2004-11-23 16:32:34 +0000
commitd983d8756d4cfbe55c19b3b16b59d4bcc926bca5 (patch)
tree06ab6114d6886de4c6eb5ae1e6aa366d6336197e /libexec
parent61c101ec0de2d94095739fdab995de15573f579c (diff)
downloadFreeBSD-src-d983d8756d4cfbe55c19b3b16b59d4bcc926bca5.zip
FreeBSD-src-d983d8756d4cfbe55c19b3b16b59d4bcc926bca5.tar.gz
Implement a dummy atomic_cmpset_32(). It should be safe to use it in rtld as
the signals are masked anyway.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/arm/rtld_machdep.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libexec/rtld-elf/arm/rtld_machdep.h b/libexec/rtld-elf/arm/rtld_machdep.h
index 8e841e0..cc1410c 100644
--- a/libexec/rtld-elf/arm/rtld_machdep.h
+++ b/libexec/rtld-elf/arm/rtld_machdep.h
@@ -70,4 +70,15 @@ typedef struct {
void _rtld_bind_start(void);
extern void *__tls_get_addr(tls_index *ti);
+
+static __inline u_int32_t
+atomic_cmpset_32(volatile u_int32_t *p, u_int32_t cmpval, u_int32_t newval)
+{
+
+ if (*p == cmpval) {
+ *p = newval;
+ return (1);
+ }
+ return (0);
+}
#endif
OpenPOWER on IntegriCloud