--- linux.rs6000/arch/ppc/mm/init.c.~1~ Tue Dec 21 15:40:03 1999 +++ linux.rs6000/arch/ppc/mm/init.c Tue Dec 21 16:05:16 1999 @@ -1299,6 +1299,26 @@ } #endif /* CONFIG_MBX */ #ifndef CONFIG_8xx +static void __init apply_ram_limit(struct mem_pieces * mp) +{ + int i; + + for (i = 0; i < mp->n_regions; i++) + { + if (mp->regions[i].address >= __max_memory) + { + mp->n_regions = i; + break; + } + if (mp->regions[i].address+mp->regions[i].size > __max_memory) + { + mp->regions[i].size = __max_memory - mp->regions[i].address; + mp->n_regions = i+1; + break; + } + } +} + /* * On systems with Open Firmware, collect information about * physical RAM and which pieces are already in use. @@ -1364,6 +1384,7 @@ if (boot_infos == 0) { /* record which bits the prom is using */ get_mem_prop("available", &phys_avail); + apply_ram_limit(&phys_avail); prom_mem = phys_mem; for (i = 0; i < phys_avail.n_regions; ++i) remove_mem_piece(&prom_mem,