From: Philip Homburg Date: Mon, 23 Apr 2007 14:38:55 +0000 (+0000) Subject: Round memory size up for VM. X-Git-Tag: v3.1.4~409 X-Git-Url: http://zhaoyanbai.com/repos/dnssec-keygen.html?a=commitdiff_plain;h=77f5b4014173a90006dfea037f9a7436068413d4;p=minix.git Round memory size up for VM. --- diff --git a/servers/pm/main.c b/servers/pm/main.c index aba8fe67a..0c2df15ab 100644 --- a/servers/pm/main.c +++ b/servers/pm/main.c @@ -442,6 +442,7 @@ struct mem_map *map_ptr; /* memory to remove */ } #define PAGE_SIZE 4096 +#define PAGE_DIR_SIZE (1024*PAGE_SIZE) #define PAGE_TABLE_COVER (1024*PAGE_SIZE) /*=========================================================================* * do_x86_vm * @@ -468,6 +469,9 @@ struct memory mem_chunks[NR_MEMS]; #if VERBOSE_VM printf("do_x86_vm: found high 0x%x\n", high); #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 * page tables to cover the memory, and one page for alignement.