blob: 622815bf3243e00306774bbea1ab01e2bc2a2f3e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_HW_IRQ_H
2#define _ASM_HW_IRQ_H
3
4/*
5 * linux/include/asm/hw_irq.h
6 *
7 * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
8 *
9 * moved some of the old arch/i386/kernel/irq.h to here. VY
10 *
11 * IRQ/IPI changes taken from work by Thomas Radke
12 * <tomsoft@informatik.tu-chemnitz.de>
13 */
14
15#include <linux/config.h>
16#include <linux/profile.h>
17#include <asm/atomic.h>
18#include <asm/irq.h>
19#include <asm/sections.h>
20
Andrew Mortond96c4e72005-09-30 11:58:57 -070021struct hw_interrupt_type;
22
Linus Torvalds1da177e2005-04-16 15:20:36 -070023/*
24 * Various low-level irq details needed by irq.c, process.c,
25 * time.c, io_apic.c and smp.c
26 *
27 * Interrupt entry/exit code at both C and assembly level
28 */
29
30extern u8 irq_vector[NR_IRQ_VECTORS];
31#define IO_APIC_VECTOR(irq) (irq_vector[irq])
32#define AUTO_ASSIGN -1
33
34extern void (*interrupt[NR_IRQS])(void);
35
36#ifdef CONFIG_SMP
37fastcall void reschedule_interrupt(void);
38fastcall void invalidate_interrupt(void);
39fastcall void call_function_interrupt(void);
40#endif
41
42#ifdef CONFIG_X86_LOCAL_APIC
43fastcall void apic_timer_interrupt(void);
44fastcall void error_interrupt(void);
45fastcall void spurious_interrupt(void);
46fastcall void thermal_interrupt(struct pt_regs *);
47#define platform_legacy_irq(irq) ((irq) < 16)
48#endif
49
50void disable_8259A_irq(unsigned int irq);
51void enable_8259A_irq(unsigned int irq);
52int i8259A_irq_pending(unsigned int irq);
53void make_8259A_irq(unsigned int irq);
54void init_8259A(int aeoi);
55void FASTCALL(send_IPI_self(int vector));
56void init_VISWS_APIC_irqs(void);
57void setup_IO_APIC(void);
58void disable_IO_APIC(void);
59void print_IO_APIC(void);
60int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
61void send_IPI(int dest, int vector);
62void setup_ioapic_dest(void);
63
64extern unsigned long io_apic_irqs;
65
66extern atomic_t irq_err_count;
67extern atomic_t irq_mis_count;
68
69#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
70
71#if defined(CONFIG_X86_IO_APIC)
72static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
73{
74 if (IO_APIC_IRQ(i))
75 send_IPI_self(IO_APIC_VECTOR(i));
76}
77#else
78static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
79#endif
80
81#endif /* _ASM_HW_IRQ_H */