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-2004 Hewlett-Packard Development Company, L.P.
4 // SPDX-FileCopyrightText: 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 // SPDX-FileCopyrightText: 2010 Paul E. McKenney, IBM Corporation
7 // SPDX-License-Identifier: LicenseRef-Boehm-GC
9 #ifndef _URCU_ARCH_UATOMIC_ARM_H
10 #define _URCU_ARCH_UATOMIC_ARM_H
13 * Atomics for ARM. This approach is usable on kernels back to 2.6.15.
15 * Code inspired from libuatomic_ops-1.2, inherited in part from the
16 * Boehm-Demers-Weiser conservative garbage collector.
19 #include <urcu/compiler.h>
20 #include <urcu/system.h>
21 #include <urcu/arch.h>
30 * Based on [1], __sync_lock_test_and_set() is not a full barrier, but
31 * instead only an acquire barrier. Given that uatomic_xchg() acts as
32 * both release and acquire barriers, we therefore need to have our own
33 * release barrier before this operation.
35 * [1] https://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
37 #define uatomic_xchg(addr, v) \
40 __sync_lock_test_and_set(addr, v); \
47 #include <urcu/uatomic/generic.h>
49 #endif /* _URCU_ARCH_UATOMIC_ARM_H */
This page took 0.033705 seconds and 5 git commands to generate.