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>
19 #include <asm/sections.h>
22 * Various low-level irq details needed by irq.c, process.c,
23 * time.c, io_apic.c and smp.c
25 * Interrupt entry/exit code at both C and assembly level
28 extern u8 irq_vector[NR_IRQ_VECTORS];
29 #define IO_APIC_VECTOR(irq) (irq_vector[irq])
30 #define AUTO_ASSIGN -1
32 extern void (*interrupt[NR_IRQS])(void);
35 asmlinkage void reschedule_interrupt(void);
36 asmlinkage void invalidate_interrupt(void);
37 asmlinkage void call_function_interrupt(void);
40 #ifdef CONFIG_X86_LOCAL_APIC
41 asmlinkage void apic_timer_interrupt(void);
42 asmlinkage void error_interrupt(void);
43 asmlinkage void spurious_interrupt(void);
44 asmlinkage void thermal_interrupt(struct pt_regs);
45 #define platform_legacy_irq(irq) ((irq) < 16)
48 void mask_irq(unsigned int irq);
49 void unmask_irq(unsigned int irq);
50 void disable_8259A_irq(unsigned int irq);
51 void enable_8259A_irq(unsigned int irq);
52 int i8259A_irq_pending(unsigned int irq);
53 void make_8259A_irq(unsigned int irq);
54 void init_8259A(int aeoi);
55 void FASTCALL(send_IPI_self(int vector));
56 void init_VISWS_APIC_irqs(void);
57 void setup_IO_APIC(void);
58 void disable_IO_APIC(void);
59 void print_IO_APIC(void);
60 int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
61 void send_IPI(int dest, int vector);
62 void setup_ioapic_dest(void);
64 extern unsigned long io_apic_irqs;
66 extern atomic_t irq_err_count;
67 extern atomic_t irq_mis_count;
69 #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
72 * The profiling function is SMP safe. (nothing can mess
73 * around with "current", and the profiling counters are
74 * updated with atomic operations). This is especially
75 * useful with a profiling multiplier != 1
77 static inline void x86_do_profile(struct pt_regs * regs)
80 extern unsigned long prof_cpu_mask;
93 * Only measure the CPUs specified by /proc/irq/prof_cpu_mask.
94 * (default is all CPUs.)
96 if (!((1<<smp_processor_id()) & prof_cpu_mask))
99 eip -= (unsigned long)_stext;
102 * Don't ignore out-of-bounds EIP values silently,
103 * put them into the last histogram slot, so if
104 * present, they will show up as a sharp peak.
106 if (eip > prof_len-1)
108 atomic_inc((atomic_t *)&prof_buffer[eip]);
111 #if defined(CONFIG_X86_IO_APIC)
112 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
115 send_IPI_self(IO_APIC_VECTOR(i));
118 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
121 #endif /* _ASM_HW_IRQ_H */