Remove delays / debug output in APIC wakeup
authorJack Miller <jack@codezen.org>
Wed, 23 Mar 2016 02:35:42 +0000 (21:35 -0500)
committerJack Miller <jack@codezen.org>
Fri, 25 Mar 2016 21:59:17 +0000 (16:59 -0500)
This might actually be necessary on real hardware, but since we don't
actually have a udelay() implementation, and it appears to work, strip
it out.

kernel/apic.c

index 22144cb..882bb85 100644 (file)
@@ -117,45 +117,28 @@ static void apic_wake_secondary(u8 apic_id)
                memcpy(realboot, &realmode_bin, REALMODE_BIN_LEN);
                realboot->gdtr_pa = (u64) &GDTR_32;
                unmap_pages(0x2000, 1);
-               mb();
        }
 
        u32 lo = ICRL_MT(MT_INIT) | ICRL_ASSERT | ICRL_TRIGGER_LEVEL;
 
-       printk("Waking %d\n", apic_id);
-
        apic->write_icr(apic_id, lo);
 
        apic->wait();
 
-       printk("INIT asserted\n");
-
        lo = ICRL_MT(MT_INIT) | ICRL_TRIGGER_LEVEL;
 
        apic->write_icr(apic_id, lo);
 
        apic->wait();
 
-       printk("INIT deasserted\n");
-
-       mb();
-       for (int i = 0; i < 100000000; i++)
-
        lo = ICRL_MT(MT_STARTUP) | ICRL_ASSERT | 2;
 
-       printk("lo: 0x%x\n", lo);
-
        apic->write_icr(apic_id, lo);
 
        apic->wait();
 
-       mb();
-       for (int i = 0; i < 100000000; i++)
-
        lo = ICRL_MT(MT_STARTUP) | ICRL_ASSERT | 2;
 
-       printk("lo: 0x%x\n", lo);
-
        apic->write_icr(apic_id, lo);
 
        apic->wait();
@@ -199,9 +182,6 @@ static void xapic_ipi_wait(void)
 
 static void xapic_write_icr(u32 dest, u32 val)
 {
-       printk("ICRH 0x%x\n", ICRH_DEST(dest));
-       printk("ICRL 0x%x\n", val);
-
        apic->write(APIC_ICRH, ICRH_DEST(dest));
        apic->write(APIC_ICRL, val);
 }