|
@@ -396,6 +396,8 @@ void apic_init()
|
|
|
// 初始化中断门, 中断使用rsp0防止在软中断时发生嵌套,然后处理器重新加载导致数据被抹掉
|
|
|
for (int i = 32; i <= 55; ++i)
|
|
|
set_intr_gate(i, 0, interrupt_table[i - 32]);
|
|
|
+
|
|
|
+ /*
|
|
|
// 初始化主芯片
|
|
|
io_out8(0x20, 0x11); // 初始化主芯片的icw1
|
|
|
io_out8(0x21, 0x20); // 设置主芯片的中断向量号为0x20(0x20-0x27)
|
|
@@ -407,13 +409,13 @@ void apic_init()
|
|
|
io_out8(0xa1, 0x28); // 设置从芯片的中断向量号为0x28(0x28-0x2f)
|
|
|
io_out8(0xa1, 0x02); // 设置从芯片连接到主芯片的int2
|
|
|
io_out8(0xa1, 0x01);
|
|
|
-
|
|
|
+ */
|
|
|
// 屏蔽类8259A芯片
|
|
|
io_mfence();
|
|
|
- io_out8(0x21, 0xff);
|
|
|
- io_mfence();
|
|
|
io_out8(0xa1, 0xff);
|
|
|
io_mfence();
|
|
|
+ io_out8(0x21, 0xff);
|
|
|
+ io_mfence();
|
|
|
|
|
|
kdebug("8259A Masked.");
|
|
|
|
|
@@ -449,10 +451,8 @@ void do_IRQ(struct pt_regs *rsp, ul number)
|
|
|
{
|
|
|
|
|
|
if (number < 0x80 && number >= 32) // 以0x80为界限,低于0x80的是外部中断控制器,高于0x80的是Local APIC
|
|
|
-
|
|
|
- // 外部中断控制器
|
|
|
{
|
|
|
-
|
|
|
+ // ==========外部中断控制器========
|
|
|
irq_desc_t *irq = &interrupt_desc[number - 32];
|
|
|
|
|
|
// 执行中断上半部处理程序
|