summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel.send@gmail.com>2008-03-20 23:57:21 -0700
committerIngo Molnar <mingo@elte.hu>2008-04-17 17:41:19 +0200
commit01561264bd1ea1d654d09babe02d784a5b150124 (patch)
tree4e2900eceeb73afa1adaae7c9437c8072375e049 /arch
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>
Diffstat (limited to 'arch')
-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)
void __init e820_reserve_resources(void)
{
int i;
+ struct resource *res;
+
+ res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map);
for (i = 0; i < e820.nr_map; i++) {
- struct resource *res;
- res = alloc_bootmem_low(sizeof(struct resource));
switch (e820.map[i].type) {
case E820_RAM: res->name = "System RAM"; break;
case E820_ACPI: res->name = "ACPI Tables"; break;
@@ -313,6 +314,7 @@ void __init e820_reserve_resources(void)
res->end = res->start + e820.map[i].size - 1;
res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
insert_resource(&iomem_resource, res);
+ res++;
}
}