aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-16 16:03:31 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 04:38:14 -0400
commit41c094fd3ca54f1a71233049cf136ff94c91f4ae (patch)
tree9ce8de894276e69d30c893700a9b70fb4e176511 /arch/x86/kernel/e820.c
parent8c5beb50d3ec915d15c4d38aa37282309a65f14e (diff)
x86: move e820_resource_resources to e820.c
and make 32-bit resource registration more like 64 bit. also move probe_roms back to setup_32.c Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r--arch/x86/kernel/e820.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 544dd12c70f4..432c49178577 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -998,3 +998,35 @@ void __init finish_e820_parsing(void)
998 e820_print_map("user"); 998 e820_print_map("user");
999 } 999 }
1000} 1000}
1001
1002/*
1003 * Mark e820 reserved areas as busy for the resource manager.
1004 */
1005void __init e820_reserve_resources(void)
1006{
1007 int i;
1008 struct resource *res;
1009
1010 res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map);
1011 for (i = 0; i < e820.nr_map; i++) {
1012 switch (e820.map[i].type) {
1013 case E820_RAM: res->name = "System RAM"; break;
1014 case E820_ACPI: res->name = "ACPI Tables"; break;
1015 case E820_NVS: res->name = "ACPI Non-volatile Storage"; break;
1016 default: res->name = "reserved";
1017 }
1018 res->start = e820.map[i].addr;
1019 res->end = res->start + e820.map[i].size - 1;
1020#ifndef CONFIG_RESOURCES_64BIT
1021 if (res->end > 0x100000000ULL) {
1022 res++;
1023 continue;
1024 }
1025#endif
1026 res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
1027 insert_resource(&iomem_resource, res);
1028 res++;
1029 }
1030}
1031
1032