Staging
v0.5.1
https://github.com/torvalds/linux
Raw File
Tip revision: 45beca08dd8b6d6a65c5ffd730af2eac7a2c7a03 authored by Linus Torvalds on 02 November 2008, 22:17:19 UTC
Linux v2.6.28-rc3
Tip revision: 45beca0
cmpxchg.h
#ifndef __ASM_GENERIC_CMPXCHG_H
#define __ASM_GENERIC_CMPXCHG_H

/*
 * Generic cmpxchg
 *
 * Uses the local cmpxchg. Does not support SMP.
 */
#ifdef CONFIG_SMP
#error "Cannot use generic cmpxchg on SMP"
#endif

/*
 * Atomic compare and exchange.
 *
 * Do not define __HAVE_ARCH_CMPXCHG because we want to use it to check whether
 * a cmpxchg primitive faster than repeated local irq save/restore exists.
 */
#define cmpxchg(ptr, o, n)	cmpxchg_local((ptr), (o), (n))
#define cmpxchg64(ptr, o, n)	cmpxchg64_local((ptr), (o), (n))

#endif
back to top