| * Copyright (C) 2004 Microtronix Datacom Ltd. |
| * This file is subject to the terms and conditions of the GNU General Public |
| * License. See the file "COPYING" in the main directory of this archive |
| #ifndef _ASM_NIOS2_CMPXCHG_H |
| #define _ASM_NIOS2_CMPXCHG_H |
| #include <linux/irqflags.h> |
| ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) |
| struct __xchg_dummy { unsigned long a[100]; }; |
| #define __xg(x) ((volatile struct __xchg_dummy *)(x)) |
| static inline unsigned long __xchg(unsigned long x, volatile void *ptr, |
| unsigned long tmp, flags; |
| : "r" (x), "m" (*__xg(ptr)) |
| : "r" (x), "m" (*__xg(ptr)) |
| : "r" (x), "m" (*__xg(ptr)) |
| local_irq_restore(flags); |
| #include <asm-generic/cmpxchg.h> |
| #include <asm-generic/cmpxchg-local.h> |
| #endif /* _ASM_NIOS2_CMPXCHG_H */ |