summaryrefslogtreecommitdiffstats
path: root/include/asm-sh/atomic.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-27 01:05:20 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-27 01:05:20 +0000
commit546db14ee74118296f425f3b91634fb767d67290 (patch)
tree22b613a3da8d4bf663eec5e155af01b87fdf9094 /include/asm-sh/atomic.h
parent1e25e41c4f5474e14452094492dbc169b800e4c8 (diff)
Merge with Linux 2.3.23. The new bootmem stuff has broken various
platforms. At this time I've only verified that IP22 support compiles and IP27 actually works.
Diffstat (limited to 'include/asm-sh/atomic.h')
-rw-r--r--include/asm-sh/atomic.h24
1 files changed, 9 insertions, 15 deletions
diff --git a/include/asm-sh/atomic.h b/include/asm-sh/atomic.h
index d2af3d769..7f580a9aa 100644
--- a/include/asm-sh/atomic.h
+++ b/include/asm-sh/atomic.h
@@ -25,7 +25,7 @@ typedef struct { int counter; } atomic_t;
* on us. We need to use _exactly_ the address the user gave us,
* not some alias that contains the same information.
*/
-#define __atomic_fool_gcc(x) (*(struct { int a[100]; } *)x)
+#define __atomic_fool_gcc(x) (*(volatile struct { int a[100]; } *)x)
/*
* To get proper branch prediction for the main line, we must branch
@@ -37,8 +37,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)
{
unsigned long flags;
- save_flags(flags);
- cli();
+ save_and_cli(flags);
*(long *)v += i;
restore_flags(flags);
}
@@ -47,8 +46,7 @@ extern __inline__ void atomic_sub(int i, atomic_t *v)
{
unsigned long flags;
- save_flags(flags);
- cli();
+ save_and_cli(flags);
*(long *)v -= i;
restore_flags(flags);
}
@@ -57,8 +55,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)
{
unsigned long temp, flags;
- save_flags(flags);
- cli();
+ save_and_cli(flags);
temp = *(long *)v;
temp += i;
*(long *)v = temp;
@@ -71,8 +68,7 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
{
unsigned long temp, flags;
- save_flags(flags);
- cli();
+ save_and_cli(flags);
temp = *(long *)v;
temp -= i;
*(long *)v = temp;
@@ -90,22 +86,20 @@ extern __inline__ int atomic_sub_return(int i, atomic_t * v)
#define atomic_inc(v) atomic_add(1,(v))
#define atomic_dec(v) atomic_sub(1,(v))
-extern __inline__ void atomic_clear_mask(int mask, atomic_t *v)
+extern __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v)
{
unsigned long flags;
- save_flags(flags);
- cli();
+ save_and_cli(flags);
*(long *)v &= ~mask;
restore_flags(flags);
}
-extern __inline__ void atomic_set_mask(int mask, atomic_t *v)
+extern __inline__ void atomic_set_mask(unsigned int mask, atomic_t *v)
{
unsigned long flags;
- save_flags(flags);
- cli();
+ save_and_cli(flags);
*(long *)v |= mask;
restore_flags(flags);
}