summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-06-18 17:27:08 -0700
committerIngo Molnar <mingo@elte.hu>2008-07-08 10:39:01 +0200
commit95a71a45c250177854f7c530810c88a8a19a443b (patch)
tree9a063a825cdc5d088973ad06b7cecfb789c3a0dd /arch
parent66a6f8d539416c9664f3a04ecb12f55a0097ab8c (diff)
downloadblackbird-op-linux-95a71a45c250177854f7c530810c88a8a19a443b.tar.gz
blackbird-op-linux-95a71a45c250177854f7c530810c88a8a19a443b.zip
x86: cleanup machine_specific_memory_setup, v2
1. let 64bit support 88 and e801 too 2. introduce default_machine_specific_memory_setup, and reuse it for voyager v2: fix 64 bit compiling Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/e820.c13
-rw-r--r--arch/x86/mach-voyager/setup.c32
2 files changed, 8 insertions, 37 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 49477484a2fa..7b613d2efb04 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1029,7 +1029,7 @@ void __init e820_reserve_resources(void)
}
}
-char *__init __attribute__((weak)) machine_specific_memory_setup(void)
+char *__init default_machine_specific_memory_setup(void)
{
char *who = "BIOS-e820";
int new_nr;
@@ -1045,10 +1045,7 @@ char *__init __attribute__((weak)) machine_specific_memory_setup(void)
&new_nr);
boot_params.e820_entries = new_nr;
if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries) < 0) {
-#ifdef CONFIG_X86_64
- early_panic("Cannot find a valid memory map");
-#else
- unsigned long mem_size;
+ u64 mem_size;
/* compare results from other methods and take the greater */
if (boot_params.alt_mem_k
@@ -1063,13 +1060,17 @@ char *__init __attribute__((weak)) machine_specific_memory_setup(void)
e820.nr_map = 0;
e820_add_region(0, LOWMEMSIZE(), E820_RAM);
e820_add_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
-#endif
}
/* In case someone cares... */
return who;
}
+char *__init __attribute__((weak)) machine_specific_memory_setup(void)
+{
+ return default_machine_specific_memory_setup();
+}
+
/* Overridden in paravirt.c if CONFIG_PARAVIRT */
char * __init __attribute__((weak)) memory_setup(void)
{
diff --git a/arch/x86/mach-voyager/setup.c b/arch/x86/mach-voyager/setup.c
index f27b583154e5..6bbdd633864c 100644
--- a/arch/x86/mach-voyager/setup.c
+++ b/arch/x86/mach-voyager/setup.c
@@ -104,35 +104,5 @@ char *__init machine_specific_memory_setup(void)
return who;
}
- who = "BIOS-e820";
-
- /*
- * Try to copy the BIOS-supplied E820-map.
- *
- * Otherwise fake a memory map; one section from 0k->640k,
- * the next section from 1mb->appropriate_mem_k
- */
- new_nr = boot_params.e820_entries;
- sanitize_e820_map(boot_params.e820_map,
- ARRAY_SIZE(boot_params.e820_map),
- &new_nr);
- boot_params.e820_entries = new_nr;
- if (copy_e820_map(boot_params.e820_map, boot_params.e820_entries)
- < 0) {
- unsigned long mem_size;
-
- /* compare results from other methods and take the greater */
- if (boot_params.alt_mem_k < boot_params.screen_info.ext_mem_k) {
- mem_size = boot_params.screen_info.ext_mem_k;
- who = "BIOS-88";
- } else {
- mem_size = boot_params.alt_mem_k;
- who = "BIOS-e801";
- }
-
- e820.nr_map = 0;
- e820_add_region(0, LOWMEMSIZE(), E820_RAM);
- e820_add_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
- }
- return who;
+ return default_machine_specific_memory_setup();
}
OpenPOWER on IntegriCloud