summaryrefslogtreecommitdiffstats
path: root/include/asm-alpha
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-24 01:02:24 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-24 01:02:24 -0400
commit343b0597297c3190647854881c087c01faf40a6f (patch)
tree81cf818936bfd4aff891d1ca4d4ea4d47b2d1631 /include/asm-alpha
parentb2dabd5aadae6a93026f35269e1e53c1a0c6de2d (diff)
parentb2382b363df828f25e35ed8b70a3da33b29b2a64 (diff)
downloadblackbird-op-linux-343b0597297c3190647854881c087c01faf40a6f.tar.gz
blackbird-op-linux-343b0597297c3190647854881c087c01faf40a6f.zip
/spare/repo/netdev-2.6 branch 'ieee80211'
Diffstat (limited to 'include/asm-alpha')
-rw-r--r--include/asm-alpha/system.h29
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)
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) \
({ \
OpenPOWER on IntegriCloud