summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-10-02 01:01:34 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2019-10-02 01:01:34 +0200
commitc0f464b98fde437a1c6556006e87662827d77096 (patch)
treea30558a80f9a8810f43c414d762c95a7ee5dbb52
parent0ee738ef8c34d5494265b8a14435333f45b96dc6 (diff)
pc: move low-level allocation details out of mmu.c into memory.c rampage() function
-rw-r--r--sys/src/9/pc/memory.c2
-rw-r--r--sys/src/9/pc/mmu.c12
2 files changed, 4 insertions, 10 deletions
diff --git a/sys/src/9/pc/memory.c b/sys/src/9/pc/memory.c
index fb14d017e..113726648 100644
--- a/sys/src/9/pc/memory.c
+++ b/sys/src/9/pc/memory.c
@@ -224,6 +224,8 @@ rampage(void)
{
ulong m;
+ if(conf.mem[0].npage != 0)
+ return xspanalloc(BY2PG, BY2PG, 0);
m = mapalloc(&rmapram, 0, BY2PG, BY2PG);
if(m == 0)
return nil;
diff --git a/sys/src/9/pc/mmu.c b/sys/src/9/pc/mmu.c
index c76c8962b..383ba7d91 100644
--- a/sys/src/9/pc/mmu.c
+++ b/sys/src/9/pc/mmu.c
@@ -523,17 +523,9 @@ mmuwalk(ulong* pdb, ulong va, int level, int create)
if(*table & PTESIZE)
panic("mmuwalk2: va %luX entry %luX", va, *table);
if(!(*table & PTEVALID)){
- /*
- * Have to call low-level allocator from
- * memory.c if we haven't set up the xalloc
- * tables yet.
- */
- if(conf.mem[0].npage != 0)
- map = xspanalloc(BY2PG, BY2PG, 0);
- else
- map = rampage();
+ map = rampage();
if(map == nil)
- panic("mmuwalk xspanalloc failed");
+ panic("mmuwalk: page alloc failed");
*table = PADDR(map)|PTEWRITE|PTEVALID;
}
table = KADDR(PPN(*table));