summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/hardirq.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-09-12 01:29:55 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-09-12 01:29:55 +0000
commit545f435ebcfd94a1e7c20b46efe81b4d6ac4e698 (patch)
treee9ce4bc598d06374bda906f18365984bf22a526a /include/asm-sparc64/hardirq.h
parent4291a610eef89d0d5c69d9a10ee6560e1aa36c74 (diff)
Merge with Linux 2.1.55. More bugfixes and goodies from my private
CVS archive.
Diffstat (limited to 'include/asm-sparc64/hardirq.h')
-rw-r--r--include/asm-sparc64/hardirq.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/include/asm-sparc64/hardirq.h b/include/asm-sparc64/hardirq.h
index 03ee543b1..5ca51ac77 100644
--- a/include/asm-sparc64/hardirq.h
+++ b/include/asm-sparc64/hardirq.h
@@ -8,16 +8,20 @@
#include <linux/tasks.h>
-extern unsigned int local_irq_count[NR_CPUS];
-#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)
+#ifndef __SMP__
+extern unsigned int local_irq_count;
+#else
+#define local_irq_count (cpu_data[smp_processor_id()].irq_count)
+#endif
+#define in_interrupt() (local_irq_count != 0)
#ifndef __SMP__
-#define hardirq_trylock(cpu) (local_irq_count[cpu] == 0)
+#define hardirq_trylock(cpu) (local_irq_count == 0)
#define hardirq_endlock(cpu) do { } while(0)
-#define hardirq_enter(cpu) (local_irq_count[cpu]++)
-#define hardirq_exit(cpu) (local_irq_count[cpu]--)
+#define hardirq_enter(cpu) (local_irq_count++)
+#define hardirq_exit(cpu) (local_irq_count--)
#define synchronize_irq() do { } while(0)
@@ -43,14 +47,16 @@ static inline void release_irqlock(int cpu)
static inline void hardirq_enter(int cpu)
{
- ++local_irq_count[cpu];
+ ++cpu_data[cpu].irq_count;
atomic_inc(&global_irq_count);
+ membar("#StoreLoad | #StoreStore");
}
static inline void hardirq_exit(int cpu)
{
+ membar("#StoreStore | #LoadStore");
atomic_dec(&global_irq_count);
- --local_irq_count[cpu];
+ --cpu_data[cpu].irq_count;
}
static inline int hardirq_trylock(int cpu)
@@ -58,13 +64,14 @@ static inline int hardirq_trylock(int cpu)
unsigned long flags;
__save_and_cli(flags);
- if(atomic_add_return(1, &global_irq_count) != 1 ||
- *(((unsigned char *)(&global_irq_lock)))) {
+ atomic_inc(&global_irq_count);
+ if(atomic_read(&global_irq_count) != 1 ||
+ (*(((unsigned char *)(&global_irq_lock)))) != 0) {
atomic_dec(&global_irq_count);
__restore_flags(flags);
return 0;
}
- ++local_irq_count[cpu];
+ ++cpu_data[cpu].irq_count;
return 1;
}