source: cmedia/trunk/Include/Asm/atomic.h

Last change on this file was 354, checked in by stevenhl, 17 years ago

Import untested baseline cmedia sources, work products and binaries
Binaries and work products should be deleted from repository.
once new builds are verified to work.

File size: 775 bytes
Line 
1/* $Id: atomic.h,v 1.1 2000/04/23 14:55:27 ktk Exp $ */
2
3#ifndef __ARCH_I386_ATOMIC__
4#define __ARCH_I386_ATOMIC__
5
6#define LOCK
7
8typedef 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
15static void atomic_add(int i, volatile atomic_t *v);
16static void atomic_sub(int i, volatile atomic_t *v);
17static void atomic_inc(volatile atomic_t *v);
18static void atomic_dec(volatile atomic_t *v);
19static int atomic_dec_and_test(volatile atomic_t *v);
20extern 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.