Last change
on this file since 163 was 142, checked in by ktk, 25 years ago |
Import
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
703 bytes
|
Line | |
---|
1 | /* $Id: atomic.h 142 2000-04-23 14:55:46Z ktk $ */
|
---|
2 |
|
---|
3 | #ifndef __ARCH_I386_ATOMIC__
|
---|
4 | #define __ARCH_I386_ATOMIC__
|
---|
5 |
|
---|
6 | #define LOCK
|
---|
7 |
|
---|
8 | typedef struct { int counter; } atomic_t;
|
---|
9 |
|
---|
10 | #define ATOMIC_INIT(i) { (i) }
|
---|
11 |
|
---|
12 | #define atomic_read(v) ((v)->counter)
|
---|
13 | #define atomic_set(v,i) (((v)->counter) = (i))
|
---|
14 |
|
---|
15 | static void atomic_add(int i, volatile atomic_t *v);
|
---|
16 | static void atomic_sub(int i, volatile atomic_t *v);
|
---|
17 | static void atomic_inc(volatile atomic_t *v);
|
---|
18 | static void atomic_dec(volatile atomic_t *v);
|
---|
19 | static int atomic_dec_and_test(volatile atomic_t *v);
|
---|
20 | extern int atomic_add_negative(int i, volatile atomic_t *v);
|
---|
21 |
|
---|
22 | /* These are x86-specific, used by some header files */
|
---|
23 | #define atomic_clear_mask(mask, addr)
|
---|
24 |
|
---|
25 | #define atomic_set_mask(mask, addr)
|
---|
26 |
|
---|
27 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.