Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5963
b: refs/heads/master
c: 79fb7bd
h: refs/heads/master
i:
  5961: b9857a0
  5959: c9bea48
v: v3
  • Loading branch information
Al Viro authored and Linus Torvalds committed Aug 24, 2005
1 parent 4b8d2a1 commit 737facf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 531e5ca62bd9aabef6bd8340d8ae93bac1b5caa2
refs/heads/master: 79fb7bdce363685b336e3f0fb8207312fd1f02fc
29 changes: 13 additions & 16 deletions trunk/include/asm-alpha/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
({ \
Expand Down

0 comments on commit 737facf

Please sign in to comment.