aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/kernel/e820.c28
-rw-r--r--include/asm-x86_64/e820.h4
2 files changed, 9 insertions, 23 deletions
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c
index e06c2714ecf3..5d1275a93658 100644
--- a/arch/x86_64/kernel/e820.c
+++ b/arch/x86_64/kernel/e820.c
@@ -536,10 +536,14 @@ static int __init copy_e820_map(struct e820entry * biosmap, int nr_map)
536 return 0; 536 return 0;
537} 537}
538 538
539void __init setup_memory_region(void) 539void early_panic(char *msg)
540{ 540{
541 char *who = "BIOS-e820"; 541 early_printk(msg);
542 panic(msg);
543}
542 544
545void __init setup_memory_region(void)
546{
543 /* 547 /*
544 * Try to copy the BIOS-supplied E820-map. 548 * Try to copy the BIOS-supplied E820-map.
545 * 549 *
@@ -547,24 +551,10 @@ void __init setup_memory_region(void)
547 * the next section from 1mb->appropriate_mem_k 551 * the next section from 1mb->appropriate_mem_k
548 */ 552 */
549 sanitize_e820_map(E820_MAP, &E820_MAP_NR); 553 sanitize_e820_map(E820_MAP, &E820_MAP_NR);
550 if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) { 554 if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0)
551 unsigned long mem_size; 555 early_panic("Cannot find a valid memory map");
552
553 /* compare results from other methods and take the greater */
554 if (ALT_MEM_K < EXT_MEM_K) {
555 mem_size = EXT_MEM_K;
556 who = "BIOS-88";
557 } else {
558 mem_size = ALT_MEM_K;
559 who = "BIOS-e801";
560 }
561
562 e820.nr_map = 0;
563 add_memory_region(0, LOWMEMSIZE(), E820_RAM);
564 add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
565 }
566 printk(KERN_INFO "BIOS-provided physical RAM map:\n"); 556 printk(KERN_INFO "BIOS-provided physical RAM map:\n");
567 e820_print_map(who); 557 e820_print_map("BIOS-e820");
568} 558}
569 559
570static int __init parse_memopt(char *p) 560static int __init parse_memopt(char *p)
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h
index dba012151856..8dac397bf85e 100644
--- a/include/asm-x86_64/e820.h
+++ b/include/asm-x86_64/e820.h
@@ -22,10 +22,6 @@
22#define E820_ACPI 3 /* usable as RAM once ACPI tables have been read */ 22#define E820_ACPI 3 /* usable as RAM once ACPI tables have been read */
23#define E820_NVS 4 23#define E820_NVS 4
24 24
25#define HIGH_MEMORY (1024*1024)
26
27#define LOWMEMSIZE() (0x9f000)
28
29#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
30struct e820entry { 26struct e820entry {
31 u64 addr; /* start of memory segment */ 27 u64 addr; /* start of memory segment */