VM: some sanitycheck fixes

minor fixes to restore SANITYCHECKS
This commit is contained in:
Ben Gras 2012-09-18 13:17:45 +02:00
parent d3d8c30c2e
commit 6410f4b5db
3 changed files with 9 additions and 7 deletions

View file

@ -54,7 +54,13 @@ struct vmproc *vmprocess = &vmproc[VM_PROC_NR];
* circular dependency on allocating memory and writing it into VM's * circular dependency on allocating memory and writing it into VM's
* page table. * page table.
*/ */
#if SANITYCHECKS
#define SPAREPAGES 100
#define STATIC_SPAREPAGES 90
#else
#define SPAREPAGES 15 #define SPAREPAGES 15
#define STATIC_SPAREPAGES 10
#endif
int missing_spares = SPAREPAGES; int missing_spares = SPAREPAGES;
static struct { static struct {
void *page; void *page;
@ -85,9 +91,8 @@ int kernmappings = 0;
phys_bytes page_directories_phys; phys_bytes page_directories_phys;
u32_t *page_directories = NULL; u32_t *page_directories = NULL;
#define STATIC_SPAREPAGES 10 static char static_sparepages[I386_PAGE_SIZE*STATIC_SPAREPAGES]
__aligned(I386_PAGE_SIZE);
static char static_sparepages[I386_PAGE_SIZE*STATIC_SPAREPAGES + I386_PAGE_SIZE] __aligned(I386_PAGE_SIZE);
#if SANITYCHECKS #if SANITYCHECKS
/*===========================================================================* /*===========================================================================*
@ -1014,7 +1019,6 @@ void pt_init(void)
/* Inform kernel vm has a newly built page table. */ /* Inform kernel vm has a newly built page table. */
assert(vmproc[VM_PROC_NR].vm_endpoint == VM_PROC_NR); assert(vmproc[VM_PROC_NR].vm_endpoint == VM_PROC_NR);
pt_mapkernel(newpt);
pt_bind(newpt, &vmproc[VM_PROC_NR]); pt_bind(newpt, &vmproc[VM_PROC_NR]);
/* All OK. */ /* All OK. */

View file

@ -317,8 +317,6 @@ void init_vm(void)
#if SANITYCHECKS #if SANITYCHECKS
env_parse("vm_sanitychecklevel", "d", 0, &vm_sanitychecklevel, 0, SCL_MAX); env_parse("vm_sanitychecklevel", "d", 0, &vm_sanitychecklevel, 0, SCL_MAX);
vm_sanitychecklevel = 1;
#endif #endif
/* Get chunks of available memory. */ /* Get chunks of available memory. */

View file

@ -269,7 +269,7 @@ void map_sanitycheck(char *file, int line)
if(pr->ph->refcount != pr->ph->seencount) { if(pr->ph->refcount != pr->ph->seencount) {
map_printmap(vmp); map_printmap(vmp);
printf("ph in vr %p: 0x%lx-0x%lx refcount %d " printf("ph in vr %p: 0x%lx-0x%lx refcount %d "
"but seencount %lu\n", "but seencount %u\n",
vr, pr->offset, vr, pr->offset,
pr->offset + pr->ph->length, pr->offset + pr->ph->length,
pr->ph->refcount, pr->ph->seencount); pr->ph->refcount, pr->ph->seencount);