1 #ifndef __ASM_METAG_CMPXCHG_LOCK1_H
2 #define __ASM_METAG_CMPXCHG_LOCK1_H
4 #include <asm/global_lock.h>
6 /* Use LOCK2 as these have to be atomic w.r.t. ordinary accesses. */
8 static inline unsigned long xchg_u32(volatile u32 *m, unsigned long val)
10 unsigned long flags, retval;
12 __global_lock2(flags);
16 __global_unlock2(flags);
20 static inline unsigned long xchg_u8(volatile u8 *m, unsigned long val)
22 unsigned long flags, retval;
24 __global_lock2(flags);
28 __global_unlock2(flags);
32 static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old,
38 __global_lock2(flags);
44 __global_unlock2(flags);
48 #endif /* __ASM_METAG_CMPXCHG_LOCK1_H */