]> Git Repo - linux.git/blob - arch/sh/include/asm/cmpxchg-cas.h
mm/slub.c: add a naive detection of double free or corruption
[linux.git] / arch / sh / include / asm / cmpxchg-cas.h
1 #ifndef __ASM_SH_CMPXCHG_CAS_H
2 #define __ASM_SH_CMPXCHG_CAS_H
3
4 static 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
14 static 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 */
This page took 0.03255 seconds and 4 git commands to generate.