Use vmap_pmem
authorRonald G. Minnich <rminnich@google.com>
Tue, 4 Mar 2014 00:34:33 +0000 (16:34 -0800)
committerRonald G. Minnich <rminnich@google.com>
Tue, 4 Mar 2014 00:34:33 +0000 (16:34 -0800)
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
kern/arch/x86/apic9.c
kern/arch/x86/ioapic.c
kern/arch/x86/mpacpi.c

index a107194..c444b93 100644 (file)
@@ -138,7 +138,7 @@ apicinit(int apicno, uintptr_t pa, int isbp)
                return;
        }
        if(apicbase == NULL){
-               if((apicbase = KADDR(pa)) == NULL){
+               if((apicbase = vmap_pmem(pa, 1024)) == NULL){
                        printd("apicinit%d: can't map apicbase\n", apicno);
                        return;
                }
index 2284925..44a65b3 100644 (file)
@@ -210,7 +210,7 @@ ioapicinit(int id, int ibase, uintptr_t pa)
                return;
 
        apic = &xioapic[id];
-       if(apic->useable || (apic->addr = KADDR(pa)/*vmap(pa, 1024)*/) == NULL)
+       if(apic->useable || (apic->addr = vmap_pmem(pa, 1024)) == NULL)
                return;
        apic->useable = 1;
        apic->paddr = pa;
index dc24828..cb3b4e3 100644 (file)
@@ -26,6 +26,7 @@ mpacpi(int ncleft)
        struct apic *apic;
        struct Apicst *st;
 
+       printk("mpacpi ncleft %d\n", ncleft);
        if (apics == NULL)
                return ncleft;
 
@@ -54,6 +55,7 @@ mpacpi(int ncleft)
                                already = "(off)";
 
                        printd("apic proc %d/%d apicid %d %s\n", np-1, apic->machno, st->lapic.id, already);
+monitor(NULL);
                        break;
                case ASioapic:
                        printd("ASioapic %d\n", st->ioapic.id);
@@ -67,6 +69,7 @@ mpacpi(int ncleft)
                        }
                        printk("ioapicinit(%d, %p, %p);\n", st->lapic.id, apics->lapicpa, st->ioapic.addr);
                        ioapicinit(st->ioapic.id, st->ioapic.ibase, st->ioapic.addr);
+monitor(NULL);
                pr1:
                        printd("ioapic %d ", st->ioapic.id);
                        printd("addr %p base %d %s\n", apic->paddr, apic->ibase, already);