ia64/xen-unstable

view xen/include/asm-x86/irq.h @ 1589:9eda3ea2b4a0

bitkeeper revision 1.1019 (40de8639yjRdZbQS_JrcVsHsaPIwZw)

smp.h, irq.h, config.h, sched_bvt.c, setup.c, pci-pc.c:
Fix compile errors for latest GCC (3.4.0).
author kaf24@scramble.cl.cam.ac.uk
date Sun Jun 27 08:32:57 2004 +0000 (2004-06-27)
parents 31d1b1eaf5b5
children 138e97a36173 1c1155a226ec 53a47b057466 d7fd2dca5e0a 0e23f01219c6
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>
9 extern void disable_irq(unsigned int);
10 extern void disable_irq_nosync(unsigned int);
11 extern void enable_irq(unsigned int);
13 /*
14 * IDT vectors usable for external interrupt sources start
15 * at 0x20:
16 */
17 #define FIRST_EXTERNAL_VECTOR 0x30
19 #define NR_IRQS (256 - FIRST_EXTERNAL_VECTOR)
21 #define HYPERCALL_VECTOR 0x82
23 /*
24 * Vectors 0x30-0x3f are used for ISA interrupts.
25 */
27 /*
28 * Special IRQ vectors used by the SMP architecture, 0xf0-0xff
29 */
30 #define SPURIOUS_APIC_VECTOR 0xff
31 #define ERROR_APIC_VECTOR 0xfe
32 #define INVALIDATE_TLB_VECTOR 0xfd
33 #define EVENT_CHECK_VECTOR 0xfc
34 #define CALL_FUNCTION_VECTOR 0xfb
35 #define KDB_VECTOR 0xfa
37 /*
38 * Local APIC timer IRQ vector is on a different priority level,
39 * to work around the 'lost local interrupt if more than 2 IRQ
40 * sources per level' errata.
41 */
42 #define LOCAL_TIMER_VECTOR 0xef
44 /*
45 * First APIC vector available to drivers: (vectors 0x40-0xee)
46 * we start at 0x41 to spread out vectors evenly between priority
47 * levels. (0x82 is the hypercall vector)
48 */
49 #define FIRST_DEVICE_VECTOR 0x41
50 #define FIRST_SYSTEM_VECTOR 0xef
52 extern int irq_vector[NR_IRQS];
53 #define IO_APIC_VECTOR(irq) irq_vector[irq]
55 /*
56 * Various low-level irq details needed by irq.c, process.c,
57 * time.c, io_apic.c and smp.c
58 *
59 * Interrupt entry/exit code at both C and assembly level
60 */
62 extern void mask_irq(unsigned int irq);
63 extern void unmask_irq(unsigned int irq);
64 extern void disable_8259A_irq(unsigned int irq);
65 extern void enable_8259A_irq(unsigned int irq);
66 extern int i8259A_irq_pending(unsigned int irq);
67 extern void make_8259A_irq(unsigned int irq);
68 extern void init_8259A(int aeoi);
69 extern void send_IPI_self(int vector);
70 extern void init_VISWS_APIC_irqs(void);
71 extern void setup_IO_APIC(void);
72 extern void disable_IO_APIC(void);
73 extern void print_IO_APIC(void);
74 extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
75 extern void send_IPI(int dest, int vector);
77 extern unsigned long io_apic_irqs;
79 extern atomic_t irq_err_count;
80 extern atomic_t irq_mis_count;
82 extern char _stext, _etext;
84 #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
86 #define __STR(x) #x
87 #define STR(x) __STR(x)
89 #define SAVE_ALL \
90 "cld\n\t" \
91 "pushl %gs\n\t" \
92 "pushl %fs\n\t" \
93 "pushl %es\n\t" \
94 "pushl %ds\n\t" \
95 "pushl %eax\n\t" \
96 "pushl %ebp\n\t" \
97 "pushl %edi\n\t" \
98 "pushl %esi\n\t" \
99 "pushl %edx\n\t" \
100 "pushl %ecx\n\t" \
101 "pushl %ebx\n\t" \
102 "movl $" STR(__HYPERVISOR_DS) ",%edx\n\t" \
103 "movl %edx,%ds\n\t" \
104 "movl %edx,%es\n\t" \
105 "movl %edx,%fs\n\t" \
106 "movl %edx,%gs\n\t"
108 #define IRQ_NAME2(nr) nr##_interrupt(void)
109 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
111 #define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
112 #define XBUILD_SMP_INTERRUPT(x,v)\
113 asmlinkage void x(void); \
114 asmlinkage void call_##x(void); \
115 __asm__( \
116 "\n"__ALIGN_STR"\n" \
117 SYMBOL_NAME_STR(x) ":\n\t" \
118 "pushl $"#v"\n\t" \
119 SAVE_ALL \
120 SYMBOL_NAME_STR(call_##x)":\n\t" \
121 "call "SYMBOL_NAME_STR(smp_##x)"\n\t" \
122 "jmp ret_from_intr\n");
124 #define BUILD_SMP_TIMER_INTERRUPT(x,v) XBUILD_SMP_TIMER_INTERRUPT(x,v)
125 #define XBUILD_SMP_TIMER_INTERRUPT(x,v) \
126 asmlinkage void x(struct pt_regs * regs); \
127 asmlinkage void call_##x(void); \
128 __asm__( \
129 "\n"__ALIGN_STR"\n" \
130 SYMBOL_NAME_STR(x) ":\n\t" \
131 "pushl $"#v"\n\t" \
132 SAVE_ALL \
133 "movl %esp,%eax\n\t" \
134 "pushl %eax\n\t" \
135 SYMBOL_NAME_STR(call_##x)":\n\t" \
136 "call "SYMBOL_NAME_STR(smp_##x)"\n\t" \
137 "addl $4,%esp\n\t" \
138 "jmp ret_from_intr\n");
140 #define BUILD_COMMON_IRQ() \
141 asmlinkage void call_do_IRQ(void); \
142 __asm__( \
143 "\n" __ALIGN_STR"\n" \
144 "common_interrupt:\n\t" \
145 SAVE_ALL \
146 SYMBOL_NAME_STR(call_do_IRQ)":\n\t" \
147 "call " SYMBOL_NAME_STR(do_IRQ) "\n\t" \
148 "jmp ret_from_intr\n");
150 #define BUILD_IRQ(nr) \
151 asmlinkage void IRQ_NAME(nr); \
152 __asm__( \
153 "\n"__ALIGN_STR"\n" \
154 SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
155 "pushl $"#nr"\n\t" \
156 "jmp common_interrupt");
158 extern unsigned long prof_cpu_mask;
159 extern unsigned int *prof_buffer;
160 extern unsigned long prof_len;
161 extern unsigned long prof_shift;
163 #include <xen/irq.h>
165 static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
166 {
167 #if defined(CONFIG_X86_IO_APIC)
168 if (IO_APIC_IRQ(i))
169 send_IPI_self(IO_APIC_VECTOR(i));
170 #endif
171 }
173 #endif /* _ASM_HW_IRQ_H */