Subversion Repositories HelenOS-historic

Rev

Rev 627 | Rev 1104 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 627 Rev 1024
Line 32... Line 32...
32
#include <arch/types.h>
32
#include <arch/types.h>
33
 
33
 
34
#define atomic_inc(x)   ((void) atomic_add(x, 1))
34
#define atomic_inc(x)   ((void) atomic_add(x, 1))
35
#define atomic_dec(x)   ((void) atomic_add(x, -1))
35
#define atomic_dec(x)   ((void) atomic_add(x, -1))
36
 
36
 
37
#define atomic_inc_pre(x) (atomic_add(x, 1) - 1)
37
#define atomic_postinc(x) (atomic_add(x, 1) - 1)
38
#define atomic_dec_pre(x) (atomic_add(x, -1) + 1)
38
#define atomic_postdec(x) (atomic_add(x, -1) + 1)
39
 
-
 
40
#define atomic_inc_post(x) atomic_add(x, 1)
-
 
41
#define atomic_dec_post(x) atomic_add(x, -1)
-
 
42
 
39
 
-
 
40
#define atomic_preinc(x) atomic_add(x, 1)
-
 
41
#define atomic_predec(x) atomic_add(x, -1)
43
 
42
 
44
typedef struct { volatile __u32 count; } atomic_t;
43
typedef struct { volatile __u32 count; } atomic_t;
45
 
44
 
46
/* Atomic addition of immediate value.
45
/* Atomic addition of immediate value.
47
 *
46
 *