2 * cmpxchg*() fallbacks for CPU not supporting these instructions
5 #include <linux/kernel.h>
7 #include <linux/module.h>
9 #ifndef CONFIG_X86_CMPXCHG
10 unsigned long cmpxchg_386_u8(volatile void *ptr
, u8 old
, u8
new)
15 /* Poor man's cmpxchg for 386. Unsuitable for SMP */
16 local_irq_save(flags
);
20 local_irq_restore(flags
);
23 EXPORT_SYMBOL(cmpxchg_386_u8
);
25 unsigned long cmpxchg_386_u16(volatile void *ptr
, u16 old
, u16
new)
30 /* Poor man's cmpxchg for 386. Unsuitable for SMP */
31 local_irq_save(flags
);
35 local_irq_restore(flags
);
38 EXPORT_SYMBOL(cmpxchg_386_u16
);
40 unsigned long cmpxchg_386_u32(volatile void *ptr
, u32 old
, u32
new)
45 /* Poor man's cmpxchg for 386. Unsuitable for SMP */
46 local_irq_save(flags
);
50 local_irq_restore(flags
);
53 EXPORT_SYMBOL(cmpxchg_386_u32
);
56 #ifndef CONFIG_X86_CMPXCHG64
57 unsigned long long cmpxchg_486_u64(volatile void *ptr
, u64 old
, u64
new)
62 /* Poor man's cmpxchg8b for 386 and 486. Unsuitable for SMP */
63 local_irq_save(flags
);
67 local_irq_restore(flags
);
70 EXPORT_SYMBOL(cmpxchg_486_u64
);