1 #ifndef __ASM_HARDIRQ_H
2 #define __ASM_HARDIRQ_H
3 
4 #include <xen/cache.h>
5 #include <xen/types.h>
6 
7 typedef struct {
8 	unsigned int __softirq_pending;
9 	unsigned int __local_irq_count;
10 	unsigned int nmi_count;
11 	unsigned int mce_count;
12 	bool_t __mwait_wakeup;
13 } __cacheline_aligned irq_cpustat_t;
14 
15 #include <xen/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
16 
17 #define in_irq() (local_irq_count(smp_processor_id()) != 0)
18 
19 #define irq_enter()	(local_irq_count(smp_processor_id())++)
20 #define irq_exit()	(local_irq_count(smp_processor_id())--)
21 
22 #define nmi_count(cpu)		__IRQ_STAT(cpu, nmi_count)
23 #define in_nmi_handler()	(nmi_count(smp_processor_id()) != 0)
24 #define nmi_enter()		(nmi_count(smp_processor_id())++)
25 #define nmi_exit()		(nmi_count(smp_processor_id())--)
26 
27 #define mce_count(cpu)		__IRQ_STAT(cpu, mce_count)
28 #define in_mce_handler()	(mce_count(smp_processor_id()) != 0)
29 #define mce_enter()		(mce_count(smp_processor_id())++)
30 #define mce_exit()		(mce_count(smp_processor_id())--)
31 
32 void ack_bad_irq(unsigned int irq);
33 
34 extern void apic_intr_init(void);
35 extern void smp_intr_init(void);
36 
37 #endif /* __ASM_HARDIRQ_H */
38