diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-06-16 13:03:31 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 10:38:14 +0200 |
commit | 41c094fd3ca54f1a71233049cf136ff94c91f4ae (patch) | |
tree | 9ce8de894276e69d30c893700a9b70fb4e176511 /arch/x86/kernel/e820.c | |
parent | 8c5beb50d3ec915d15c4d38aa37282309a65f14e (diff) | |
download | lwn-41c094fd3ca54f1a71233049cf136ff94c91f4ae.tar.gz lwn-41c094fd3ca54f1a71233049cf136ff94c91f4ae.zip |
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.c | 32 |
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) e820_print_map("user"); } } + +/* + * Mark e820 reserved areas as busy for the resource manager. + */ +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++) { + switch (e820.map[i].type) { + case E820_RAM: res->name = "System RAM"; break; + case E820_ACPI: res->name = "ACPI Tables"; break; + case E820_NVS: res->name = "ACPI Non-volatile Storage"; break; + default: res->name = "reserved"; + } + res->start = e820.map[i].addr; + res->end = res->start + e820.map[i].size - 1; +#ifndef CONFIG_RESOURCES_64BIT + if (res->end > 0x100000000ULL) { + res++; + continue; + } +#endif + res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; + insert_resource(&iomem_resource, res); + res++; + } +} + + |