patch-2.4.4 linux/include/asm-ia64/hardirq.h

Next file: linux/include/asm-ia64/hw_irq.h
Previous file: linux/include/asm-ia64/efi.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.3/linux/include/asm-ia64/hardirq.h linux/include/asm-ia64/hardirq.h
@@ -2,8 +2,8 @@
 #define _ASM_IA64_HARDIRQ_H
 
 /*
- * Copyright (C) 1998-2000 Hewlett-Packard Co
- * Copyright (C) 1998-2000 David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1998-2001 Hewlett-Packard Co
+ * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
  */
 
 #include <linux/config.h>
@@ -11,36 +11,38 @@
 #include <linux/threads.h>
 #include <linux/irq.h>
 
-/* 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;
-	unsigned int __nmi_count;	/* arch dependent */
-} ____cacheline_aligned irq_cpustat_t;
-
-#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
+#include <asm/processor.h>
 
 /*
- * Are we in an interrupt context? Either doing bottom half
- * or hardware interrupt processing?
+ * No irq_cpustat_t for IA-64.  The data is held in the per-CPU data structure.
  */
-#define in_interrupt()						\
-({								\
-	int __cpu = smp_processor_id();				\
-	(local_irq_count(__cpu) + local_bh_count(__cpu)) != 0;	\
-})
+#define softirq_active(cpu)		(cpu_data[cpu].softirq.active)
+#define softirq_mask(cpu)		(cpu_data[cpu].softirq.mask)
+#define irq_count(cpu)			(cpu_data[cpu].irq_stat.f.irq_count)
+#define bh_count(cpu)			(cpu_data[cpu].irq_stat.f.bh_count)
+#define syscall_count(cpu)		/* unused on IA-64 */
+#define nmi_count(cpu)			0
+
+#define local_softirq_active()		(local_cpu_data->softirq.active)
+#define local_softirq_mask()		(local_cpu_data->softirq.mask)
+#define local_irq_count()		(local_cpu_data->irq_stat.f.irq_count)
+#define local_bh_count()		(local_cpu_data->irq_stat.f.bh_count)
+#define local_syscall_count()		/* unused on IA-64 */
+#define local_nmi_count()		0
 
-#define in_irq() (local_irq_count(smp_processor_id()) != 0)
+/*
+ * Are we in an interrupt context? Either doing bottom half or hardware interrupt
+ * processing?
+ */
+#define in_interrupt()			(local_cpu_data->irq_stat.irq_and_bh_counts != 0)
+#define in_irq()			(local_cpu_data->irq_stat.f.irq_count != 0)
 
 #ifndef CONFIG_SMP
-# define hardirq_trylock(cpu)		(local_irq_count(cpu) == 0)
-# define hardirq_endlock(cpu)		do { } while (0)
+# define local_hardirq_trylock()	(local_irq_count() == 0)
+# define local_hardirq_endlock()	do { } while (0)
 
-# define irq_enter(cpu, irq)		(local_irq_count(cpu)++)
-# define irq_exit(cpu, irq)		(local_irq_count(cpu)--)
+# define local_irq_enter(irq)		(local_irq_count()++)
+# define local_irq_exit(irq)		(local_irq_count()--)
 
 # define synchronize_irq()		barrier()
 #else
@@ -51,17 +53,19 @@
 extern unsigned int global_irq_holder;
 extern volatile unsigned long global_irq_lock;
 
-static inline int irqs_running (void)
+static inline int
+irqs_running (void)
 {
 	int i;
 
 	for (i = 0; i < smp_num_cpus; i++)
-		if (local_irq_count(i))
+		if (irq_count(i))
 			return 1;
 	return 0;
 }
 
-static inline void release_irqlock(int cpu)
+static inline void
+release_irqlock (int cpu)
 {
 	/* if we didn't own the irq lock, just ignore.. */
 	if (global_irq_holder == cpu) {
@@ -70,28 +74,31 @@
         }
 }
 
-static inline void irq_enter(int cpu, int irq)
+static inline void
+local_irq_enter (int irq)
 {
-	local_irq_count(cpu)++;
+	local_irq_count()++;
 
 	while (test_bit(0,&global_irq_lock)) {
 		/* nothing */;
 	}
 }
 
-static inline void irq_exit(int cpu, int irq)
+static inline void
+local_irq_exit (int irq)
 {
-	local_irq_count(cpu)--;
+	local_irq_count()--;
 }
 
-static inline int hardirq_trylock(int cpu)
+static inline int
+local_hardirq_trylock (void)
 {
-	return !local_irq_count(cpu) && !test_bit(0,&global_irq_lock);
+	return !local_irq_count() && !test_bit(0,&global_irq_lock);
 }
 
-#define hardirq_endlock(cpu)	do { } while (0)
+#define local_hardirq_endlock()		do { } while (0)
 
-extern void synchronize_irq(void);
+extern void synchronize_irq (void);
 
 #endif /* CONFIG_SMP */
 #endif /* _ASM_IA64_HARDIRQ_H */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)