1 // SPDX-FileCopyrightText: 1991-1994 by Xerox Corporation. All rights reserved.
2 // SPDX-FileCopyrightText: 1996-1999 by Silicon Graphics. All rights reserved.
3 // SPDX-FileCopyrightText: 1999-2003 Hewlett-Packard Development Company, L.P.
4 // SPDX-FileCopyrightText: 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 // SPDX-License-Identifier: LicenseRef-Boehm-GC
8 #ifndef _URCU_ARCH_UATOMIC_SPARC64_H
9 #define _URCU_ARCH_UATOMIC_SPARC64_H
12 * Code inspired from libuatomic_ops-1.2, inherited in part from the
13 * Boehm-Demers-Weiser conservative garbage collector.
16 #include <urcu/compiler.h>
17 #include <urcu/system.h>
25 static inline __attribute__((always_inline
))
26 unsigned long _uatomic_cmpxchg(void *addr
, unsigned long old
,
27 unsigned long _new
, int len
)
32 __asm__
__volatile__ (
33 "membar #StoreLoad | #LoadLoad\n\t"
35 "membar #StoreLoad | #StoreStore\n\t"
37 : "r" (addr
), "r" (old
)
42 #if (CAA_BITS_PER_LONG == 64)
45 __asm__
__volatile__ (
46 "membar #StoreLoad | #LoadLoad\n\t"
48 "membar #StoreLoad | #StoreStore\n\t"
50 : "r" (addr
), "r" (old
)
62 #define uatomic_cmpxchg(addr, old, _new) \
63 ((__typeof__(*(addr))) _uatomic_cmpxchg((addr), \
64 caa_cast_long_keep_sign(old), \
65 caa_cast_long_keep_sign(_new), \
72 #include <urcu/uatomic/generic.h>
74 #endif /* _URCU_ARCH_UATOMIC_PPC_H */
This page took 0.037771 seconds and 5 git commands to generate.