aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel.send@gmail.com>2008-03-21 02:57:21 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:19 -0400
commit01561264bd1ea1d654d09babe02d784a5b150124 (patch)
tree4e2900eceeb73afa1adaae7c9437c8072375e049
parent272b9cad6e7a2f61b13cfcd7dde0010e02e9376e (diff)
x86: allocate e820 resource struct all together
don't need to allocate that one by one Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/e820_64.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c
index 4509757844eb..9184e6437c4f 100644
--- a/arch/x86/kernel/e820_64.c
+++ b/arch/x86/kernel/e820_64.c
@@ -300,9 +300,10 @@ unsigned long __init e820_end_of_ram(void)
300void __init e820_reserve_resources(void) 300void __init e820_reserve_resources(void)
301{ 301{
302 int i; 302 int i;
303 struct resource *res;
304
305 res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map);
303 for (i = 0; i < e820.nr_map; i++) { 306 for (i = 0; i < e820.nr_map; i++) {
304 struct resource *res;
305 res = alloc_bootmem_low(sizeof(struct resource));
306 switch (e820.map[i].type) { 307 switch (e820.map[i].type) {
307 case E820_RAM: res->name = "System RAM"; break; 308 case E820_RAM: res->name = "System RAM"; break;
308 case E820_ACPI: res->name = "ACPI Tables"; break; 309 case E820_ACPI: res->name = "ACPI Tables"; break;
@@ -313,6 +314,7 @@ void __init e820_reserve_resources(void)
313 res->end = res->start + e820.map[i].size - 1; 314 res->end = res->start + e820.map[i].size - 1;
314 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; 315 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
315 insert_resource(&iomem_resource, res); 316 insert_resource(&iomem_resource, res);
317 res++;
316 } 318 }
317} 319}
318 320