提交 79fb7bdc 编写于 作者: A Al Viro 提交者: Linus Torvalds

[PATCH] alpha xchg fix

alpha xchg has to be a macro - alpha disables always_inline and if that
puppy does not get inlined, we immediately blow up on undefined reference.
Happens even on gcc3; with gcc4 that happens a _lot_.
Signed-off-by: NAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 531e5ca6
...@@ -443,22 +443,19 @@ __xchg_u64(volatile long *m, unsigned long val) ...@@ -443,22 +443,19 @@ __xchg_u64(volatile long *m, unsigned long val)
if something tries to do an invalid xchg(). */ if something tries to do an invalid xchg(). */
extern void __xchg_called_with_bad_pointer(void); extern void __xchg_called_with_bad_pointer(void);
static inline unsigned long #define __xchg(ptr, x, size) \
__xchg(volatile void *ptr, unsigned long x, int size) ({ \
{ unsigned long __xchg__res; \
switch (size) { volatile void *__xchg__ptr = (ptr); \
case 1: switch (size) { \
return __xchg_u8(ptr, x); case 1: __xchg__res = __xchg_u8(__xchg__ptr, x); break; \
case 2: case 2: __xchg__res = __xchg_u16(__xchg__ptr, x); break; \
return __xchg_u16(ptr, x); case 4: __xchg__res = __xchg_u32(__xchg__ptr, x); break; \
case 4: case 8: __xchg__res = __xchg_u64(__xchg__ptr, x); break; \
return __xchg_u32(ptr, x); default: __xchg_called_with_bad_pointer(); __xchg__res = x; \
case 8: } \
return __xchg_u64(ptr, x); __xchg__res; \
} })
__xchg_called_with_bad_pointer();
return x;
}
#define xchg(ptr,x) \ #define xchg(ptr,x) \
({ \ ({ \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册