/kernel/trunk/generic/include/atomic.h |
---|
29,12 → 29,11 |
#ifndef __ATOMIC_H__ |
#define __ATOMIC_H__ |
struct atomic { |
typedef struct atomic { |
volatile long count; |
}; |
} atomic_t; |
#include <arch/atomic.h> |
#include <typedefs.h> |
static inline void atomic_set(atomic_t *val, long i) |
{ |
/kernel/trunk/generic/include/typedefs.h |
---|
61,6 → 61,7 |
typedef enum rwlock_type rwlock_type_t; |
typedef struct condvar condvar_t; |
typedef struct waitq waitq_t; |
typedef struct futex futex_t; |
typedef struct chunk chunk_t; |
92,6 → 93,4 |
typedef struct btree_node btree_node_t; |
typedef struct btree btree_t; |
typedef struct atomic atomic_t; |
#endif |
/kernel/trunk/arch/ia64/include/atomic.h |
---|
29,10 → 29,6 |
#ifndef __ia64_ATOMIC_H__ |
#define __ia64_ATOMIC_H__ |
#include <arch/types.h> |
#include <typedefs.h> |
/** Atomic addition. |
* |
* @param val Atomic value. |
/kernel/trunk/arch/ppc32/include/atomic.h |
---|
29,12 → 29,9 |
#ifndef __ppc32_ATOMIC_H__ |
#define __ppc32_ATOMIC_H__ |
#include <arch/types.h> |
#include <typedefs.h> |
static inline void atomic_inc(atomic_t *val) |
{ |
__u32 tmp; |
long tmp; |
asm __volatile__ ( |
"1:\n" |
49,7 → 46,7 |
static inline void atomic_dec(atomic_t *val) |
{ |
__u32 tmp; |
long tmp; |
asm __volatile__( |
"1:\n" |
/kernel/trunk/arch/mips32/include/atomic.h |
---|
29,9 → 29,6 |
#ifndef __mips32_ATOMIC_H__ |
#define __mips32_ATOMIC_H__ |
#include <arch/types.h> |
#include <typedefs.h> |
#define atomic_inc(x) ((void) atomic_add(x, 1)) |
#define atomic_dec(x) ((void) atomic_add(x, -1)) |