X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fum%2Fkernel%2Fmem.c;h=44e41a35f000cd667c737d856d1f48af0f6bf200;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=61280167c560dd63411c105663f93519b5818817;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 61280167c..44e41a35f 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -24,6 +24,8 @@ #include "init.h" #include "kern_constants.h" +extern char __binary_start; + /* Changed during early boot */ unsigned long *empty_zero_page = NULL; unsigned long *empty_bad_page = NULL; @@ -63,6 +65,8 @@ static void setup_highmem(unsigned long highmem_start, void mem_init(void) { + unsigned long start; + max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT; /* clear the zero-page */ @@ -77,6 +81,13 @@ void mem_init(void) free_bootmem(__pa(brk_end), uml_reserved - brk_end); uml_reserved = brk_end; + /* Fill in any hole at the start of the binary */ + start = (unsigned long) &__binary_start & PAGE_MASK; + if(uml_physmem != start){ + map_memory(uml_physmem, __pa(uml_physmem), start - uml_physmem, + 1, 1, 0); + } + /* this will put all low memory onto the freelists */ totalram_pages = free_all_bootmem(); totalhigh_pages = highmem >> PAGE_SHIFT;