apic: Minor cleanup
authorJack Miller <jack@codezen.org>
Fri, 7 Apr 2017 17:56:05 +0000 (12:56 -0500)
committerJack Miller <jack@codezen.org>
Fri, 12 Apr 2019 17:04:54 +0000 (12:04 -0500)
kernel/apic.c

index d331415..8cc19c5 100644 (file)
@@ -79,13 +79,13 @@ static void apic_wake_secondary(u8 apic_id)
 
     apic->wait();
 
-    lo = ICRL_MT(MT_STARTUP) | ICRL_ASSERT | 2;
+    lo = ICRL_MT(MT_STARTUP) | ICRL_ASSERT | (REALMODE_PA >> PAGE_SHIFT);
 
     apic->write_icr(apic_id, lo);
 
     apic->wait();
 
-    lo = ICRL_MT(MT_STARTUP) | ICRL_ASSERT | 2;
+    lo = ICRL_MT(MT_STARTUP) | ICRL_ASSERT | (REALMODE_PA >> PAGE_SHIFT);
 
     apic->write_icr(apic_id, lo);
 
@@ -120,8 +120,7 @@ static u32 xapic_mmio_read(u32 offset)
 
 static void xapic_ipi_wait(void)
 {
-    while (apic->read(APIC_ICRL) & ICRL_BUSY) {
-    }
+    while (apic->read(APIC_ICRL) & ICRL_BUSY);
 }
 
 static void xapic_write_icr(u32 dest, u32 val)