1 #ifndef _URCU_ARCH_UATOMIC_SPARC64_H
2 #define _URCU_ARCH_UATOMIC_SPARC64_H
5 * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
6 * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
7 * Copyright (c) 1999-2003 by Hewlett-Packard Company. All rights reserved.
8 * Copyright (c) 2009 Mathieu Desnoyers
10 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
11 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
13 * Permission is hereby granted to use or copy this program
14 * for any purpose, provided the above notices are retained on all copies.
15 * Permission to modify the code and to distribute modified code is granted,
16 * provided the above notices are retained, and a notice that the code was
17 * modified is included with the above copyright notice.
19 * Code inspired from libuatomic_ops-1.2, inherited in part from the
20 * Boehm-Demers-Weiser conservative garbage collector.
23 #include <urcu/compiler.h>
24 #include <urcu/system.h>
32 static inline __attribute__((always_inline
))
33 unsigned long _uatomic_cmpxchg(void *addr
, unsigned long old
,
34 unsigned long _new
, int len
)
39 __asm__
__volatile__ (
40 "membar #StoreLoad | #LoadLoad\n\t"
42 "membar #StoreLoad | #StoreStore\n\t"
44 : "r" (addr
), "r" (old
)
49 #if (CAA_BITS_PER_LONG == 64)
52 __asm__
__volatile__ (
53 "membar #StoreLoad | #LoadLoad\n\t"
55 "membar #StoreLoad | #StoreStore\n\t"
57 : "r" (addr
), "r" (old
)
69 #define uatomic_cmpxchg(addr, old, _new) \
70 ((__typeof__(*(addr))) _uatomic_cmpxchg((addr), \
71 caa_cast_long_keep_sign(old), \
72 caa_cast_long_keep_sign(_new), \
79 #include <urcu/uatomic/generic.h>
81 #endif /* _URCU_ARCH_UATOMIC_PPC_H */
This page took 0.029938 seconds and 4 git commands to generate.