aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86_64/hw_irq.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-x86_64/hw_irq.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/asm-x86_64/hw_irq.h')
-rw-r--r--include/asm-x86_64/hw_irq.h144
1 files changed, 144 insertions, 0 deletions
diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h
new file mode 100644
index 000000000000..2b5cb2865d21
--- /dev/null
+++ b/include/asm-x86_64/hw_irq.h
@@ -0,0 +1,144 @@
1#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 * hacked by Andi Kleen for x86-64.
15 *
16 * $Id: hw_irq.h,v 1.24 2001/09/14 20:55:03 vojtech Exp $
17 */
18
19#ifndef __ASSEMBLY__
20#include <linux/config.h>
21#include <asm/atomic.h>
22#include <asm/irq.h>
23#include <linux/profile.h>
24#include <linux/smp.h>
25
26struct hw_interrupt_type;
27#endif
28
29/*
30 * IDT vectors usable for external interrupt sources start
31 * at 0x20:
32 */
33#define FIRST_EXTERNAL_VECTOR 0x20
34
35#define IA32_SYSCALL_VECTOR 0x80
36
37
38/*
39 * Vectors 0x20-0x2f are used for ISA interrupts.
40 */
41
42/*
43 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
44 *
45 * some of the following vectors are 'rare', they are merged
46 * into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
47 * TLB, reschedule and local APIC vectors are performance-critical.
48 *
49 * Vectors 0xf0-0xf9 are free (reserved for future Linux use).
50 */
51#define SPURIOUS_APIC_VECTOR 0xff
52#define ERROR_APIC_VECTOR 0xfe
53#define INVALIDATE_TLB_VECTOR 0xfd
54#define RESCHEDULE_VECTOR 0xfc
55#define TASK_MIGRATION_VECTOR 0xfb
56#define CALL_FUNCTION_VECTOR 0xfa
57#define KDB_VECTOR 0xf9
58
59#define THERMAL_APIC_VECTOR 0xf0
60
61
62/*
63 * Local APIC timer IRQ vector is on a different priority level,
64 * to work around the 'lost local interrupt if more than 2 IRQ
65 * sources per level' errata.
66 */
67#define LOCAL_TIMER_VECTOR 0xef
68
69/*
70 * First APIC vector available to drivers: (vectors 0x30-0xee)
71 * we start at 0x31 to spread out vectors evenly between priority
72 * levels. (0x80 is the syscall vector)
73 */
74#define FIRST_DEVICE_VECTOR 0x31
75#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in irq.h */
76
77
78#ifndef __ASSEMBLY__
79extern u8 irq_vector[NR_IRQ_VECTORS];
80#define IO_APIC_VECTOR(irq) (irq_vector[irq])
81#define AUTO_ASSIGN -1
82
83/*
84 * Various low-level irq details needed by irq.c, process.c,
85 * time.c, io_apic.c and smp.c
86 *
87 * Interrupt entry/exit code at both C and assembly level
88 */
89
90extern void disable_8259A_irq(unsigned int irq);
91extern void enable_8259A_irq(unsigned int irq);
92extern int i8259A_irq_pending(unsigned int irq);
93extern void make_8259A_irq(unsigned int irq);
94extern void init_8259A(int aeoi);
95extern void FASTCALL(send_IPI_self(int vector));
96extern void init_VISWS_APIC_irqs(void);
97extern void setup_IO_APIC(void);
98extern void disable_IO_APIC(void);
99extern void print_IO_APIC(void);
100extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
101extern void send_IPI(int dest, int vector);
102extern void setup_ioapic_dest(void);
103
104extern unsigned long io_apic_irqs;
105
106extern atomic_t irq_err_count;
107extern atomic_t irq_mis_count;
108
109#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
110
111#define __STR(x) #x
112#define STR(x) __STR(x)
113
114#include <asm/ptrace.h>
115
116#define IRQ_NAME2(nr) nr##_interrupt(void)
117#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
118
119/*
120 * SMP has a few special interrupts for IPI messages
121 */
122
123#define BUILD_IRQ(nr) \
124asmlinkage void IRQ_NAME(nr); \
125__asm__( \
126"\n.p2align\n" \
127"IRQ" #nr "_interrupt:\n\t" \
128 "push $" #nr "-256 ; " \
129 "jmp common_interrupt");
130
131#if defined(CONFIG_X86_IO_APIC)
132static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {
133 if (IO_APIC_IRQ(i))
134 send_IPI_self(IO_APIC_VECTOR(i));
135}
136#else
137static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
138#endif
139
140#define platform_legacy_irq(irq) ((irq) < 16)
141
142#endif
143
144#endif /* _ASM_HW_IRQ_H */