diff options
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) | |||
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 | */ | ||
1005 | void __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 | |||