1 Fix mem=XXX kernel parameter when user gives a size bigger than what
2 kernel autodetected (kill a previous change)
3 Author: Adrian Bunk <bunk@fs.tum.de>,
4 Leonardo Gomes Figueira <sabbath@planetarium.com.br>
6 --- linux/arch/i386/kernel/setup.c.original Mon Jul 22 21:44:45 2002
7 +++ linux/arch/i386/kernel/setup.c Tue Jul 23 03:38:08 2002
11 /* If the user specifies memory size, we
12 - * limit the BIOS-provided memory map to
13 - * that size. exactmap can be used to specify
14 - * the exact map. mem=number can be used to
15 - * trim the existing memory map.
16 + * blow away any automatically generated
19 unsigned long long start_at, mem_size;
22 + /* first time in: zap the whitelist
23 + * and reinitialize it with the
24 + * standard low-memory region.
28 + add_memory_region(0, LOWMEMSIZE(), E820_RAM);
30 mem_size = memparse(from+4, &from);
33 start_at = memparse(from+1, &from);
34 - add_memory_region(start_at, mem_size, E820_RAM);
36 - limit_regions(mem_size);
38 + start_at = HIGH_MEMORY;
39 + mem_size -= HIGH_MEMORY;
42 + add_memory_region(start_at, mem_size, E820_RAM);