init_IRQ() の続き
init_IRQ() を追いかけるの続き。これ系のエントリは早目にカテゴリでまとめた方が良さげ。
続ける前にプロセス起動時の irq_desc 配列の状態を以下に。
メンバ名 | データ型 | 状態 |
handler | hw_irq_controller * | &no_irq_type |
handler_data | void * | NULL |
action | struct irqaction * | NULL |
status | unsigned int | IRQ_DISABLED (2) |
depth | unsigned int | 0 |
irq_count | unsigned int | 0 |
irqs_unhandled | unsigned int | 0 |
lock | spinlock_t | SPIN_LOCK_UNLOCKED |
for (i = 0; i < NR_IRQS; i++) { irq_desc[i].status = IRQ_DISABLED; irq_desc[i].action = NULL; irq_desc[i].depth = 1; if (i < 16) { /* * 16 old-style INTA-cycle interrupts: */ irq_desc[i].handler = &i8259A_irq_type; } else { /* * 'high' PCI IRQs filled in on demand */ irq_desc[i].handler = &no_irq_type; } }
上記処理を経て、以下の状態になると考えられる。
メンバ名 | データ型 | 状態 |
handler | hw_irq_controller * | &i8259A_irq_type (i < 16) &no_irq_type (i >= 16) |
handler_data | void * | NULL |
action | struct irqaction * | NULL |
status | unsigned int | IRQ_DISABLED (2) |
depth | unsigned int | 1 |
irq_count | unsigned int | 0 |
irqs_unhandled | unsigned int | 0 |
lock | spinlock_t | SPIN_LOCK_UNLOCKED |
# どうせ、デバイス初期化時に何かで置きかえられるハズ、なだけに。
i8259A_irq_type は arch/i386/kernel/i8259.c にて定義。
static struct hw_interrupt_type i8259A_irq_type = { .typename = "XT-PIC", .startup = startup_8259A_irq, .shutdown = shutdown_8259A_irq, .enable = enable_8259A_irq, .disable = disable_8259A_irq, .ack = mask_and_ack_8259A, .end = end_8259A_irq, };
上記関数も arch/i386/kernel/i8259.c にて定義されているが、内容については別途トレース。init_ISA_irqs()#arch/i386/kernel/i8259.c から呼ばれている init_bsp_APIC() については APIC な部分のトレースに着手するまで保留。次は上記関数と init_8259A() について調べてみたい。