x86_64: acpi: only mask pit irq line during bsp init
This commit is contained in:
@@ -101,7 +101,7 @@ static struct irq_hook lapic_clock_irq_hook = {
|
||||
lapic_clock_irq,
|
||||
};
|
||||
|
||||
void local_apic_config_timer(void)
|
||||
void local_apic_config_timer(bool bsp)
|
||||
{
|
||||
local_apic& lapic = local_apic::get();
|
||||
|
||||
@@ -110,9 +110,11 @@ void local_apic_config_timer(void)
|
||||
clock_wait(10);
|
||||
lapic.write(local_apic::LVT_TIMER, APIC_LVT_INT_MASKED);
|
||||
|
||||
/* mask IRQ0 to block interrupts from the PIT. */
|
||||
io_apic *irq0_apic = get_ioapic_for_irq(0);
|
||||
irq0_apic->mask_irq(0);
|
||||
if (bsp) {
|
||||
/* mask IRQ0 to block interrupts from the PIT. */
|
||||
io_apic *irq0_apic = get_ioapic_for_irq(0);
|
||||
irq0_apic->mask_irq(0);
|
||||
}
|
||||
|
||||
uint32_t total_ticks = 0xFFFFFFFF - lapic.read(local_apic::TIMER_CURCOUNT);
|
||||
|
||||
@@ -178,7 +180,7 @@ kern_status_t ap_apic_init(void)
|
||||
local_apic_enable(madt);
|
||||
|
||||
//irq_enable();
|
||||
local_apic_config_timer();
|
||||
local_apic_config_timer(false);
|
||||
|
||||
return KERN_OK;
|
||||
}
|
||||
@@ -205,7 +207,7 @@ kern_status_t apic_init(void)
|
||||
|
||||
pit_start(HZ);
|
||||
|
||||
local_apic_config_timer();
|
||||
local_apic_config_timer(true);
|
||||
pit_stop();
|
||||
|
||||
hook_irq(IRQ0, &lapic_clock_irq_hook);
|
||||
|
||||
Reference in New Issue
Block a user