aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-06-17 19:12:40 -0400
committerTejun Heo <tj@kernel.org>2014-06-17 19:12:40 -0400
commiteba117889ac444bea6e8270049cbaeed48169889 (patch)
tree81aa1ba187d57a52b0cd81788bc381cc3dc17b09 /include/asm-generic
parentcadb1c4db2d33e0a818f645cd1963a479dab91e2 (diff)
percpu: preffity percpu header files
percpu macros are difficult to read. It's partly because they're fairly complex but also because they simply lack visual and conventional consistency to an unusual degree. The preceding patches tried to organize macro definitions consistently by their roles. This patch makes the following cosmetic changes to improve overall readability. * Use consistent convention for multi-line macro definitions - "do {" or "({" are now put on their own lines and the line continuing '\' are all put on the same column. * Temp variables used inside macro are consistently given "__" prefix. * When a macro argument is passed to another macro or a function, putting extra parenthses around it doesn't help anything. Don't put them. * _this_cpu_generic_*() are renamed to this_cpu_generic_*() so that they're consistent with raw_cpu_generic_*(). * Reorganize raw_cpu_*() and this_cpu_*() definitions so that trivial wrappers are collected in one place after actual operation definitions. * Other misc cleanups including reorganizing comments. All changes in this patch are cosmetic and cause no functional difference. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Christoph Lameter <cl@linux.com>
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/percpu.h581
1 files changed, 296 insertions, 285 deletions
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 2300d989087b..4d9f233c4ba8 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -77,333 +77,344 @@ do { \
77}) 77})
78 78
79#define raw_cpu_generic_xchg(pcp, nval) \ 79#define raw_cpu_generic_xchg(pcp, nval) \
80({ typeof(pcp) ret__; \ 80({ \
81 ret__ = raw_cpu_read(pcp); \ 81 typeof(pcp) __ret; \
82 __ret = raw_cpu_read(pcp); \
82 raw_cpu_write(pcp, nval); \ 83 raw_cpu_write(pcp, nval); \
83 ret__; \ 84 __ret; \
84}) 85})
85 86
86#define raw_cpu_generic_cmpxchg(pcp, oval, nval) \ 87#define raw_cpu_generic_cmpxchg(pcp, oval, nval) \
87({ \ 88({ \
88 typeof(pcp) ret__; \ 89 typeof(pcp) __ret; \
89 ret__ = raw_cpu_read(pcp); \ 90 __ret = raw_cpu_read(pcp); \
90 if (ret__ == (oval)) \ 91 if (__ret == (oval)) \
91 raw_cpu_write(pcp, nval); \ 92 raw_cpu_write(pcp, nval); \
92 ret__; \ 93 __ret; \
93}) 94})
94 95
95#define raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 96#define raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
96({ \ 97({ \
97 int __ret = 0; \ 98 int __ret = 0; \
98 if (raw_cpu_read(pcp1) == (oval1) && \ 99 if (raw_cpu_read(pcp1) == (oval1) && \
99 raw_cpu_read(pcp2) == (oval2)) { \ 100 raw_cpu_read(pcp2) == (oval2)) { \
100 raw_cpu_write(pcp1, (nval1)); \ 101 raw_cpu_write(pcp1, nval1); \
101 raw_cpu_write(pcp2, (nval2)); \ 102 raw_cpu_write(pcp2, nval2); \
102 __ret = 1; \ 103 __ret = 1; \
103 } \ 104 } \
104 (__ret); \ 105 (__ret); \
105}) 106})
106 107
107#define _this_cpu_generic_read(pcp) \ 108#define this_cpu_generic_read(pcp) \
108({ typeof(pcp) ret__; \ 109({ \
110 typeof(pcp) __ret; \
109 preempt_disable(); \ 111 preempt_disable(); \
110 ret__ = *this_cpu_ptr(&(pcp)); \ 112 __ret = *this_cpu_ptr(&(pcp)); \
111 preempt_enable(); \ 113 preempt_enable(); \
112 ret__; \ 114 __ret; \
113}) 115})
114 116
115#define _this_cpu_generic_to_op(pcp, val, op) \ 117#define this_cpu_generic_to_op(pcp, val, op) \
116do { \ 118do { \
117 unsigned long flags; \ 119 unsigned long __flags; \
118 raw_local_irq_save(flags); \ 120 raw_local_irq_save(__flags); \
119 *raw_cpu_ptr(&(pcp)) op val; \ 121 *raw_cpu_ptr(&(pcp)) op val; \
120 raw_local_irq_restore(flags); \ 122 raw_local_irq_restore(__flags); \
121} while (0) 123} while (0)
122 124
123#define _this_cpu_generic_add_return(pcp, val) \ 125#define this_cpu_generic_add_return(pcp, val) \
124({ \ 126({ \
125 typeof(pcp) ret__; \ 127 typeof(pcp) __ret; \
126 unsigned long flags; \ 128 unsigned long __flags; \
127 raw_local_irq_save(flags); \ 129 raw_local_irq_save(__flags); \
128 raw_cpu_add(pcp, val); \ 130 raw_cpu_add(pcp, val); \
129 ret__ = raw_cpu_read(pcp); \ 131 __ret = raw_cpu_read(pcp); \
130 raw_local_irq_restore(flags); \ 132 raw_local_irq_restore(__flags); \
131 ret__; \ 133 __ret; \
132}) 134})
133 135
134#define _this_cpu_generic_xchg(pcp, nval) \ 136#define this_cpu_generic_xchg(pcp, nval) \
135({ typeof(pcp) ret__; \ 137({ \
136 unsigned long flags; \ 138 typeof(pcp) __ret; \
137 raw_local_irq_save(flags); \ 139 unsigned long __flags; \
138 ret__ = raw_cpu_read(pcp); \ 140 raw_local_irq_save(__flags); \
141 __ret = raw_cpu_read(pcp); \
139 raw_cpu_write(pcp, nval); \ 142 raw_cpu_write(pcp, nval); \
140 raw_local_irq_restore(flags); \ 143 raw_local_irq_restore(__flags); \
141 ret__; \ 144 __ret; \
142}) 145})
143 146
144#define _this_cpu_generic_cmpxchg(pcp, oval, nval) \ 147#define this_cpu_generic_cmpxchg(pcp, oval, nval) \
145({ \ 148({ \
146 typeof(pcp) ret__; \ 149 typeof(pcp) __ret; \
147 unsigned long flags; \ 150 unsigned long __flags; \
148 raw_local_irq_save(flags); \ 151 raw_local_irq_save(__flags); \
149 ret__ = raw_cpu_read(pcp); \ 152 __ret = raw_cpu_read(pcp); \
150 if (ret__ == (oval)) \ 153 if (__ret == (oval)) \
151 raw_cpu_write(pcp, nval); \ 154 raw_cpu_write(pcp, nval); \
152 raw_local_irq_restore(flags); \ 155 raw_local_irq_restore(__flags); \
153 ret__; \ 156 __ret; \
154}) 157})
155 158
156#define _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 159#define this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
157({ \ 160({ \
158 int ret__; \ 161 int __ret; \
159 unsigned long flags; \ 162 unsigned long __flags; \
160 raw_local_irq_save(flags); \ 163 raw_local_irq_save(__flags); \
161 ret__ = raw_cpu_generic_cmpxchg_double(pcp1, pcp2, \ 164 __ret = raw_cpu_generic_cmpxchg_double(pcp1, pcp2, \
162 oval1, oval2, nval1, nval2); \ 165 oval1, oval2, nval1, nval2); \
163 raw_local_irq_restore(flags); \ 166 raw_local_irq_restore(__flags); \
164 ret__; \ 167 __ret; \
165}) 168})
166 169
167# ifndef raw_cpu_read_1 170#ifndef raw_cpu_read_1
168# define raw_cpu_read_1(pcp) (*raw_cpu_ptr(&(pcp))) 171#define raw_cpu_read_1(pcp) (*raw_cpu_ptr(&(pcp)))
169# endif 172#endif
170# ifndef raw_cpu_read_2 173#ifndef raw_cpu_read_2
171# define raw_cpu_read_2(pcp) (*raw_cpu_ptr(&(pcp))) 174#define raw_cpu_read_2(pcp) (*raw_cpu_ptr(&(pcp)))
172# endif 175#endif
173# ifndef raw_cpu_read_4 176#ifndef raw_cpu_read_4
174# define raw_cpu_read_4(pcp) (*raw_cpu_ptr(&(pcp))) 177#define raw_cpu_read_4(pcp) (*raw_cpu_ptr(&(pcp)))
175# endif 178#endif
176# ifndef raw_cpu_read_8 179#ifndef raw_cpu_read_8
177# define raw_cpu_read_8(pcp) (*raw_cpu_ptr(&(pcp))) 180#define raw_cpu_read_8(pcp) (*raw_cpu_ptr(&(pcp)))
178# endif 181#endif
179 182
180# ifndef raw_cpu_write_1 183#ifndef raw_cpu_write_1
181# define raw_cpu_write_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), =) 184#define raw_cpu_write_1(pcp, val) raw_cpu_generic_to_op(pcp, val, =)
182# endif 185#endif
183# ifndef raw_cpu_write_2 186#ifndef raw_cpu_write_2
184# define raw_cpu_write_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), =) 187#define raw_cpu_write_2(pcp, val) raw_cpu_generic_to_op(pcp, val, =)
185# endif 188#endif
186# ifndef raw_cpu_write_4 189#ifndef raw_cpu_write_4
187# define raw_cpu_write_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), =) 190#define raw_cpu_write_4(pcp, val) raw_cpu_generic_to_op(pcp, val, =)
188# endif 191#endif
189# ifndef raw_cpu_write_8 192#ifndef raw_cpu_write_8
190# define raw_cpu_write_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), =) 193#define raw_cpu_write_8(pcp, val) raw_cpu_generic_to_op(pcp, val, =)
191# endif 194#endif
192 195
193# ifndef raw_cpu_add_1 196#ifndef raw_cpu_add_1
194# define raw_cpu_add_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=) 197#define raw_cpu_add_1(pcp, val) raw_cpu_generic_to_op(pcp, val, +=)
195# endif 198#endif
196# ifndef raw_cpu_add_2 199#ifndef raw_cpu_add_2
197# define raw_cpu_add_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=) 200#define raw_cpu_add_2(pcp, val) raw_cpu_generic_to_op(pcp, val, +=)
198# endif 201#endif
199# ifndef raw_cpu_add_4 202#ifndef raw_cpu_add_4
200# define raw_cpu_add_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=) 203#define raw_cpu_add_4(pcp, val) raw_cpu_generic_to_op(pcp, val, +=)
201# endif 204#endif
202# ifndef raw_cpu_add_8 205#ifndef raw_cpu_add_8
203# define raw_cpu_add_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), +=) 206#define raw_cpu_add_8(pcp, val) raw_cpu_generic_to_op(pcp, val, +=)
204# endif 207#endif
205 208
206# ifndef raw_cpu_and_1 209#ifndef raw_cpu_and_1
207# define raw_cpu_and_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=) 210#define raw_cpu_and_1(pcp, val) raw_cpu_generic_to_op(pcp, val, &=)
208# endif 211#endif
209# ifndef raw_cpu_and_2 212#ifndef raw_cpu_and_2
210# define raw_cpu_and_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=) 213#define raw_cpu_and_2(pcp, val) raw_cpu_generic_to_op(pcp, val, &=)
211# endif 214#endif
212# ifndef raw_cpu_and_4 215#ifndef raw_cpu_and_4
213# define raw_cpu_and_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=) 216#define raw_cpu_and_4(pcp, val) raw_cpu_generic_to_op(pcp, val, &=)
214# endif 217#endif
215# ifndef raw_cpu_and_8 218#ifndef raw_cpu_and_8
216# define raw_cpu_and_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), &=) 219#define raw_cpu_and_8(pcp, val) raw_cpu_generic_to_op(pcp, val, &=)
217# endif 220#endif
218 221
219# ifndef raw_cpu_or_1 222#ifndef raw_cpu_or_1
220# define raw_cpu_or_1(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=) 223#define raw_cpu_or_1(pcp, val) raw_cpu_generic_to_op(pcp, val, |=)
221# endif 224#endif
222# ifndef raw_cpu_or_2 225#ifndef raw_cpu_or_2
223# define raw_cpu_or_2(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=) 226#define raw_cpu_or_2(pcp, val) raw_cpu_generic_to_op(pcp, val, |=)
224# endif 227#endif
225# ifndef raw_cpu_or_4 228#ifndef raw_cpu_or_4
226# define raw_cpu_or_4(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=) 229#define raw_cpu_or_4(pcp, val) raw_cpu_generic_to_op(pcp, val, |=)
227# endif 230#endif
228# ifndef raw_cpu_or_8 231#ifndef raw_cpu_or_8
229# define raw_cpu_or_8(pcp, val) raw_cpu_generic_to_op((pcp), (val), |=) 232#define raw_cpu_or_8(pcp, val) raw_cpu_generic_to_op(pcp, val, |=)
230# endif 233#endif
231 234
232# ifndef raw_cpu_add_return_1 235#ifndef raw_cpu_add_return_1
233# define raw_cpu_add_return_1(pcp, val) raw_cpu_generic_add_return(pcp, val) 236#define raw_cpu_add_return_1(pcp, val) raw_cpu_generic_add_return(pcp, val)
234# endif 237#endif
235# ifndef raw_cpu_add_return_2 238#ifndef raw_cpu_add_return_2
236# define raw_cpu_add_return_2(pcp, val) raw_cpu_generic_add_return(pcp, val) 239#define raw_cpu_add_return_2(pcp, val) raw_cpu_generic_add_return(pcp, val)
237# endif 240#endif
238# ifndef raw_cpu_add_return_4 241#ifndef raw_cpu_add_return_4
239# define raw_cpu_add_return_4(pcp, val) raw_cpu_generic_add_return(pcp, val) 242#define raw_cpu_add_return_4(pcp, val) raw_cpu_generic_add_return(pcp, val)
240# endif 243#endif
241# ifndef raw_cpu_add_return_8 244#ifndef raw_cpu_add_return_8
242# define raw_cpu_add_return_8(pcp, val) raw_cpu_generic_add_return(pcp, val) 245#define raw_cpu_add_return_8(pcp, val) raw_cpu_generic_add_return(pcp, val)
243# endif 246#endif
244 247
245# ifndef raw_cpu_xchg_1 248#ifndef raw_cpu_xchg_1
246# define raw_cpu_xchg_1(pcp, nval) raw_cpu_generic_xchg(pcp, nval) 249#define raw_cpu_xchg_1(pcp, nval) raw_cpu_generic_xchg(pcp, nval)
247# endif 250#endif
248# ifndef raw_cpu_xchg_2 251#ifndef raw_cpu_xchg_2
249# define raw_cpu_xchg_2(pcp, nval) raw_cpu_generic_xchg(pcp, nval) 252#define raw_cpu_xchg_2(pcp, nval) raw_cpu_generic_xchg(pcp, nval)
250# endif 253#endif
251# ifndef raw_cpu_xchg_4 254#ifndef raw_cpu_xchg_4
252# define raw_cpu_xchg_4(pcp, nval) raw_cpu_generic_xchg(pcp, nval) 255#define raw_cpu_xchg_4(pcp, nval) raw_cpu_generic_xchg(pcp, nval)
253# endif 256#endif
254# ifndef raw_cpu_xchg_8 257#ifndef raw_cpu_xchg_8
255# define raw_cpu_xchg_8(pcp, nval) raw_cpu_generic_xchg(pcp, nval) 258#define raw_cpu_xchg_8(pcp, nval) raw_cpu_generic_xchg(pcp, nval)
256# endif 259#endif
257 260
258# ifndef raw_cpu_cmpxchg_1 261#ifndef raw_cpu_cmpxchg_1
259# define raw_cpu_cmpxchg_1(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval) 262#define raw_cpu_cmpxchg_1(pcp, oval, nval) \
260# endif 263 raw_cpu_generic_cmpxchg(pcp, oval, nval)
261# ifndef raw_cpu_cmpxchg_2 264#endif
262# define raw_cpu_cmpxchg_2(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval) 265#ifndef raw_cpu_cmpxchg_2
263# endif 266#define raw_cpu_cmpxchg_2(pcp, oval, nval) \
264# ifndef raw_cpu_cmpxchg_4 267 raw_cpu_generic_cmpxchg(pcp, oval, nval)
265# define raw_cpu_cmpxchg_4(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval) 268#endif
266# endif 269#ifndef raw_cpu_cmpxchg_4
267# ifndef raw_cpu_cmpxchg_8 270#define raw_cpu_cmpxchg_4(pcp, oval, nval) \
268# define raw_cpu_cmpxchg_8(pcp, oval, nval) raw_cpu_generic_cmpxchg(pcp, oval, nval) 271 raw_cpu_generic_cmpxchg(pcp, oval, nval)
269# endif 272#endif
270 273#ifndef raw_cpu_cmpxchg_8
271# ifndef raw_cpu_cmpxchg_double_1 274#define raw_cpu_cmpxchg_8(pcp, oval, nval) \
272# define raw_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 275 raw_cpu_generic_cmpxchg(pcp, oval, nval)
276#endif
277
278#ifndef raw_cpu_cmpxchg_double_1
279#define raw_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \
273 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 280 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
274# endif 281#endif
275# ifndef raw_cpu_cmpxchg_double_2 282#ifndef raw_cpu_cmpxchg_double_2
276# define raw_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 283#define raw_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \
277 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 284 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
278# endif 285#endif
279# ifndef raw_cpu_cmpxchg_double_4 286#ifndef raw_cpu_cmpxchg_double_4
280# define raw_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 287#define raw_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \
281 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 288 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
282# endif 289#endif
283# ifndef raw_cpu_cmpxchg_double_8 290#ifndef raw_cpu_cmpxchg_double_8
284# define raw_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 291#define raw_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \
285 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 292 raw_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
286# endif 293#endif
287 294
288# ifndef this_cpu_read_1 295#ifndef this_cpu_read_1
289# define this_cpu_read_1(pcp) _this_cpu_generic_read(pcp) 296#define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
290# endif 297#endif
291# ifndef this_cpu_read_2 298#ifndef this_cpu_read_2
292# define this_cpu_read_2(pcp) _this_cpu_generic_read(pcp) 299#define this_cpu_read_2(pcp) this_cpu_generic_read(pcp)
293# endif 300#endif
294# ifndef this_cpu_read_4 301#ifndef this_cpu_read_4
295# define this_cpu_read_4(pcp) _this_cpu_generic_read(pcp) 302#define this_cpu_read_4(pcp) this_cpu_generic_read(pcp)
296# endif 303#endif
297# ifndef this_cpu_read_8 304#ifndef this_cpu_read_8
298# define this_cpu_read_8(pcp) _this_cpu_generic_read(pcp) 305#define this_cpu_read_8(pcp) this_cpu_generic_read(pcp)
299# endif 306#endif
300 307
301# ifndef this_cpu_write_1 308#ifndef this_cpu_write_1
302# define this_cpu_write_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) 309#define this_cpu_write_1(pcp, val) this_cpu_generic_to_op(pcp, val, =)
303# endif 310#endif
304# ifndef this_cpu_write_2 311#ifndef this_cpu_write_2
305# define this_cpu_write_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) 312#define this_cpu_write_2(pcp, val) this_cpu_generic_to_op(pcp, val, =)
306# endif 313#endif
307# ifndef this_cpu_write_4 314#ifndef this_cpu_write_4
308# define this_cpu_write_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) 315#define this_cpu_write_4(pcp, val) this_cpu_generic_to_op(pcp, val, =)
309# endif 316#endif
310# ifndef this_cpu_write_8 317#ifndef this_cpu_write_8
311# define this_cpu_write_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), =) 318#define this_cpu_write_8(pcp, val) this_cpu_generic_to_op(pcp, val, =)
312# endif 319#endif
313 320
314# ifndef this_cpu_add_1 321#ifndef this_cpu_add_1
315# define this_cpu_add_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) 322#define this_cpu_add_1(pcp, val) this_cpu_generic_to_op(pcp, val, +=)
316# endif 323#endif
317# ifndef this_cpu_add_2 324#ifndef this_cpu_add_2
318# define this_cpu_add_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) 325#define this_cpu_add_2(pcp, val) this_cpu_generic_to_op(pcp, val, +=)
319# endif 326#endif
320# ifndef this_cpu_add_4 327#ifndef this_cpu_add_4
321# define this_cpu_add_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) 328#define this_cpu_add_4(pcp, val) this_cpu_generic_to_op(pcp, val, +=)
322# endif 329#endif
323# ifndef this_cpu_add_8 330#ifndef this_cpu_add_8
324# define this_cpu_add_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), +=) 331#define this_cpu_add_8(pcp, val) this_cpu_generic_to_op(pcp, val, +=)
325# endif 332#endif
326 333
327# ifndef this_cpu_and_1 334#ifndef this_cpu_and_1
328# define this_cpu_and_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) 335#define this_cpu_and_1(pcp, val) this_cpu_generic_to_op(pcp, val, &=)
329# endif 336#endif
330# ifndef this_cpu_and_2 337#ifndef this_cpu_and_2
331# define this_cpu_and_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) 338#define this_cpu_and_2(pcp, val) this_cpu_generic_to_op(pcp, val, &=)
332# endif 339#endif
333# ifndef this_cpu_and_4 340#ifndef this_cpu_and_4
334# define this_cpu_and_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) 341#define this_cpu_and_4(pcp, val) this_cpu_generic_to_op(pcp, val, &=)
335# endif 342#endif
336# ifndef this_cpu_and_8 343#ifndef this_cpu_and_8
337# define this_cpu_and_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), &=) 344#define this_cpu_and_8(pcp, val) this_cpu_generic_to_op(pcp, val, &=)
338# endif 345#endif
339 346
340# ifndef this_cpu_or_1 347#ifndef this_cpu_or_1
341# define this_cpu_or_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) 348#define this_cpu_or_1(pcp, val) this_cpu_generic_to_op(pcp, val, |=)
342# endif 349#endif
343# ifndef this_cpu_or_2 350#ifndef this_cpu_or_2
344# define this_cpu_or_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) 351#define this_cpu_or_2(pcp, val) this_cpu_generic_to_op(pcp, val, |=)
345# endif 352#endif
346# ifndef this_cpu_or_4 353#ifndef this_cpu_or_4
347# define this_cpu_or_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) 354#define this_cpu_or_4(pcp, val) this_cpu_generic_to_op(pcp, val, |=)
348# endif 355#endif
349# ifndef this_cpu_or_8 356#ifndef this_cpu_or_8
350# define this_cpu_or_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), |=) 357#define this_cpu_or_8(pcp, val) this_cpu_generic_to_op(pcp, val, |=)
351# endif 358#endif
352 359
353# ifndef this_cpu_add_return_1 360#ifndef this_cpu_add_return_1
354# define this_cpu_add_return_1(pcp, val) _this_cpu_generic_add_return(pcp, val) 361#define this_cpu_add_return_1(pcp, val) this_cpu_generic_add_return(pcp, val)
355# endif 362#endif
356# ifndef this_cpu_add_return_2 363#ifndef this_cpu_add_return_2
357# define this_cpu_add_return_2(pcp, val) _this_cpu_generic_add_return(pcp, val) 364#define this_cpu_add_return_2(pcp, val) this_cpu_generic_add_return(pcp, val)
358# endif 365#endif
359# ifndef this_cpu_add_return_4 366#ifndef this_cpu_add_return_4
360# define this_cpu_add_return_4(pcp, val) _this_cpu_generic_add_return(pcp, val) 367#define this_cpu_add_return_4(pcp, val) this_cpu_generic_add_return(pcp, val)
361# endif 368#endif
362# ifndef this_cpu_add_return_8 369#ifndef this_cpu_add_return_8
363# define this_cpu_add_return_8(pcp, val) _this_cpu_generic_add_return(pcp, val) 370#define this_cpu_add_return_8(pcp, val) this_cpu_generic_add_return(pcp, val)
364# endif 371#endif
365 372
366# ifndef this_cpu_xchg_1 373#ifndef this_cpu_xchg_1
367# define this_cpu_xchg_1(pcp, nval) _this_cpu_generic_xchg(pcp, nval) 374#define this_cpu_xchg_1(pcp, nval) this_cpu_generic_xchg(pcp, nval)
368# endif 375#endif
369# ifndef this_cpu_xchg_2 376#ifndef this_cpu_xchg_2
370# define this_cpu_xchg_2(pcp, nval) _this_cpu_generic_xchg(pcp, nval) 377#define this_cpu_xchg_2(pcp, nval) this_cpu_generic_xchg(pcp, nval)
371# endif 378#endif
372# ifndef this_cpu_xchg_4 379#ifndef this_cpu_xchg_4
373# define this_cpu_xchg_4(pcp, nval) _this_cpu_generic_xchg(pcp, nval) 380#define this_cpu_xchg_4(pcp, nval) this_cpu_generic_xchg(pcp, nval)
374# endif 381#endif
375# ifndef this_cpu_xchg_8 382#ifndef this_cpu_xchg_8
376# define this_cpu_xchg_8(pcp, nval) _this_cpu_generic_xchg(pcp, nval) 383#define this_cpu_xchg_8(pcp, nval) this_cpu_generic_xchg(pcp, nval)
377# endif 384#endif
378 385
379# ifndef this_cpu_cmpxchg_1 386#ifndef this_cpu_cmpxchg_1
380# define this_cpu_cmpxchg_1(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) 387#define this_cpu_cmpxchg_1(pcp, oval, nval) \
381# endif 388 this_cpu_generic_cmpxchg(pcp, oval, nval)
382# ifndef this_cpu_cmpxchg_2 389#endif
383# define this_cpu_cmpxchg_2(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) 390#ifndef this_cpu_cmpxchg_2
384# endif 391#define this_cpu_cmpxchg_2(pcp, oval, nval) \
385# ifndef this_cpu_cmpxchg_4 392 this_cpu_generic_cmpxchg(pcp, oval, nval)
386# define this_cpu_cmpxchg_4(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) 393#endif
387# endif 394#ifndef this_cpu_cmpxchg_4
388# ifndef this_cpu_cmpxchg_8 395#define this_cpu_cmpxchg_4(pcp, oval, nval) \
389# define this_cpu_cmpxchg_8(pcp, oval, nval) _this_cpu_generic_cmpxchg(pcp, oval, nval) 396 this_cpu_generic_cmpxchg(pcp, oval, nval)
390# endif 397#endif
391 398#ifndef this_cpu_cmpxchg_8
392# ifndef this_cpu_cmpxchg_double_1 399#define this_cpu_cmpxchg_8(pcp, oval, nval) \
393# define this_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 400 this_cpu_generic_cmpxchg(pcp, oval, nval)
394 _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 401#endif
395# endif 402
396# ifndef this_cpu_cmpxchg_double_2 403#ifndef this_cpu_cmpxchg_double_1
397# define this_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 404#define this_cpu_cmpxchg_double_1(pcp1, pcp2, oval1, oval2, nval1, nval2) \
398 _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 405 this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
399# endif 406#endif
400# ifndef this_cpu_cmpxchg_double_4 407#ifndef this_cpu_cmpxchg_double_2
401# define this_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 408#define this_cpu_cmpxchg_double_2(pcp1, pcp2, oval1, oval2, nval1, nval2) \
402 _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 409 this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
403# endif 410#endif
404# ifndef this_cpu_cmpxchg_double_8 411#ifndef this_cpu_cmpxchg_double_4
405# define this_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \ 412#define this_cpu_cmpxchg_double_4(pcp1, pcp2, oval1, oval2, nval1, nval2) \
406 _this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) 413 this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
407# endif 414#endif
415#ifndef this_cpu_cmpxchg_double_8
416#define this_cpu_cmpxchg_double_8(pcp1, pcp2, oval1, oval2, nval1, nval2) \
417 this_cpu_generic_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
418#endif
408 419
409#endif /* _ASM_GENERIC_PERCPU_H_ */ 420#endif /* _ASM_GENERIC_PERCPU_H_ */