patch-2.2.14 linux/include/asm-alpha/hardirq.h
Next file: linux/include/asm-alpha/hwrpb.h
Previous file: linux/include/asm-alpha/floppy.h
Back to the patch index
Back to the overall index
- Lines: 67
- Date:
Tue Jan 4 10:12:24 2000
- Orig file:
v2.2.13/linux/include/asm-alpha/hardirq.h
- Orig date:
Mon Oct 12 11:40:13 1998
diff -u --recursive --new-file v2.2.13/linux/include/asm-alpha/hardirq.h linux/include/asm-alpha/hardirq.h
@@ -5,27 +5,26 @@
#include <linux/tasks.h>
-extern unsigned int local_irq_count[NR_CPUS];
-extern unsigned long hardirq_no[NR_CPUS];
+#ifndef __SMP__
+extern unsigned long local_irq_count;
+#else
+#define local_irq_count (cpu_data[smp_processor_id()].irq_count)
+#endif
/*
* 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_interrupt() ((local_irq_count + local_bh_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) ((void) 0)
-#define hardirq_enter(cpu, irq) (local_irq_count[cpu]++)
-#define hardirq_exit(cpu, irq) (local_irq_count[cpu]--)
+#define hardirq_enter(cpu, irq) (local_irq_count++)
+#define hardirq_exit(cpu, irq) (local_irq_count--)
#define synchronize_irq() barrier()
@@ -50,24 +49,23 @@
static inline void hardirq_enter(int cpu, int irq)
{
- ++local_irq_count[cpu];
+ ++(cpu_data[cpu].irq_count);
atomic_inc(&global_irq_count);
- hardirq_no[cpu] |= 1L << irq; /* debugging only */
}
static inline void hardirq_exit(int cpu, int irq)
{
- hardirq_no[cpu] &= ~(1L << irq); /* debugging only */
atomic_dec(&global_irq_count);
- --local_irq_count[cpu];
+ --(cpu_data[cpu].irq_count);
}
static inline int hardirq_trylock(int cpu)
{
- return !atomic_read(&global_irq_count) && !global_irq_lock.lock;
+ return ! atomic_read(&global_irq_count) &&
+ ! spin_is_locked(&global_irq_lock);
}
-#define hardirq_endlock(cpu) ((void)0)
+#define hardirq_endlock(cpu) ((void) 0)
extern void synchronize_irq(void);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)