Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v4.9-rc2 24 lines 510 B view raw
1#ifndef __ASM_SH_CMPXCHG_CAS_H 2#define __ASM_SH_CMPXCHG_CAS_H 3 4static inline unsigned long 5__cmpxchg_u32(volatile u32 *m, unsigned long old, unsigned long new) 6{ 7 __asm__ __volatile__("cas.l %1,%0,@r0" 8 : "+r"(new) 9 : "r"(old), "z"(m) 10 : "t", "memory" ); 11 return new; 12} 13 14static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val) 15{ 16 unsigned long old; 17 do old = *m; 18 while (__cmpxchg_u32(m, old, val) != old); 19 return old; 20} 21 22#include <asm/cmpxchg-xchg.h> 23 24#endif /* __ASM_SH_CMPXCHG_CAS_H */