]> Zhao Yanbai Git Server - minix.git/commitdiff
VM: some sanitycheck fixes
authorBen Gras <ben@minix3.org>
Tue, 18 Sep 2012 11:17:45 +0000 (13:17 +0200)
committerBen Gras <ben@minix3.org>
Tue, 18 Sep 2012 11:17:45 +0000 (13:17 +0200)
minor fixes to restore SANITYCHECKS

servers/vm/arch/i386/pagetable.c
servers/vm/main.c
servers/vm/region.c

index 67a99d2f2e975a7baff74207b6db4c5518170459..0f0a6401dcefb7115bdf73dfa18dc42d1ccc0f0b 100644 (file)
@@ -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. */
index 6f5b2781ff46a286b7dcee3334ccd01cce66611b..7eb00c74c50dc525a2e8e364c4387951ea699de8 100644 (file)
@@ -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. */
index 857b498db70f6974d0b70188788b07e6828a074b..c3827ae138547573917076f3662571fc4ccc52bb 100644 (file)
@@ -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);