b68c818c52ae99d1cbd263fba01fe5135ecf76b3
[urcu.git] / urcu / uatomic_arch_armv7l.h
1 #ifndef _URCU_ARCH_UATOMIC_ARMV7L_H
2 #define _URCU_ARCH_UATOMIC_ARMV7L_H
3
4 /*
5 * Atomics for ARMv7. This approach is usable on kernels back to 2.6.15.
6 *
7 * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
8 * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
9 * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P.
10 * Copyright (c) 2009 Mathieu Desnoyers
11 * Copyright (c) 2010 Paul E. McKenney, IBM Corporation
12 * (Adapted from uatomic_arch_ppc.h)
13 *
14 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
15 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
16 *
17 * Permission is hereby granted to use or copy this program
18 * for any purpose, provided the above notices are retained on all copies.
19 * Permission to modify the code and to distribute modified code is granted,
20 * provided the above notices are retained, and a notice that the code was
21 * modified is included with the above copyright notice.
22 *
23 * Code inspired from libuatomic_ops-1.2, inherited in part from the
24 * Boehm-Demers-Weiser conservative garbage collector.
25 */
26
27 #include <urcu/compiler.h>
28 #include <urcu/system.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /* xchg */
35 #define uatomic_xchg(addr, v) __sync_lock_test_and_set(addr, v)
36
37 /* cmpxchg */
38 #define uatomic_cmpxchg(addr, old, _new) \
39 __sync_val_compare_and_swap(addr, old, _new)
40
41 /* uatomic_add_return */
42 #define uatomic_add_return(addr, v) __sync_add_and_fetch(addr, v)
43
44 #ifdef __cplusplus
45 }
46 #endif
47
48 #include <urcu/uatomic_generic.h>
49
50 #endif /* _URCU_ARCH_UATOMIC_ARMV7L_H */
This page took 0.029905 seconds and 3 git commands to generate.