debuggers.hg

view xen/include/asm-x86/irq.h @ 3545:6b76ae4b9ea7

bitkeeper revision 1.1159.212.30 (41f5268cMEdHLMEMs4o0SWqVEHZvuw)

Minor cleanup. Removed some duplicate MSRs, fixed some MSR names,
added a few new MSRs and MSR bit fields.
Signed-off-by: michael.fetterman@cl.cam.ac.uk
author mafetter@fleming.research
date Mon Jan 24 16:47:08 2005 +0000 (2005-01-24)
parents dda5ab69e74a
children d8ba911dce48 bf2c38625b39
line source
1 #ifndef _ASM_HW_IRQ_H
2 #define _ASM_HW_IRQ_H
4 /* (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar */
6 #include <xen/config.h>
7 #include <asm/atomic.h>
8 #include <asm/asm_defns.h>
10 extern void disable_irq(unsigned int);
11 extern void disable_irq_nosync(unsigned int);
12 extern void enable_irq(unsigned int);
14 /*
15 * IDT vectors usable for external interrupt sources start
16 * at 0x20:
17 */
18 #define FIRST_EXTERNAL_VECTOR 0x30
20 #define NR_IRQS (256 - FIRST_EXTERNAL_VECTOR)
22 #define HYPERCALL_VECTOR 0x82
24 /*
25 * Vectors 0x30-0x3f are used for ISA interrupts.
26 */
28 /*
29 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
30 */
31 #define SPURIOUS_APIC_VECTOR 0xff
32 #define ERROR_APIC_VECTOR 0xfe
33 #define INVALIDATE_TLB_VECTOR 0xfd
34 #define EVENT_CHECK_VECTOR 0xfc
35 #define CALL_FUNCTION_VECTOR 0xfb
36 #define KDB_VECTOR 0xfa
38 /*
39 * Local APIC timer IRQ vector is on a different priority level,
40 * to work around the 'lost local interrupt if more than 2 IRQ
41 * sources per level' errata.
42 */
43 #define LOCAL_TIMER_VECTOR 0xef
45 /*
46 * First APIC vector available to drivers: (vectors 0x40-0xee)
47 * we start at 0x41 to spread out vectors evenly between priority
48 * levels. (0x82 is the hypercall vector)
49 */
50 #define FIRST_DEVICE_VECTOR 0x41
51 #define FIRST_SYSTEM_VECTOR 0xef
53 extern int irq_vector[NR_IRQS];
54 #define IO_APIC_VECTOR(irq) irq_vector[irq]
56 /*
57 * Various low-level irq details needed by irq.c, process.c,
58 * time.c, io_apic.c and smp.c
59 *
60 * Interrupt entry/exit code at both C and assembly level
61 */
63 extern void mask_irq(unsigned int irq);
64 extern void unmask_irq(unsigned int irq);
65 extern void disable_8259A_irq(unsigned int irq);
66 extern void enable_8259A_irq(unsigned int irq);
67 extern int i8259A_irq_pending(unsigned int irq);
68 extern void make_8259A_irq(unsigned int irq);
69 extern void init_8259A(int aeoi);
70 extern void send_IPI_self(int vector);
71 extern void init_VISWS_APIC_irqs(void);
72 extern void setup_IO_APIC(void);
73 extern void disable_IO_APIC(void);
74 extern void print_IO_APIC(void);
75 extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
76 extern void send_IPI(int dest, int vector);
78 extern unsigned long io_apic_irqs;
80 extern atomic_t irq_err_count;
81 extern atomic_t irq_mis_count;
83 extern char _stext, _etext;
85 #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
87 #define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
88 #define XBUILD_SMP_INTERRUPT(x,v)\
89 asmlinkage void x(void); \
90 asmlinkage void call_##x(void); \
91 __asm__( \
92 "\n"__ALIGN_STR"\n" \
93 SYMBOL_NAME_STR(x) ":\n\t" \
94 "push"__OS" $"#v"<<16\n\t" \
95 SAVE_ALL(a) \
96 SYMBOL_NAME_STR(call_##x)":\n\t" \
97 "call "SYMBOL_NAME_STR(smp_##x)"\n\t" \
98 "jmp ret_from_intr\n");
100 #define BUILD_SMP_TIMER_INTERRUPT(x,v) XBUILD_SMP_TIMER_INTERRUPT(x,v)
101 #define XBUILD_SMP_TIMER_INTERRUPT(x,v) \
102 asmlinkage void x(struct xen_regs * regs); \
103 asmlinkage void call_##x(void); \
104 __asm__( \
105 "\n"__ALIGN_STR"\n" \
106 SYMBOL_NAME_STR(x) ":\n\t" \
107 "push"__OS" $"#v"<<16\n\t" \
108 SAVE_ALL(a) \
109 "mov %"__OP"sp,%"__OP"ax\n\t" \
110 "push %"__OP"ax\n\t" \
111 SYMBOL_NAME_STR(call_##x)":\n\t" \
112 "call "SYMBOL_NAME_STR(smp_##x)"\n\t" \
113 "add $4,%"__OP"sp\n\t" \
114 "jmp ret_from_intr\n");
116 #define BUILD_COMMON_IRQ() \
117 asmlinkage void call_do_IRQ(void); \
118 __asm__( \
119 "\n" __ALIGN_STR"\n" \
120 "common_interrupt:\n\t" \
121 SAVE_ALL(a) \
122 SYMBOL_NAME_STR(call_do_IRQ)":\n\t" \
123 "call " SYMBOL_NAME_STR(do_IRQ) "\n\t" \
124 "jmp ret_from_intr\n");
126 #define IRQ_NAME2(nr) nr##_interrupt(void)
127 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
129 #define BUILD_IRQ(nr) \
130 asmlinkage void IRQ_NAME(nr); \
131 __asm__( \
132 "\n"__ALIGN_STR"\n" \
133 SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
134 "push"__OS" $"#nr"<<16\n\t" \
135 "jmp common_interrupt");
137 #include <xen/irq.h>
139 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
140 {
141 #if defined(CONFIG_X86_IO_APIC)
142 if (IO_APIC_IRQ(i))
143 send_IPI_self(IO_APIC_VECTOR(i));
144 #endif
145 }
147 #endif /* _ASM_HW_IRQ_H */