diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-03-09 08:43:11 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-03-09 08:43:11 +0000 |
commit | 6db42837ce7ac8c7028dc8416a11442775af3c45 (patch) | |
tree | 86e049bea3608c82898e11c82097ff6da0ee19a4 /extras/mini-os | |
parent | e4865c23155b05278f31be537764e760cd2d9b7e (diff) | |
download | xen-6db42837ce7ac8c7028dc8416a11442775af3c45.tar.gz xen-6db42837ce7ac8c7028dc8416a11442775af3c45.tar.bz2 xen-6db42837ce7ac8c7028dc8416a11442775af3c45.zip |
minios: Fix 18874 memory clipping
Fix 18874's memory clipping: there are three page-sized holes between
direct mapping, demand mapping, heap pages and the end of memory.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'extras/mini-os')
-rw-r--r-- | extras/mini-os/arch/x86/mm.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/extras/mini-os/arch/x86/mm.c b/extras/mini-os/arch/x86/mm.c index 6a2cb351f3..fd7af71e01 100644 --- a/extras/mini-os/arch/x86/mm.c +++ b/extras/mini-os/arch/x86/mm.c @@ -778,8 +778,7 @@ void arch_init_p2m(unsigned long max_pfn) void arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p) { - - unsigned long start_pfn, max_pfn, virt_pfns; + unsigned long start_pfn, max_pfn; printk(" _text: %p(VA)\n", &_text); printk(" _etext: %p(VA)\n", &_etext); @@ -794,9 +793,13 @@ void arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p) max_pfn = start_info.nr_pages; /* We need room for demand mapping and heap, clip available memory */ - virt_pfns = DEMAND_MAP_PAGES + HEAP_PAGES; - if ( max_pfn + virt_pfns + 1 < max_pfn ) - max_pfn = -(virt_pfns + 1); +#if defined(__i386__) + { + unsigned long virt_pfns = 1 + DEMAND_MAP_PAGES + 1 + HEAP_PAGES; + if (max_pfn + virt_pfns >= 0x100000) + max_pfn = 0x100000 - virt_pfns - 1; + } +#endif printk(" start_pfn: %lx\n", start_pfn); printk(" max_pfn: %lx\n", max_pfn); |