Commit dd18434f authored by Paul Mackerras's avatar Paul Mackerras

[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: default avatarPaul Mackerras <paulus@samba.org>
parent 745a14cc
...@@ -204,7 +204,7 @@ extern int powersave_nap; /* set if nap mode can be used in idle loop */ ...@@ -204,7 +204,7 @@ extern int powersave_nap; /* set if nap mode can be used in idle loop */
* Changes the memory location '*ptr' to be val and returns * Changes the memory location '*ptr' to be val and returns
* the previous value stored there. * the previous value stored there.
*/ */
static __inline__ unsigned long static __always_inline unsigned long
__xchg_u32(volatile void *p, unsigned long val) __xchg_u32(volatile void *p, unsigned long val)
{ {
unsigned long prev; unsigned long prev;
...@@ -229,7 +229,7 @@ __xchg_u32(volatile void *p, unsigned long val) ...@@ -229,7 +229,7 @@ __xchg_u32(volatile void *p, unsigned long val)
* Changes the memory location '*ptr' to be val and returns * Changes the memory location '*ptr' to be val and returns
* the previous value stored there. * the previous value stored there.
*/ */
static __inline__ unsigned long static __always_inline unsigned long
__xchg_u32_local(volatile void *p, unsigned long val) __xchg_u32_local(volatile void *p, unsigned long val)
{ {
unsigned long prev; unsigned long prev;
...@@ -247,7 +247,7 @@ __xchg_u32_local(volatile void *p, unsigned long val) ...@@ -247,7 +247,7 @@ __xchg_u32_local(volatile void *p, unsigned long val)
} }
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
static __inline__ unsigned long static __always_inline unsigned long
__xchg_u64(volatile void *p, unsigned long val) __xchg_u64(volatile void *p, unsigned long val)
{ {
unsigned long prev; unsigned long prev;
...@@ -266,7 +266,7 @@ __xchg_u64(volatile void *p, unsigned long val) ...@@ -266,7 +266,7 @@ __xchg_u64(volatile void *p, unsigned long val)
return prev; return prev;
} }
static __inline__ unsigned long static __always_inline unsigned long
__xchg_u64_local(volatile void *p, unsigned long val) __xchg_u64_local(volatile void *p, unsigned long val)
{ {
unsigned long prev; unsigned long prev;
...@@ -290,7 +290,7 @@ __xchg_u64_local(volatile void *p, unsigned long val) ...@@ -290,7 +290,7 @@ __xchg_u64_local(volatile void *p, unsigned long val)
*/ */
extern void __xchg_called_with_bad_pointer(void); extern void __xchg_called_with_bad_pointer(void);
static __inline__ unsigned long static __always_inline unsigned long
__xchg(volatile void *ptr, unsigned long x, unsigned int size) __xchg(volatile void *ptr, unsigned long x, unsigned int size)
{ {
switch (size) { switch (size) {
...@@ -305,7 +305,7 @@ __xchg(volatile void *ptr, unsigned long x, unsigned int size) ...@@ -305,7 +305,7 @@ __xchg(volatile void *ptr, unsigned long x, unsigned int size)
return x; return x;
} }
static __inline__ unsigned long static __always_inline unsigned long
__xchg_local(volatile void *ptr, unsigned long x, unsigned int size) __xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
{ {
switch (size) { switch (size) {
...@@ -338,7 +338,7 @@ __xchg_local(volatile void *ptr, unsigned long x, unsigned int size) ...@@ -338,7 +338,7 @@ __xchg_local(volatile void *ptr, unsigned long x, unsigned int size)
*/ */
#define __HAVE_ARCH_CMPXCHG 1 #define __HAVE_ARCH_CMPXCHG 1
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
{ {
unsigned int prev; unsigned int prev;
...@@ -361,7 +361,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new) ...@@ -361,7 +361,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned long old, unsigned long new)
return prev; return prev;
} }
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old,
unsigned long new) unsigned long new)
{ {
...@@ -384,7 +384,7 @@ __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old, ...@@ -384,7 +384,7 @@ __cmpxchg_u32_local(volatile unsigned int *p, unsigned long old,
} }
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
{ {
unsigned long prev; unsigned long prev;
...@@ -406,7 +406,7 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new) ...@@ -406,7 +406,7 @@ __cmpxchg_u64(volatile unsigned long *p, unsigned long old, unsigned long new)
return prev; return prev;
} }
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old,
unsigned long new) unsigned long new)
{ {
...@@ -432,7 +432,7 @@ __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old, ...@@ -432,7 +432,7 @@ __cmpxchg_u64_local(volatile unsigned long *p, unsigned long old,
if something tries to do an invalid cmpxchg(). */ if something tries to do an invalid cmpxchg(). */
extern void __cmpxchg_called_with_bad_pointer(void); extern void __cmpxchg_called_with_bad_pointer(void);
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
unsigned int size) unsigned int size)
{ {
...@@ -448,7 +448,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, ...@@ -448,7 +448,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
return old; return old;
} }
static __inline__ unsigned long static __always_inline unsigned long
__cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new, __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
unsigned int size) unsigned int size)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment