summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc/hardirq.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-08-08 18:54:49 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-08-08 18:54:49 +0000
commit5514f4babeeb3af00ee0c325e3cda7a562cc3d65 (patch)
treeedd733879cab73e41324a99ca5da7bc154c4196d /include/asm-sparc/hardirq.h
parent6a9366db547e958e8c9bf8e1c13bcea6cb2bf393 (diff)
Merge with Linux 2.4.0-test6-pre4.
Diffstat (limited to 'include/asm-sparc/hardirq.h')
-rw-r--r--include/asm-sparc/hardirq.h41
1 files changed, 20 insertions, 21 deletions
diff --git a/include/asm-sparc/hardirq.h b/include/asm-sparc/hardirq.h
index 8b7b095ad..cfee071dc 100644
--- a/include/asm-sparc/hardirq.h
+++ b/include/asm-sparc/hardirq.h
@@ -10,26 +10,37 @@
#include <linux/config.h>
#include <linux/threads.h>
-#ifndef CONFIG_SMP
-extern unsigned int __local_irq_count;
-#define local_irq_count(cpu) __local_irq_count
+/* entry.S is sensitive to the offsets of these fields */
+typedef struct {
+ unsigned int __softirq_active;
+ unsigned int __softirq_mask;
+ unsigned int __local_irq_count;
+ unsigned int __local_bh_count;
+ unsigned int __syscall_count;
+} ____cacheline_aligned irq_cpustat_t;
+
+#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
/*
* Are we in an interrupt context? Either doing bottom half
* or hardware interrupt processing?
*/
-#define in_interrupt() ((__local_irq_count + __local_bh_count) != 0)
+#define in_interrupt() ({ int __cpu = smp_processor_id(); \
+ (local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
+
+#define in_irq() ({ int __cpu = smp_processor_id(); \
+ (local_irq_count(__cpu) != 0); })
-#define hardirq_trylock(cpu) ((void)(cpu), __local_irq_count == 0)
+#ifndef CONFIG_SMP
+
+#define hardirq_trylock(cpu) (local_irq_count(cpu) == 0)
#define hardirq_endlock(cpu) do { (void)(cpu); } while (0)
-#define hardirq_enter(cpu) (__local_irq_count++)
-#define hardirq_exit(cpu) (__local_irq_count--)
+#define hardirq_enter(cpu) (++local_irq_count(cpu))
+#define hardirq_exit(cpu) (--local_irq_count(cpu))
#define synchronize_irq() barrier()
-#define in_irq() (__local_irq_count != 0)
-
#else
#include <asm/atomic.h>
@@ -37,22 +48,10 @@ extern unsigned int __local_irq_count;
#include <asm/system.h>
#include <asm/smp.h>
-extern unsigned int __local_irq_count[NR_CPUS];
-#define local_irq_count(cpu) __local_irq_count[cpu]
extern unsigned char global_irq_holder;
extern spinlock_t global_irq_lock;
extern atomic_t global_irq_count;
-/*
- * Are we in an interrupt context? Either doing bottom half
- * or hardware interrupt processing?
- */
-#define in_interrupt() ({ int __cpu = smp_processor_id(); \
- (local_irq_count(__cpu) + local_bh_count(__cpu) != 0); })
-
-#define in_irq() ({ int __cpu = smp_processor_id(); \
- (local_irq_count(__cpu) != 0); })
-
static inline void release_irqlock(int cpu)
{
/* if we didn't own the irq lock, just ignore.. */