Round memory size up for VM.
This commit is contained in:
parent
b5e6319ae7
commit
77f5b40141
1 changed files with 4 additions and 0 deletions
|
@ -442,6 +442,7 @@ struct mem_map *map_ptr; /* memory to remove */
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PAGE_SIZE 4096
|
#define PAGE_SIZE 4096
|
||||||
|
#define PAGE_DIR_SIZE (1024*PAGE_SIZE)
|
||||||
#define PAGE_TABLE_COVER (1024*PAGE_SIZE)
|
#define PAGE_TABLE_COVER (1024*PAGE_SIZE)
|
||||||
/*=========================================================================*
|
/*=========================================================================*
|
||||||
* do_x86_vm *
|
* do_x86_vm *
|
||||||
|
@ -468,6 +469,9 @@ struct memory mem_chunks[NR_MEMS];
|
||||||
#if VERBOSE_VM
|
#if VERBOSE_VM
|
||||||
printf("do_x86_vm: found high 0x%x\n", high);
|
printf("do_x86_vm: found high 0x%x\n", high);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Rounding up */
|
||||||
|
high= (high-1+PAGE_DIR_SIZE) & ~(PAGE_DIR_SIZE-1);
|
||||||
|
|
||||||
/* The number of pages we need is one for the page directory, enough
|
/* The number of pages we need is one for the page directory, enough
|
||||||
* page tables to cover the memory, and one page for alignement.
|
* page tables to cover the memory, and one page for alignement.
|
||||||
|
|
Loading…
Reference in a new issue