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
* 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. */

View 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. */

View 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);