- 论坛徽章:
- 3
|
我看了中断vector注册到IDT表中的函数,native_init_IRQ()
218 void __init native_init_IRQ(void)
219 {
220 int i;
221
222 /* Execute any quirks before the call gates are initialised: */
223 x86_init.irqs.pre_vector_init();/*初始化ISA相关的irq对应的irq_desc,绑定这些irq_desc和i8259A中断控制器> 以及handle_level_irq流控函数.见init_ISA_irqs*/
224
225 apic_intr_init();/*为smp相关的IPI/THERMAL/MCE等,在IDT表中申请vector,并设置相应的服务程序*/
226
227 /*
228 * Cover the whole vector space, no vector can escape
229 * us. (some of these will be overridden and become
230 * 'special' SMP interrupts)
231 *//*遍历所有外部中断的vector..*/
232 for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) {
233 /* IA32_SYSCALL_VECTOR could be used in trap_init already. */
234 if (!test_bit(i, used_vectors))/*如果没有被使用*/
235 set_intr_gate(i, interrupt[i-FIRST_EXTERNAL_VECTOR]);*/
236 }
...
在这里,外部中断的中断服务程序是通过使用interrupt[]指针数组指向的函数来设置.但我查找了x86的源码,只在arch/x86/include/asm/hw_irq.h
中找到一个这样的一个定义:
extern void (*__initconst interrupt[NR_VECTORS-FIRST_EXTERNAL_VECOTR])(void);
这个interrupt[]函数指针数组是在什么时候初始化的?? 这里引用哪里的函数指针数组? |
|