26,7 → 26,7 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
|
/** @addtogroup arm32 |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
35,19 → 35,10 |
#ifndef KERN_arm32_ATOMIC_H_ |
#define KERN_arm32_ATOMIC_H_ |
|
#define atomic_inc(x) ((void) atomic_add(x, 1)) |
#define atomic_dec(x) ((void) atomic_add(x, -1)) |
|
#define atomic_postinc(x) (atomic_add(x, 1) - 1) |
#define atomic_postdec(x) (atomic_add(x, -1) + 1) |
|
#define atomic_preinc(x) atomic_add(x, 1) |
#define atomic_predec(x) atomic_add(x, -1) |
|
/* Atomic addition of immediate value. |
/** Atomic addition. |
* |
* @param val Memory location to which will be the immediate value added. |
* @param i Signed immediate that will be added to *val. |
* @param val "Atomic variable". |
* @param i Value to add. |
* |
* @return Value after addition. |
*/ |
71,8 → 62,17 |
); |
|
return ret; |
} |
} |
|
static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); } |
static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); } |
|
static inline long atomic_preinc(atomic_t *val) { return atomic_add(val, 1); } |
static inline long atomic_predec(atomic_t *val) { return atomic_add(val, -1); } |
|
static inline long atomic_postinc(atomic_t *val) { return atomic_add(val, 1) - 1; } |
static inline long atomic_postdec(atomic_t *val) { return atomic_add(val, -1) + 1; } |
|
#endif |
|
/** @} |