void __init native_init_IRQ(void) { int i; /* Execute any quirks before the call gates are initialised: */ x86_init.irqs.pre_vector_init(); apic_intr_init(); /* * Cover the whole vector space, no vector can escape * us. (some of these will be overridden and become * 'special' SMP interrupts) */ for (i = FIRST_EXTERNAL_VECTOR; i < NR_VECTORS; i++) { /* IA32_SYSCALL_VECTOR could be used in trap_init already. */ if (!test_bit(i, used_vectors)) set_intr_gate(i, interrupt[i-FIRST_EXTERNAL_VECTOR]); } if (!acpi_ioapic && !of_ioapic) setup_irq(2, &irq2); #ifdef CONFIG_X86_32 /* * External FPU? Set up irq13 if so, for * original braindamaged IBM FERR coupling. */ if (boot_cpu_data.hard_math && !cpu_has_fpu) setup_irq(FPU_IRQ, &fpu_irq); irq_ctx_init(smp_processor_id()); #endif }
void __init native_init_IRQ(void) { int i; /* Execute any quirks before the call gates are initialised: */ /* 这里又是执行x86_init结构中的初始化函数,pre_vector_init()指向 init_ISA_irqs */ x86_init.irqs.pre_vector_init(); /* 初始化中断描述符表中的中断控制器中特定的一些中断门初始化 */ apic_intr_init(); /* * Cover the whole vector space, no vector can escape * us. (some of these will be overridden and become * 'special' SMP interrupts) */ /* 第一个外部中断,默认是32 */ i = FIRST_EXTERNAL_VECTOR; /* 在used_vectors变量中找出所有没有置位的中断向量,我们知道,在trap_init()中对所有异常和陷阱和系统调用中断都置位了used_vectors,没有置位的都为中断 * 这里就是对所有中断设置门描述符 */ for_each_clear_bit_from(i, used_vectors, NR_VECTORS) { /* IA32_SYSCALL_VECTOR could be used in trap_init already. */ /* interrupt[]数组保存的是外部中断的中断门信息 * 这里就是将空闲的中断设置为外部中断,interrupt是一个函数指针数组,其将31~255数组元素指向common_interrupt函数 */ set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]); }
/** * intr_init_hook - post gate setup interrupt initialisation * * Description: * Fill in any interrupts that may have been left out by the general * init_IRQ() routine. interrupts having to do with the machine rather * than the devices on the I/O bus (like APIC interrupts in intel MP * systems) are started here. **/ void __init intr_init_hook(void) { #ifdef CONFIG_X86_LOCAL_APIC apic_intr_init(); #endif if (!acpi_ioapic) setup_irq(2, &irq2); }
/** * intr_init_hook - post gate setup interrupt initialisation * * Description: * Fill in any interrupts that may have been left out by the general * init_IRQ() routine. interrupts having to do with the machine rather * than the devices on the I/O bus (like APIC interrupts in intel MP * systems) are started here. **/ void __init intr_init_hook(void) { if (x86_quirks->arch_intr_init) { if (x86_quirks->arch_intr_init()) return; } #ifdef CONFIG_X86_LOCAL_APIC apic_intr_init(); #endif if (!acpi_ioapic) setup_irq(2, &irq2); }
void __init native_init_IRQ(void) { int i; /* Execute any quirks before the call gates are initialised: */ x86_init.irqs.pre_vector_init(); apic_intr_init(); /* * Cover the whole vector space, no vector can escape * us. (some of these will be overridden and become * 'special' SMP interrupts) */ i = FIRST_EXTERNAL_VECTOR; for_each_clear_bit_from(i, used_vectors, NR_VECTORS) { /* IA32_SYSCALL_VECTOR could be used in trap_init already. */ set_intr_gate(i, interrupt[i - FIRST_EXTERNAL_VECTOR]); }
void __init native_init_IRQ(void) { int i; init_ISA_irqs(); /* * Cover the whole vector space, no vector can escape * us. (some of these will be overridden and become * 'special' SMP interrupts) */ for (i = 0; i < (NR_VECTORS - FIRST_EXTERNAL_VECTOR); i++) { int vector = FIRST_EXTERNAL_VECTOR + i; if (vector != IA32_SYSCALL_VECTOR) set_intr_gate(vector, interrupt[i]); } apic_intr_init(); if (!acpi_ioapic) setup_irq(2, &irq2); }
void __init native_init_IRQ(void) { int i; /* Execute any quirks before the call gates are initialised: */ x86_init.irqs.pre_vector_init(); apic_intr_init(); /* * Cover the whole vector space, no vector can escape * us. (some of these will be overridden and become * 'special' SMP interrupts) */ i = FIRST_EXTERNAL_VECTOR; #ifndef CONFIG_X86_LOCAL_APIC #define first_system_vector NR_VECTORS #endif for_each_clear_bit_from(i, used_vectors, first_system_vector) { /* IA32_SYSCALL_VECTOR could be used in trap_init already. */ set_intr_gate(i, irq_entries_start + 8 * (i - FIRST_EXTERNAL_VECTOR)); }