1 #ifndef _ASM_IA64_HARDIRQ_H
2 #define _ASM_IA64_HARDIRQ_H
5 * Copyright (C) 1998-2001 Hewlett-Packard Co
6 * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
9 #include <linux/config.h>
11 #include <linux/threads.h>
12 #include <linux/irq.h>
14 #include <asm/processor.h>
17 * No irq_cpustat_t for IA-64. The data is held in the per-CPU data structure.
19 #define softirq_pending(cpu) (cpu_data(cpu)->softirq_pending)
20 #define ksoftirqd_task(cpu) (cpu_data(cpu)->ksoftirqd)
21 #define irq_count(cpu) (cpu_data(cpu)->irq_stat.f.irq_count)
22 #define bh_count(cpu) (cpu_data(cpu)->irq_stat.f.bh_count)
23 #define syscall_count(cpu) /* unused on IA-64 */
24 #define nmi_count(cpu) 0
26 #define local_softirq_pending() (local_cpu_data->softirq_pending)
27 #define local_ksoftirqd_task() (local_cpu_data->ksoftirqd)
28 #define really_local_irq_count() (local_cpu_data->irq_stat.f.irq_count) /* XXX fix me */
29 #define really_local_bh_count() (local_cpu_data->irq_stat.f.bh_count) /* XXX fix me */
30 #define local_syscall_count() /* unused on IA-64 */
31 #define local_nmi_count() 0
34 * Are we in an interrupt context? Either doing bottom half or hardware interrupt
37 #define in_interrupt() (local_cpu_data->irq_stat.irq_and_bh_counts != 0)
38 #define in_irq() (local_cpu_data->irq_stat.f.irq_count != 0)
41 # define local_hardirq_trylock() (really_local_irq_count() == 0)
42 # define local_hardirq_endlock() do { } while (0)
44 # define local_irq_enter(irq) (really_local_irq_count()++)
45 # define local_irq_exit(irq) (really_local_irq_count()--)
47 # define synchronize_irq() barrier()
50 #include <asm/atomic.h>
53 extern unsigned int global_irq_holder;
54 extern volatile unsigned long global_irq_lock;
61 for (i = 0; i < smp_num_cpus; i++)
68 release_irqlock (int cpu)
70 /* if we didn't own the irq lock, just ignore.. */
71 if (global_irq_holder == cpu) {
72 global_irq_holder = NO_PROC_ID;
73 smp_mb__before_clear_bit(); /* need barrier before releasing lock... */
74 clear_bit(0,&global_irq_lock);
79 local_irq_enter (int irq)
81 really_local_irq_count()++;
83 while (test_bit(0,&global_irq_lock)) {
89 local_irq_exit (int irq)
91 really_local_irq_count()--;
95 local_hardirq_trylock (void)
97 return !really_local_irq_count() && !test_bit(0,&global_irq_lock);
100 #define local_hardirq_endlock() do { } while (0)
102 extern void synchronize_irq (void);
104 #endif /* CONFIG_SMP */
105 #endif /* _ASM_IA64_HARDIRQ_H */