From: James S. <jsi...@us...> - 2002-02-12 18:14:21
|
Update of /cvsroot/linux-mips/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv6295/arch/mips/kernel Modified Files: setup.c Log Message: More fixes for highmem at physical addresss above 4gb. Index: setup.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/setup.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- setup.c 28 Jan 2002 19:17:18 -0000 1.49 +++ setup.c 12 Feb 2002 18:14:18 -0000 1.50 @@ -604,7 +604,7 @@ start_kernel(); } -void __init add_memory_region(unsigned long start, unsigned long size, +void __init add_memory_region(phys_t start, phys_t size, long type) { int x = boot_mem_map.nr_map; @@ -625,8 +625,9 @@ int i; for (i = 0; i < boot_mem_map.nr_map; i++) { - printk(" memory: %08lx @ %08lx ", - boot_mem_map.map[i].size, boot_mem_map.map[i].addr); + printk(" memory: %08Lx @ %08Lx ", + (unsigned long long) boot_mem_map.map[i].size, + (unsigned long long) boot_mem_map.map[i].addr); switch (boot_mem_map.map[i].type) { case BOOT_MEM_RAM: printk("(usable)\n"); @@ -1083,6 +1084,7 @@ */ for (i = 0; i < boot_mem_map.nr_map; i++) { struct resource *res; + unsigned long addr_pfn, end_pfn; res = alloc_bootmem(sizeof(struct resource)); switch (boot_mem_map.map[i].type) { @@ -1094,8 +1096,16 @@ default: res->name = "reserved"; } + addr_pfn = PFN_UP(boot_mem_map.map[i].addr); + end_pfn = PFN_UP(boot_mem_map.map[i].addr+boot_mem_map.map[i].size); + if (addr_pfn > max_low_pfn) + continue; res->start = boot_mem_map.map[i].addr; - res->end = res->start + boot_mem_map.map[i].size - 1; + if (end_pfn < max_low_pfn) { + res->end = res->start + boot_mem_map.map[i].size - 1; + } else { + res->end = max_low_pfn - 1; + } res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; request_resource(&iomem_resource, res); |