aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/e820_32.c
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@mailshack.com>2008-03-01 11:09:12 -0500
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:40:51 -0400
commitdedd04be71cea3d5adb14c8f674e801911c89a2f (patch)
tree616250e345885a6f43dba0f407280d0304997ae3 /arch/x86/kernel/e820_32.c
parent823c248e7cc75b4f22da914b01f8e5433cff197e (diff)
x86: reserve end-of-conventional-memory to 1MB on 32-bit
This patch adds explicit detection of the EBDA and reservation of the rom and adapter address space 0xa0000-0x100000 to the i386 kernels. Before this patch, the EBDA size was hardcoded as 4Kb. Also, the reservation of the adapter range was done by modifying the e820 map which is now not necessary any longer, and that code is removed from copy_e820_map. The amount of conventional memory and the start of the EBDA are detected by reading the BIOS data area directly. Paravirtual environments do not provide this area, so we bail out early in that case. They will just have to set up a correct memory map to start with. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/e820_32.c')
-rw-r--r--arch/x86/kernel/e820_32.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/arch/x86/kernel/e820_32.c b/arch/x86/kernel/e820_32.c
index 80444c5c9b14..0240cd778365 100644
--- a/arch/x86/kernel/e820_32.c
+++ b/arch/x86/kernel/e820_32.c
@@ -450,38 +450,25 @@ int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map)
450 * thinkpad 560x, for example, does not cooperate with the memory 450 * thinkpad 560x, for example, does not cooperate with the memory
451 * detection code.) 451 * detection code.)
452 */ 452 */
453int __init copy_e820_map(struct e820entry * biosmap, int nr_map) 453int __init copy_e820_map(struct e820entry *biosmap, int nr_map)
454{ 454{
455 /* Only one memory region (or negative)? Ignore it */ 455 /* Only one memory region (or negative)? Ignore it */
456 if (nr_map < 2) 456 if (nr_map < 2)
457 return -1; 457 return -1;
458 458
459 do { 459 do {
460 unsigned long long start = biosmap->addr; 460 u64 start = biosmap->addr;
461 unsigned long long size = biosmap->size; 461 u64 size = biosmap->size;
462 unsigned long long end = start + size; 462 u64 end = start + size;
463 unsigned long type = biosmap->type; 463 u32 type = biosmap->type;
464 464
465 /* Overflow in 64 bits? Ignore the memory map. */ 465 /* Overflow in 64 bits? Ignore the memory map. */
466 if (start > end) 466 if (start > end)
467 return -1; 467 return -1;
468 468
469 /*
470 * Some BIOSes claim RAM in the 640k - 1M region.
471 * Not right. Fix it up.
472 */
473 if (type == E820_RAM) {
474 if (start < 0x100000ULL && end > 0xA0000ULL) {
475 if (start < 0xA0000ULL)
476 add_memory_region(start, 0xA0000ULL-start, type);
477 if (end <= 0x100000ULL)
478 continue;
479 start = 0x100000ULL;
480 size = end - start;
481 }
482 }
483 add_memory_region(start, size, type); 469 add_memory_region(start, size, type);
484 } while (biosmap++,--nr_map); 470 } while (biosmap++, --nr_map);
471
485 return 0; 472 return 0;
486} 473}
487 474