summaryrefslogtreecommitdiff
path: root/sys/src/9/pc64/mmu.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-10-18 02:01:58 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-10-18 02:01:58 +0200
commit0a6439a1f564de17bfad7a327178e47483a86e1a (patch)
tree7866ca8d37f138ecbbdc4fc8f9afa1376bc7ae44 /sys/src/9/pc64/mmu.c
parent81e0d6e988289c983445f855583496048fb4c61b (diff)
pc, pc64: allow passing RSDT pointer in *acpi= boot parameter, early bootscreeninit(), fix rampage() usage
rampage() cannot be used after meminit(), so test for conf.mem[0].npage != 0 and use xalloc()/mallocalign() instead. this allows us to use vmap() early before mmuinit() which is needed for bootscreeninit() and acpi. to get memory for page tables, pc64 needs a lowraminit(). with EFI, the RSDT pointer is passed in *acpi= parameter from the efi loader. as the RSDT is ususally at the end of the physical address space (and not to be found in bios areas), we cannot KMAP() it so we need to vmap().
Diffstat (limited to 'sys/src/9/pc64/mmu.c')
-rw-r--r--sys/src/9/pc64/mmu.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/src/9/pc64/mmu.c b/sys/src/9/pc64/mmu.c
index f25d485e1..4d896ce4f 100644
--- a/sys/src/9/pc64/mmu.c
+++ b/sys/src/9/pc64/mmu.c
@@ -23,8 +23,6 @@ Segdesc gdt[NGDT] =
[UESEG] EXECSEGM(3), /* user code */
};
-static int didmmuinit = 0;
-
static struct {
Lock;
MMU *free;
@@ -79,8 +77,6 @@ mmuinit(void)
vlong v;
int i;
- didmmuinit = 1;
-
/* zap double map done by l.s */
m->pml4[512] = 0;
m->pml4[0] = 0;
@@ -242,7 +238,7 @@ mmucreate(uintptr *table, uintptr va, int level, int index)
up->kmapcount++;
}
page = p->page;
- } else if(didmmuinit) {
+ } else if(conf.mem[0].npage != 0) {
page = mallocalign(PTSZ, BY2PG, 0, 0);
} else {
page = rampage();