From: Ben Gras Date: Tue, 18 Sep 2012 11:17:45 +0000 (+0200) Subject: VM: some sanitycheck fixes X-Git-Tag: v3.2.1~330 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-keygen.html?a=commitdiff_plain;h=6410f4b5db8dbb474bf74a3765c91bd326625e9f;p=minix.git VM: some sanitycheck fixes minor fixes to restore SANITYCHECKS --- diff --git a/servers/vm/arch/i386/pagetable.c b/servers/vm/arch/i386/pagetable.c index 67a99d2f2..0f0a6401d 100644 --- a/servers/vm/arch/i386/pagetable.c +++ b/servers/vm/arch/i386/pagetable.c @@ -54,7 +54,13 @@ struct vmproc *vmprocess = &vmproc[VM_PROC_NR]; * circular dependency on allocating memory and writing it into VM's * page table. */ +#if SANITYCHECKS +#define SPAREPAGES 100 +#define STATIC_SPAREPAGES 90 +#else #define SPAREPAGES 15 +#define STATIC_SPAREPAGES 10 +#endif int missing_spares = SPAREPAGES; static struct { void *page; @@ -85,9 +91,8 @@ int kernmappings = 0; phys_bytes page_directories_phys; u32_t *page_directories = NULL; -#define STATIC_SPAREPAGES 10 - -static char static_sparepages[I386_PAGE_SIZE*STATIC_SPAREPAGES + I386_PAGE_SIZE] __aligned(I386_PAGE_SIZE); +static char static_sparepages[I386_PAGE_SIZE*STATIC_SPAREPAGES] + __aligned(I386_PAGE_SIZE); #if SANITYCHECKS /*===========================================================================* @@ -1014,7 +1019,6 @@ void pt_init(void) /* Inform kernel vm has a newly built page table. */ assert(vmproc[VM_PROC_NR].vm_endpoint == VM_PROC_NR); - pt_mapkernel(newpt); pt_bind(newpt, &vmproc[VM_PROC_NR]); /* All OK. */ diff --git a/servers/vm/main.c b/servers/vm/main.c index 6f5b2781f..7eb00c74c 100644 --- a/servers/vm/main.c +++ b/servers/vm/main.c @@ -317,8 +317,6 @@ void init_vm(void) #if SANITYCHECKS env_parse("vm_sanitychecklevel", "d", 0, &vm_sanitychecklevel, 0, SCL_MAX); - - vm_sanitychecklevel = 1; #endif /* Get chunks of available memory. */ diff --git a/servers/vm/region.c b/servers/vm/region.c index 857b498db..c3827ae13 100644 --- a/servers/vm/region.c +++ b/servers/vm/region.c @@ -269,7 +269,7 @@ void map_sanitycheck(char *file, int line) if(pr->ph->refcount != pr->ph->seencount) { map_printmap(vmp); printf("ph in vr %p: 0x%lx-0x%lx refcount %d " - "but seencount %lu\n", + "but seencount %u\n", vr, pr->offset, pr->offset + pr->ph->length, pr->ph->refcount, pr->ph->seencount);