atomic_op_namespace.h revision 1.1.2.1 1 1.1.2.1 thorpej /* $NetBSD: atomic_op_namespace.h,v 1.1.2.1 2007/04/16 03:19:59 thorpej Exp $ */
2 1.1.2.1 thorpej
3 1.1.2.1 thorpej /*-
4 1.1.2.1 thorpej * Copyright (c) 2007 The NetBSD Foundation, Inc.
5 1.1.2.1 thorpej * All rights reserved.
6 1.1.2.1 thorpej *
7 1.1.2.1 thorpej * This code is derived from software contributed to The NetBSD Foundation
8 1.1.2.1 thorpej * by Jason R. Thorpe.
9 1.1.2.1 thorpej *
10 1.1.2.1 thorpej * Redistribution and use in source and binary forms, with or without
11 1.1.2.1 thorpej * modification, are permitted provided that the following conditions
12 1.1.2.1 thorpej * are met:
13 1.1.2.1 thorpej * 1. Redistributions of source code must retain the above copyright
14 1.1.2.1 thorpej * notice, this list of conditions and the following disclaimer.
15 1.1.2.1 thorpej * 2. Redistributions in binary form must reproduce the above copyright
16 1.1.2.1 thorpej * notice, this list of conditions and the following disclaimer in the
17 1.1.2.1 thorpej * documentation and/or other materials provided with the distribution.
18 1.1.2.1 thorpej * 3. All advertising materials mentioning features or use of this software
19 1.1.2.1 thorpej * must display the following acknowledgement:
20 1.1.2.1 thorpej * This product includes software developed by the NetBSD
21 1.1.2.1 thorpej * Foundation, Inc. and its contributors.
22 1.1.2.1 thorpej * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1.2.1 thorpej * contributors may be used to endorse or promote products derived
24 1.1.2.1 thorpej * from this software without specific prior written permission.
25 1.1.2.1 thorpej *
26 1.1.2.1 thorpej * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1.2.1 thorpej * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1.2.1 thorpej * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1.2.1 thorpej * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1.2.1 thorpej * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1.2.1 thorpej * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1.2.1 thorpej * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1.2.1 thorpej * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1.2.1 thorpej * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1.2.1 thorpej * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1.2.1 thorpej * POSSIBILITY OF SUCH DAMAGE.
37 1.1.2.1 thorpej */
38 1.1.2.1 thorpej
39 1.1.2.1 thorpej #ifndef _ATOMIC_OP_NAMESPACE_H_
40 1.1.2.1 thorpej #define _ATOMIC_OP_NAMESPACE_H_
41 1.1.2.1 thorpej
42 1.1.2.1 thorpej #include <sys/cdefs.h>
43 1.1.2.1 thorpej
44 1.1.2.1 thorpej #if !defined(__lint__)
45 1.1.2.1 thorpej
46 1.1.2.1 thorpej #define atomic_add_8 _atomic_add_8
47 1.1.2.1 thorpej #define atomic_add_char _atomic_add_char
48 1.1.2.1 thorpej #define atomic_add_16 _atomic_add_16
49 1.1.2.1 thorpej #define atomic_add_short _atomic_add_short
50 1.1.2.1 thorpej #define atomic_add_32 _atomic_add_32
51 1.1.2.1 thorpej #define atomic_add_int _atomic_add_int
52 1.1.2.1 thorpej #define atomic_add_long _atomic_add_long
53 1.1.2.1 thorpej #define atomic_add_ptr _atomic_add_ptr
54 1.1.2.1 thorpej #define atomic_add_64 _atomic_add_64
55 1.1.2.1 thorpej
56 1.1.2.1 thorpej #define atomic_add_8_nv _atomic_add_8_nv
57 1.1.2.1 thorpej #define atomic_add_char_nv _atomic_add_char_nv
58 1.1.2.1 thorpej #define atomic_add_16_nv _atomic_add_16_nv
59 1.1.2.1 thorpej #define atomic_add_short_nv _atomic_add_short_nv
60 1.1.2.1 thorpej #define atomic_add_32_nv _atomic_add_32_nv
61 1.1.2.1 thorpej #define atomic_add_int_nv _atomic_add_int_nv
62 1.1.2.1 thorpej #define atomic_add_long_nv _atomic_add_long_nv
63 1.1.2.1 thorpej #define atomic_add_ptr_nv _atomic_add_ptr_nv
64 1.1.2.1 thorpej #define atomic_add_64_nv _atomic_add_64_nv
65 1.1.2.1 thorpej
66 1.1.2.1 thorpej #define atomic_and_8 _atomic_and_8
67 1.1.2.1 thorpej #define atomic_and_uchar _atomic_and_uchar
68 1.1.2.1 thorpej #define atomic_and_16 _atomic_and_16
69 1.1.2.1 thorpej #define atomic_and_ushort _atomic_and_ushort
70 1.1.2.1 thorpej #define atomic_and_32 _atomic_and_32
71 1.1.2.1 thorpej #define atomic_and_uint _atomic_and_uint
72 1.1.2.1 thorpej #define atomic_and_ulong _atomic_and_ulong
73 1.1.2.1 thorpej #define atomic_and_64 _atomic_and_64
74 1.1.2.1 thorpej
75 1.1.2.1 thorpej #define atomic_and_8_nv _atomic_and_8_nv
76 1.1.2.1 thorpej #define atomic_and_uchar_nv _atomic_and_uchar_nv
77 1.1.2.1 thorpej #define atomic_and_16_nv _atomic_and_16_nv
78 1.1.2.1 thorpej #define atomic_and_ushort_nv _atomic_and_ushort_nv
79 1.1.2.1 thorpej #define atomic_and_32_nv _atomic_and_32_nv
80 1.1.2.1 thorpej #define atomic_and_uint_nv _atomic_and_uint_nv
81 1.1.2.1 thorpej #define atomic_and_ulong_nv _atomic_and_ulong_nv
82 1.1.2.1 thorpej #define atomic_and_64_nv _atomic_and_64_nv
83 1.1.2.1 thorpej
84 1.1.2.1 thorpej #define atomic_or_8 _atomic_or_8
85 1.1.2.1 thorpej #define atomic_or_uchar _atomic_or_uchar
86 1.1.2.1 thorpej #define atomic_or_16 _atomic_or_16
87 1.1.2.1 thorpej #define atomic_or_ushort _atomic_or_ushort
88 1.1.2.1 thorpej #define atomic_or_32 _atomic_or_32
89 1.1.2.1 thorpej #define atomic_or_uint _atomic_or_uint
90 1.1.2.1 thorpej #define atomic_or_ulong _atomic_or_ulong
91 1.1.2.1 thorpej #define atomic_or_64 _atomic_or_64
92 1.1.2.1 thorpej
93 1.1.2.1 thorpej #define atomic_or_8_nv _atomic_or_8_nv
94 1.1.2.1 thorpej #define atomic_or_uchar_nv _atomic_or_uchar_nv
95 1.1.2.1 thorpej #define atomic_or_16_nv _atomic_or_16_nv
96 1.1.2.1 thorpej #define atomic_or_ushort_nv _atomic_or_ushort_nv
97 1.1.2.1 thorpej #define atomic_or_32_nv _atomic_or_32_nv
98 1.1.2.1 thorpej #define atomic_or_uint_nv _atomic_or_uint_nv
99 1.1.2.1 thorpej #define atomic_or_ulong_nv _atomic_or_ulong_nv
100 1.1.2.1 thorpej #define atomic_or_64_nv _atomic_or_64_nv
101 1.1.2.1 thorpej
102 1.1.2.1 thorpej #define atomic_cas_8 _atomic_cas_8
103 1.1.2.1 thorpej #define atomic_cas_uchar _atomic_cas_uchar
104 1.1.2.1 thorpej #define atomic_cas_16 _atomic_cas_16
105 1.1.2.1 thorpej #define atomic_cas_ushort _atomic_cas_ushort
106 1.1.2.1 thorpej #define atomic_cas_32 _atomic_cas_32
107 1.1.2.1 thorpej #define atomic_cas_uint _atomic_cas_uint
108 1.1.2.1 thorpej #define atomic_cas_ulong _atomic_cas_ulong
109 1.1.2.1 thorpej #define atomic_cas_ptr _atomic_cas_ptr
110 1.1.2.1 thorpej #define atomic_cas_64 _atomic_cas_64
111 1.1.2.1 thorpej
112 1.1.2.1 thorpej #define atomic_swap_8 _atomic_swap_8
113 1.1.2.1 thorpej #define atomic_swap_uchar _atomic_swap_uchar
114 1.1.2.1 thorpej #define atomic_swap_16 _atomic_swap_16
115 1.1.2.1 thorpej #define atomic_swap_ushort _atomic_swap_ushort
116 1.1.2.1 thorpej #define atomic_swap_32 _atomic_swap_32
117 1.1.2.1 thorpej #define atomic_swap_uint _atomic_swap_uint
118 1.1.2.1 thorpej #define atomic_swap_ulong _atomic_swap_ulong
119 1.1.2.1 thorpej #define atomic_swap_ptr _atomic_swap_ptr
120 1.1.2.1 thorpej #define atomic_swap_64 _atomic_swap_64
121 1.1.2.1 thorpej
122 1.1.2.1 thorpej #define atomic_dec_8 _atomic_dec_8
123 1.1.2.1 thorpej #define atomic_dec_uchar _atomic_dec_uchar
124 1.1.2.1 thorpej #define atomic_dec_16 _atomic_dec_16
125 1.1.2.1 thorpej #define atomic_dec_ushort _atomic_dec_ushort
126 1.1.2.1 thorpej #define atomic_dec_32 _atomic_dec_32
127 1.1.2.1 thorpej #define atomic_dec_uint _atomic_dec_uint
128 1.1.2.1 thorpej #define atomic_dec_ulong _atomic_dec_ulong
129 1.1.2.1 thorpej #define atomic_dec_ptr _atomic_dec_ptr
130 1.1.2.1 thorpej #define atomic_dec_64 _atomic_dec_64
131 1.1.2.1 thorpej
132 1.1.2.1 thorpej #define atomic_dec_8_nv _atomic_dec_8_nv
133 1.1.2.1 thorpej #define atomic_dec_uchar_nv _atomic_dec_uchar_nv
134 1.1.2.1 thorpej #define atomic_dec_16_nv _atomic_dec_16_nv
135 1.1.2.1 thorpej #define atomic_dec_ushort_nv _atomic_dec_ushort_nv
136 1.1.2.1 thorpej #define atomic_dec_32_nv _atomic_dec_32_nv
137 1.1.2.1 thorpej #define atomic_dec_uint_nv _atomic_dec_uint_nv
138 1.1.2.1 thorpej #define atomic_dec_ptr_nv _atomic_dec_ptr_nv
139 1.1.2.1 thorpej #define atomic_dec_64_nv _atomic_dec_64_nv
140 1.1.2.1 thorpej
141 1.1.2.1 thorpej #define atomic_inc_8 _atomic_inc_8
142 1.1.2.1 thorpej #define atomic_inc_uchar _atomic_inc_uchar
143 1.1.2.1 thorpej #define atomic_inc_16 _atomic_inc_16
144 1.1.2.1 thorpej #define atomic_inc_ushort _atomic_inc_ushort
145 1.1.2.1 thorpej #define atomic_inc_32 _atomic_inc_32
146 1.1.2.1 thorpej #define atomic_inc_uint _atomic_inc_uint
147 1.1.2.1 thorpej #define atomic_inc_ulong _atomic_inc_ulong
148 1.1.2.1 thorpej #define atomic_inc_ptr _atomic_inc_ptr
149 1.1.2.1 thorpej #define atomic_inc_64 _atomic_inc_64
150 1.1.2.1 thorpej
151 1.1.2.1 thorpej #define atomic_inc_8_nv _atomic_inc_8_nv
152 1.1.2.1 thorpej #define atomic_inc_uchar_nv _atomic_inc_uchar_nv
153 1.1.2.1 thorpej #define atomic_inc_16_nv _atomic_inc_16_nv
154 1.1.2.1 thorpej #define atomic_inc_ushort_nv _atomic_inc_ushort_nv
155 1.1.2.1 thorpej #define atomic_inc_32_nv _atomic_inc_32_nv
156 1.1.2.1 thorpej #define atomic_inc_uint_nv _atomic_inc_uint_nv
157 1.1.2.1 thorpej #define atomic_inc_ptr_nv _atomic_inc_ptr_nv
158 1.1.2.1 thorpej #define atomic_inc_64_nv _atomic_inc_64_nv
159 1.1.2.1 thorpej
160 1.1.2.1 thorpej #define membar_enter _membar_enter
161 1.1.2.1 thorpej #define membar_exit _membar_exit
162 1.1.2.1 thorpej #define membar_producer _membar_producer
163 1.1.2.1 thorpej #define membar_consumer _membar_consumer
164 1.1.2.1 thorpej #define membar_sync _membar_sync
165 1.1.2.1 thorpej #define membar_write _membar_write
166 1.1.2.1 thorpej #define membar_read _membar_read
167 1.1.2.1 thorpej
168 1.1.2.1 thorpej #endif /* __lint__ */
169 1.1.2.1 thorpej
170 1.1.2.1 thorpej #if defined(_KERNEL)
171 1.1.2.1 thorpej #define atomic_op_alias(a,s) __strong_alias(a,s)
172 1.1.2.1 thorpej #else
173 1.1.2.1 thorpej #define atomic_op_alias(a,s) __weak_alias(a,s)
174 1.1.2.1 thorpej #endif /* _KERNEL */
175 1.1.2.1 thorpej
176 1.1.2.1 thorpej #endif /* _ATOMIC_OP_NAMESPACE_H_ */
177