5 * linux/include/asm/hw_irq.h
7 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
9 * moved some of the old arch/i386/kernel/irq.h to here. VY
11 * IRQ/IPI changes taken from work by Thomas Radke
12 * <tomsoft@informatik.tu-chemnitz.de>
15 #include <linux/config.h>
16 #include <linux/profile.h>
17 #include <asm/atomic.h>
21 * Various low-level irq details needed by irq.c, process.c,
22 * time.c, io_apic.c and smp.c
24 * Interrupt entry/exit code at both C and assembly level
27 extern int irq_vector[NR_IRQS];
28 #define IO_APIC_VECTOR(irq) irq_vector[irq]
30 extern void (*interrupt[NR_IRQS])(void);
33 extern asmlinkage void reschedule_interrupt(void);
34 extern asmlinkage void invalidate_interrupt(void);
35 extern asmlinkage void call_function_interrupt(void);
38 #ifdef CONFIG_X86_LOCAL_APIC
39 extern asmlinkage void apic_timer_interrupt(void);
40 extern asmlinkage void error_interrupt(void);
41 extern asmlinkage void spurious_interrupt(void);
42 extern asmlinkage void thermal_interrupt(struct pt_regs);
45 extern void mask_irq(unsigned int irq);
46 extern void unmask_irq(unsigned int irq);
47 extern void disable_8259A_irq(unsigned int irq);
48 extern void enable_8259A_irq(unsigned int irq);
49 extern int i8259A_irq_pending(unsigned int irq);
50 extern void make_8259A_irq(unsigned int irq);
51 extern void init_8259A(int aeoi);
52 extern void FASTCALL(send_IPI_self(int vector));
53 extern void init_VISWS_APIC_irqs(void);
54 extern void setup_IO_APIC(void);
55 extern void disable_IO_APIC(void);
56 extern void print_IO_APIC(void);
57 extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
58 extern void send_IPI(int dest, int vector);
59 extern void setup_ioapic_dest(unsigned long mask);
61 extern unsigned long io_apic_irqs;
63 extern atomic_t irq_err_count;
64 extern atomic_t irq_mis_count;
66 extern char _stext, _etext;
68 #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
71 * The profiling function is SMP safe. (nothing can mess
72 * around with "current", and the profiling counters are
73 * updated with atomic operations). This is especially
74 * useful with a profiling multiplier != 1
76 static inline void x86_do_profile(struct pt_regs * regs)
79 extern unsigned long prof_cpu_mask;
92 * Only measure the CPUs specified by /proc/irq/prof_cpu_mask.
93 * (default is all CPUs.)
95 if (!((1<<smp_processor_id()) & prof_cpu_mask))
98 eip -= (unsigned long) &_stext;
101 * Don't ignore out-of-bounds EIP values silently,
102 * put them into the last histogram slot, so if
103 * present, they will show up as a sharp peak.
105 if (eip > prof_len-1)
107 atomic_inc((atomic_t *)&prof_buffer[eip]);
110 #if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP)
111 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
114 send_IPI_self(IO_APIC_VECTOR(i));
117 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
120 extern irq_desc_t irq_desc [NR_IRQS];
122 #endif /* _ASM_HW_IRQ_H */