summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/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/pc/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/pc/mmu.c')
-rw-r--r--sys/src/9/pc/mmu.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/src/9/pc/mmu.c b/sys/src/9/pc/mmu.c
index 3ed8229e4..6fbc323af 100644
--- a/sys/src/9/pc/mmu.c
+++ b/sys/src/9/pc/mmu.c
@@ -59,7 +59,6 @@ Segdesc gdt[NGDT] =
[KESEG16] EXEC16SEGM(0), /* kernel code 16-bit */
};
-static int didmmuinit;
static void taskswitch(ulong, ulong);
static void memglobal(void);
@@ -79,8 +78,6 @@ mmuinit(void)
ulong x, *p;
ushort ptr[3];
- didmmuinit = 1;
-
if(0) print("vpt=%#.8ux vpd=%#p kmap=%#.8ux\n",
VPT, vpd, KMAP);
@@ -523,7 +520,7 @@ mmuwalk(ulong* pdb, ulong va, int level, int create)
* memory.c if we haven't set up the xalloc
* tables yet.
*/
- if(didmmuinit)
+ if(conf.mem[0].npage != 0)
map = xspanalloc(BY2PG, BY2PG, 0);
else
map = rampage();