diff options
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r-- | arch/x86/kernel/e820.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 66e48aa2dd1b..78e642feac30 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -148,6 +148,9 @@ void __init e820_print_map(char *who) | |||
148 | case E820_NVS: | 148 | case E820_NVS: |
149 | printk(KERN_CONT "(ACPI NVS)\n"); | 149 | printk(KERN_CONT "(ACPI NVS)\n"); |
150 | break; | 150 | break; |
151 | case E820_UNUSABLE: | ||
152 | printk("(unusable)\n"); | ||
153 | break; | ||
151 | default: | 154 | default: |
152 | printk(KERN_CONT "type %u\n", e820.map[i].type); | 155 | printk(KERN_CONT "type %u\n", e820.map[i].type); |
153 | break; | 156 | break; |
@@ -1260,6 +1263,7 @@ static inline const char *e820_type_to_string(int e820_type) | |||
1260 | case E820_RAM: return "System RAM"; | 1263 | case E820_RAM: return "System RAM"; |
1261 | case E820_ACPI: return "ACPI Tables"; | 1264 | case E820_ACPI: return "ACPI Tables"; |
1262 | case E820_NVS: return "ACPI Non-volatile Storage"; | 1265 | case E820_NVS: return "ACPI Non-volatile Storage"; |
1266 | case E820_UNUSABLE: return "Unusable memory"; | ||
1263 | default: return "reserved"; | 1267 | default: return "reserved"; |
1264 | } | 1268 | } |
1265 | } | 1269 | } |
@@ -1267,6 +1271,7 @@ static inline const char *e820_type_to_string(int e820_type) | |||
1267 | /* | 1271 | /* |
1268 | * Mark e820 reserved areas as busy for the resource manager. | 1272 | * Mark e820 reserved areas as busy for the resource manager. |
1269 | */ | 1273 | */ |
1274 | static struct resource __initdata *e820_res; | ||
1270 | void __init e820_reserve_resources(void) | 1275 | void __init e820_reserve_resources(void) |
1271 | { | 1276 | { |
1272 | int i; | 1277 | int i; |
@@ -1274,6 +1279,7 @@ void __init e820_reserve_resources(void) | |||
1274 | u64 end; | 1279 | u64 end; |
1275 | 1280 | ||
1276 | res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map); | 1281 | res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map); |
1282 | e820_res = res; | ||
1277 | for (i = 0; i < e820.nr_map; i++) { | 1283 | for (i = 0; i < e820.nr_map; i++) { |
1278 | end = e820.map[i].addr + e820.map[i].size - 1; | 1284 | end = e820.map[i].addr + e820.map[i].size - 1; |
1279 | #ifndef CONFIG_RESOURCES_64BIT | 1285 | #ifndef CONFIG_RESOURCES_64BIT |
@@ -1287,7 +1293,14 @@ void __init e820_reserve_resources(void) | |||
1287 | res->end = end; | 1293 | res->end = end; |
1288 | 1294 | ||
1289 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | 1295 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; |
1290 | insert_resource(&iomem_resource, res); | 1296 | |
1297 | /* | ||
1298 | * don't register the region that could be conflicted with | ||
1299 | * pci device BAR resource and insert them later in | ||
1300 | * pcibios_resource_survey() | ||
1301 | */ | ||
1302 | if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20)) | ||
1303 | insert_resource(&iomem_resource, res); | ||
1291 | res++; | 1304 | res++; |
1292 | } | 1305 | } |
1293 | 1306 | ||
@@ -1299,6 +1312,19 @@ void __init e820_reserve_resources(void) | |||
1299 | } | 1312 | } |
1300 | } | 1313 | } |
1301 | 1314 | ||
1315 | void __init e820_reserve_resources_late(void) | ||
1316 | { | ||
1317 | int i; | ||
1318 | struct resource *res; | ||
1319 | |||
1320 | res = e820_res; | ||
1321 | for (i = 0; i < e820.nr_map; i++) { | ||
1322 | if (!res->parent && res->end) | ||
1323 | reserve_region_with_split(&iomem_resource, res->start, res->end, res->name); | ||
1324 | res++; | ||
1325 | } | ||
1326 | } | ||
1327 | |||
1302 | char *__init default_machine_specific_memory_setup(void) | 1328 | char *__init default_machine_specific_memory_setup(void) |
1303 | { | 1329 | { |
1304 | char *who = "BIOS-e820"; | 1330 | char *who = "BIOS-e820"; |