diff options
author | Harald Koerfgen <hkoerfg@web.de> | 1999-07-26 19:42:38 +0000 |
---|---|---|
committer | Harald Koerfgen <hkoerfg@web.de> | 1999-07-26 19:42:38 +0000 |
commit | 14ab59aa8aba8687dc957c2186e115ac0b8ab542 (patch) | |
tree | c2eb55db21b6b46ddd983e2d40196fa61f19b64c /include/asm-mips/atomic.h | |
parent | 552f7f2f262b8ea12edc36f9a260b068bd10f423 (diff) |
The remaining R3000 changes. From now on the CVS will be R3000 aware. R3000 Indigo anyone? :-)
Diffstat (limited to 'include/asm-mips/atomic.h')
-rw-r--r-- | include/asm-mips/atomic.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index 5cebea94d..58e095a53 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h @@ -11,7 +11,7 @@ * * Copyright (C) 1996, 1997 by Ralf Baechle * - * $Id: atomic.h,v 1.3 1997/12/15 10:38:29 ralf Exp $ + * $Id: atomic.h,v 1.5 1998/03/04 09:51:21 ralf Exp $ */ #ifndef __ASM_MIPS_ATOMIC_H #define __ASM_MIPS_ATOMIC_H @@ -44,7 +44,7 @@ extern __inline__ void atomic_add(int i, volatile atomic_t * v) save_flags(flags); cli(); - *v += i; + v->counter += i; restore_flags(flags); } @@ -54,7 +54,7 @@ extern __inline__ void atomic_sub(int i, volatile atomic_t * v) save_flags(flags); cli(); - *v -= i; + v->counter -= i; restore_flags(flags); } @@ -64,9 +64,9 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v) save_flags(flags); cli(); - temp = *v; + temp = v->counter; temp += i; - *v = temp; + v->counter = temp; restore_flags(flags); return temp; @@ -78,13 +78,29 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v) save_flags(flags); cli(); - temp = *v; + temp = v->counter; temp -= i; - *v = temp; + v->counter = temp; restore_flags(flags); return temp; } + +extern __inline__ void atomic_clear_mask(unsigned long mask, unsigned long * v) +{ + unsigned long temp; + int flags; + + save_flags(flags); + cli(); + temp = *v; + temp &= ~mask; + *v = temp; + restore_flags(flags); + + return; +} + #endif #if (_MIPS_ISA == _MIPS_ISA_MIPS2) || (_MIPS_ISA == _MIPS_ISA_MIPS3) || \ |