diff options
author | Paul Mackerras <paulus@samba.org> | 2008-04-28 00:44:08 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-29 01:57:34 -0400 |
commit | dd18434ff0b7d9b9ad3d596985fc84b329d2f9a8 (patch) | |
tree | 075067cc4390d186cef962098fae2e11d34c5bef /include/asm-powerpc | |
parent | 745a14cc264b1832c638e41812e0cb04328b2db1 (diff) |
[POWERPC] Use __always_inline for xchg* and cmpxchg*
This changes the definitions of the xchg and cmpxchg families of
functions in include/asm-powerpc/system.h to be marked __always_inline
rather than __inline__. The reason for doing this is that we rely on
the compiler inlining them in order to eliminate the references to
__xchg_called_with_bad_pointer and __cmpxchg_called_with_bad_pointer,
which are deliberately left undefined. Thus this change will enable
us to make the inline keyword be just a hint rather than a directive.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/system.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index fab1674b31b6..2b6559a6d113 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h | |||
@@ -204,7 +204,7 @@ extern int powersave_nap; /* set if nap mode can be used in idle loop */ | |||
204 | * Changes the memory location '*ptr' to be val and returns | 204 | * Changes the memory location '*ptr' to be val and returns |
205 | * the previous value stored there. | 205 | * the previous value stored there. |
206 | */ | 206 | */ |
207 | static __inline__ unsigned long | 207 | static __always_inline unsigned long |
208 | __xchg_u32(volatile void *p, unsigned long val) | 208 | __xchg_u32(volatile void *p, unsigned long val) |
209 | { | 209 | { |
210 | unsigned long prev; | 210 | unsigned long prev; |
@@ -229,7 +229,7 @@ __xchg_u32(volatile void *p, unsigned long val) | |||
229 | * Changes the memory location '*ptr' to be val and returns | 229 | * Changes the memory location '*ptr' to be val and returns |
230 | * the previous value stored there. | 230 | * the previous value stored there. |
231 | */ | 231 | */ |
232 | static __inline__ unsigned long | 232 | static __always_inline unsigned long |
233 | __xchg_u32_local(volatile void *p, unsigned long val) | 233 | __xchg_u32_local(volatile void *p, unsigned long val) |
234 | { | 234 | { |
235 | unsigned long prev; | 235 | unsigned long prev; |
@@ -247,7 +247,7 @@ __xchg_u32_local(volatile void *p, unsigned long val) | |||
247 | } | 247 | } |
248 | 248 | ||
249 | #ifdef CONFIG_PPC64 | 249 | #ifdef CONFIG_PPC64 |
250 | static __inline__ unsigned long | 250 | static __always_inline unsigned long |
251 | __xchg_u64(volatile void *p, unsigned long val) | 251 | __xchg_u64(volatile void *p, unsigned long val) |
252 | { | 252 | { |
253 | unsigned long prev; | 253 | unsigned long prev; |
@@ -266,7 +266,7 @@ __xchg_u64(volatile void *p, unsigned long val) | |||
266 | return prev; | 266 | return prev; |
267 | } | 267 | } |
268 | 268 | ||
269 | static __inline__ unsigned long | 269 | static __always_inline unsigned long |
270 | __xchg_u64_local(volatile void *p, unsigned long val) | 270 | __xchg_u64_local(volatile void *p, unsigned long val) |
271 | { | 271 | { |
272 | unsigned long prev; | 272 | unsigned long prev; |
@@ -290,7 +290,7 @@ __xchg_u64_local(volatile void *p, unsigned long val) | |||
290 | */ | 290 | */ |
291 | extern void __xchg_called_with_bad_pointer(void); | 291 | extern void __xchg_called_with_bad_pointer(void); |
292 | 292 | ||
293 | static __inline__ unsigned long | 293 | static __always_inline unsigned long |
294 | __xchg(volatile void *ptr, unsigned long x, unsigned int size) | 294 | __xchg(volatile void *ptr, unsigned long x, unsigned int size) |
295 | { | 295 | { |
296 | switch (size) { | 296 | switch (size) { |
@@ -305,7 +305,7 @@ __xchg(volatile void *ptr, unsigned long x, unsigned int size) | |||
305 | return x; | 305 | return x; |
306 | } | 306 | } |
307 | 307 | ||
308 | static __inline__ unsigned long | 308 | static __always_inline unsigned long |
309 | __xchg_local(volatile void *ptr, unsigned long x, unsigned int size) | 309 | __xchg_local(volatile void *ptr, unsigned long x, unsigned int size) |
310 | { | 310 | { |
311 | switch (size) { | 311 | switch (size) { |
@@ -338,7 +338,7 @@ __xchg_local(volatile void *ptr, unsigned long x, unsigned int size) | |||
338 | */ | 338 | */ |
339 | #define __HAVE_ARCH_CMPXCHG 1 | 339 | #define __HAVE_ARCH_CMPXCHG 1 |
340 | 340 | ||
341 | static __inline__ unsigned long | 341 | static __always_inline unsigned long |
342 | __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) | 342 | __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) |
343 | { | 343 | { |
344 | unsigned int prev; | 344 | unsigned int prev; |
@@ -361,7 +361,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) | |||
361 | return prev; | 361 | return prev; |
362 | } | 362 | } |
363 | 363 | ||
364 | static __inline__ unsigned long | 364 | static __always_inline unsigned long |
365 | __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, | 365 | __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, |
366 | unsigned long new) | 366 | unsigned long new) |
367 | { | 367 | { |
@@ -384,7 +384,7 @@ __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, | |||
384 | } | 384 | } |
385 | 385 | ||
386 | #ifdef CONFIG_PPC64 | 386 | #ifdef CONFIG_PPC64 |
387 | static __inline__ unsigned long | 387 | static __always_inline unsigned long |
388 | __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) | 388 | __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) |
389 | { | 389 | { |
390 | unsigned long prev; | 390 | unsigned long prev; |
@@ -406,7 +406,7 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) | |||
406 | return prev; | 406 | return prev; |
407 | } | 407 | } |
408 | 408 | ||
409 | static __inline__ unsigned long | 409 | static __always_inline unsigned long |
410 | __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, | 410 | __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, |
411 | unsigned long new) | 411 | unsigned long new) |
412 | { | 412 | { |
@@ -432,7 +432,7 @@ __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, | |||
432 | if something tries to do an invalid cmpxchg(). */ | 432 | if something tries to do an invalid cmpxchg(). */ |
433 | extern void __cmpxchg_called_with_bad_pointer(void); | 433 | extern void __cmpxchg_called_with_bad_pointer(void); |
434 | 434 | ||
435 | static __inline__ unsigned long | 435 | static __always_inline unsigned long |
436 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, | 436 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, |
437 | unsigned int size) | 437 | unsigned int size) |
438 | { | 438 | { |
@@ -448,7 +448,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, | |||
448 | return old; | 448 | return old; |
449 | } | 449 | } |
450 | 450 | ||
451 | static __inline__ unsigned long | 451 | static __always_inline unsigned long |
452 | __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, | 452 | __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, |
453 | unsigned int size) | 453 | unsigned int size) |
454 | { | 454 | { |