| Last change
 on this file since 558 was             354, checked in by stevenhl, 17 years ago | 
        
          | 
Import untested baseline cmedia sources, work products and binariesBinaries 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 |  | 
|---|
| 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.