changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: pc: move low-level allocation details out of mmu.c into memory.c rampage() function

changeset 7404: 6e0c926efd3b
parent 7403: c308afa89cfc
child 7405: 82225c0fc1a2
author: cinap_lenrek@felloff.net
date: Wed, 02 Oct 2019 01:01:34 +0200
files: sys/src/9/pc/memory.c sys/src/9/pc/mmu.c
description: pc: move low-level allocation details out of mmu.c into memory.c rampage() function
     1.1--- a/sys/src/9/pc/memory.c
     1.2+++ b/sys/src/9/pc/memory.c
     1.3@@ -224,6 +224,8 @@ rampage(void)
     1.4 {
     1.5 	ulong m;
     1.6 	
     1.7+	if(conf.mem[0].npage != 0)
     1.8+		return xspanalloc(BY2PG, BY2PG, 0);
     1.9 	m = mapalloc(&rmapram, 0, BY2PG, BY2PG);
    1.10 	if(m == 0)
    1.11 		return nil;
     2.1--- a/sys/src/9/pc/mmu.c
     2.2+++ b/sys/src/9/pc/mmu.c
     2.3@@ -523,17 +523,9 @@ mmuwalk(ulong* pdb, ulong va, int level,
     2.4 		if(*table & PTESIZE)
     2.5 			panic("mmuwalk2: va %luX entry %luX", va, *table);
     2.6 		if(!(*table & PTEVALID)){
     2.7-			/*
     2.8-			 * Have to call low-level allocator from
     2.9-			 * memory.c if we haven't set up the xalloc
    2.10-			 * tables yet.
    2.11-			 */
    2.12-			if(conf.mem[0].npage != 0)
    2.13-				map = xspanalloc(BY2PG, BY2PG, 0);
    2.14-			else
    2.15-				map = rampage();
    2.16+			map = rampage();
    2.17 			if(map == nil)
    2.18-				panic("mmuwalk xspanalloc failed");
    2.19+				panic("mmuwalk: page alloc failed");
    2.20 			*table = PADDR(map)|PTEWRITE|PTEVALID;
    2.21 		}
    2.22 		table = KADDR(PPN(*table));