From 737facfcf421ac05064619a44354000807186f42 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 23 Aug 2005 22:47:07 +0100 Subject: [PATCH] --- yaml --- r: 5963 b: refs/heads/master c: 79fb7bdce363685b336e3f0fb8207312fd1f02fc h: refs/heads/master i: 5961: b9857a0550e2d80394234f7f3608f0976b2e837a 5959: c9bea48edcc46af87ffcde6dc24e4570d383cfd1 v: v3 --- [refs] | 2 +- trunk/include/asm-alpha/system.h | 29 +++++++++++++---------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 99def7463450..36b0ebb52fa1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 531e5ca62bd9aabef6bd8340d8ae93bac1b5caa2 +refs/heads/master: 79fb7bdce363685b336e3f0fb8207312fd1f02fc diff --git a/trunk/include/asm-alpha/system.h b/trunk/include/asm-alpha/system.h index c08ce970ff8c..bdb4d66418f1 100644 --- a/trunk/include/asm-alpha/system.h +++ b/trunk/include/asm-alpha/system.h @@ -443,22 +443,19 @@ __xchg_u64(volatile long *m, unsigned long val) if something tries to do an invalid xchg(). */ extern void __xchg_called_with_bad_pointer(void); -static inline unsigned long -__xchg(volatile void *ptr, unsigned long x, int size) -{ - switch (size) { - case 1: - return __xchg_u8(ptr, x); - case 2: - return __xchg_u16(ptr, x); - case 4: - return __xchg_u32(ptr, x); - case 8: - return __xchg_u64(ptr, x); - } - __xchg_called_with_bad_pointer(); - return x; -} +#define __xchg(ptr, x, size) \ +({ \ + unsigned long __xchg__res; \ + volatile void *__xchg__ptr = (ptr); \ + switch (size) { \ + case 1: __xchg__res = __xchg_u8(__xchg__ptr, x); break; \ + case 2: __xchg__res = __xchg_u16(__xchg__ptr, x); break; \ + case 4: __xchg__res = __xchg_u32(__xchg__ptr, x); break; \ + case 8: __xchg__res = __xchg_u64(__xchg__ptr, x); break; \ + default: __xchg_called_with_bad_pointer(); __xchg__res = x; \ + } \ + __xchg__res; \ +}) #define xchg(ptr,x) \ ({ \