diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2008-10-17 12:20:26 -0400 |
---|---|---|
committer | Arjan van de Ven <arjan@linux.intel.com> | 2008-10-17 12:20:26 -0400 |
commit | 651dab4264e4ba0e563f5ff56f748127246e9065 (patch) | |
tree | 016630974bdcb00fe529b673f96d389e0fd6dc94 /arch/x86/kernel/e820.c | |
parent | 40b8606253552109815786e5d4b0de98782d31f5 (diff) | |
parent | 2e532d68a2b3e2aa6b19731501222069735c741c (diff) |
Merge commit 'linus/master' into merge-linus
Conflicts:
arch/x86/kvm/i8254.c
Diffstat (limited to 'arch/x86/kernel/e820.c')
-rw-r--r-- | arch/x86/kernel/e820.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 9af89078f7bb..ce97bf3bed12 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; |
@@ -1203,7 +1206,7 @@ static int __init parse_memmap_opt(char *p) | |||
1203 | if (!p) | 1206 | if (!p) |
1204 | return -EINVAL; | 1207 | return -EINVAL; |
1205 | 1208 | ||
1206 | if (!strcmp(p, "exactmap")) { | 1209 | if (!strncmp(p, "exactmap", 8)) { |
1207 | #ifdef CONFIG_CRASH_DUMP | 1210 | #ifdef CONFIG_CRASH_DUMP |
1208 | /* | 1211 | /* |
1209 | * If we are doing a crash dump, we still need to know | 1212 | * If we are doing a crash dump, we still need to know |
@@ -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,20 +1279,26 @@ 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 | if (end != (resource_size_t)end) { |
1280 | if (end > 0x100000000ULL) { | ||
1281 | res++; | 1286 | res++; |
1282 | continue; | 1287 | continue; |
1283 | } | 1288 | } |
1284 | #endif | ||
1285 | res->name = e820_type_to_string(e820.map[i].type); | 1289 | res->name = e820_type_to_string(e820.map[i].type); |
1286 | res->start = e820.map[i].addr; | 1290 | res->start = e820.map[i].addr; |
1287 | res->end = end; | 1291 | res->end = end; |
1288 | 1292 | ||
1289 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | 1293 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; |
1290 | insert_resource(&iomem_resource, res); | 1294 | |
1295 | /* | ||
1296 | * don't register the region that could be conflicted with | ||
1297 | * pci device BAR resource and insert them later in | ||
1298 | * pcibios_resource_survey() | ||
1299 | */ | ||
1300 | if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20)) | ||
1301 | insert_resource(&iomem_resource, res); | ||
1291 | res++; | 1302 | res++; |
1292 | } | 1303 | } |
1293 | 1304 | ||
@@ -1299,6 +1310,19 @@ void __init e820_reserve_resources(void) | |||
1299 | } | 1310 | } |
1300 | } | 1311 | } |
1301 | 1312 | ||
1313 | void __init e820_reserve_resources_late(void) | ||
1314 | { | ||
1315 | int i; | ||
1316 | struct resource *res; | ||
1317 | |||
1318 | res = e820_res; | ||
1319 | for (i = 0; i < e820.nr_map; i++) { | ||
1320 | if (!res->parent && res->end) | ||
1321 | reserve_region_with_split(&iomem_resource, res->start, res->end, res->name); | ||
1322 | res++; | ||
1323 | } | ||
1324 | } | ||
1325 | |||
1302 | char *__init default_machine_specific_memory_setup(void) | 1326 | char *__init default_machine_specific_memory_setup(void) |
1303 | { | 1327 | { |
1304 | char *who = "BIOS-e820"; | 1328 | char *who = "BIOS-e820"; |