diff options
author | Al Viro <viro@www.linux.org.uk> | 2005-08-23 17:47:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-23 21:43:44 -0400 |
commit | 79fb7bdce363685b336e3f0fb8207312fd1f02fc (patch) | |
tree | bcc10e8f4f576d525b4f2a617010f49077d03e6f /include | |
parent | 531e5ca62bd9aabef6bd8340d8ae93bac1b5caa2 (diff) |
[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: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-alpha/system.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h index c08ce970ff8c..bdb4d66418f1 100644 --- a/include/asm-alpha/system.h +++ b/include/asm-alpha/system.h | |||
@@ -443,22 +443,19 @@ __xchg_u64(volatile long *m, unsigned long val) | |||
443 | if something tries to do an invalid xchg(). */ | 443 | if something tries to do an invalid xchg(). */ |
444 | extern void __xchg_called_with_bad_pointer(void); | 444 | extern void __xchg_called_with_bad_pointer(void); |
445 | 445 | ||
446 | static inline unsigned long | 446 | #define __xchg(ptr, x, size) \ |
447 | __xchg(volatile void *ptr, unsigned long x, int size) | 447 | ({ \ |
448 | { | 448 | unsigned long __xchg__res; \ |
449 | switch (size) { | 449 | volatile void *__xchg__ptr = (ptr); \ |
450 | case 1: | 450 | switch (size) { \ |
451 | return __xchg_u8(ptr, x); | 451 | case 1: __xchg__res = __xchg_u8(__xchg__ptr, x); break; \ |
452 | case 2: | 452 | case 2: __xchg__res = __xchg_u16(__xchg__ptr, x); break; \ |
453 | return __xchg_u16(ptr, x); | 453 | case 4: __xchg__res = __xchg_u32(__xchg__ptr, x); break; \ |
454 | case 4: | 454 | case 8: __xchg__res = __xchg_u64(__xchg__ptr, x); break; \ |
455 | return __xchg_u32(ptr, x); | 455 | default: __xchg_called_with_bad_pointer(); __xchg__res = x; \ |
456 | case 8: | 456 | } \ |
457 | return __xchg_u64(ptr, x); | 457 | __xchg__res; \ |
458 | } | 458 | }) |
459 | __xchg_called_with_bad_pointer(); | ||
460 | return x; | ||
461 | } | ||
462 | 459 | ||
463 | #define xchg(ptr,x) \ | 460 | #define xchg(ptr,x) \ |
464 | ({ \ | 461 | ({ \ |