aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup_32.c
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@mailshack.com>2008-04-23 09:09:05 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-25 04:55:09 -0400
commit0dbfafa5fcd4dd189e2adc7b6ed9e0405e846d79 (patch)
tree6b3b9ea6a8c9b7163719e4f68772812c74f17168 /arch/x86/kernel/setup_32.c
parent0da72a4aeb4482c64c1142a2e36b556d13374937 (diff)
x86: move i386 memory setup code to e820_32.c
The x86_64 code has centralized the memory setup code in e820_64.c. This patch copies that approach to i386: - early_param("mem", ...) parsing is moved from setup_32.c to e820_32.c. - setup_memory_map() and finish_e820_parsing() are factored out from setup_arch(), and declarations are added to e820_32.h. - print_memory_map() is made static and removed from e820_32.h. - user_defined_memmap is marked as __initdata. Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/setup_32.c')
-rw-r--r--arch/x86/kernel/setup_32.c50
1 files changed, 2 insertions, 48 deletions
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index 2c5f8b213e86..b54c79c91efd 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -237,42 +237,6 @@ static inline void copy_edd(void)
237} 237}
238#endif 238#endif
239 239
240int __initdata user_defined_memmap;
241
242/*
243 * "mem=nopentium" disables the 4MB page tables.
244 * "mem=XXX[kKmM]" defines a memory region from HIGH_MEM
245 * to <mem>, overriding the bios size.
246 * "memmap=XXX[KkmM]@XXX[KkmM]" defines a memory region from
247 * <start> to <start>+<mem>, overriding the bios size.
248 *
249 * HPA tells me bootloaders need to parse mem=, so no new
250 * option should be mem= [also see Documentation/i386/boot.txt]
251 */
252static int __init parse_mem(char *arg)
253{
254 if (!arg)
255 return -EINVAL;
256
257 if (strcmp(arg, "nopentium") == 0) {
258 setup_clear_cpu_cap(X86_FEATURE_PSE);
259 } else {
260 /* If the user specifies memory size, we
261 * limit the BIOS-provided memory map to
262 * that size. exactmap can be used to specify
263 * the exact map. mem=number can be used to
264 * trim the existing memory map.
265 */
266 unsigned long long mem_size;
267
268 mem_size = memparse(arg, &arg);
269 limit_regions(mem_size);
270 user_defined_memmap = 1;
271 }
272 return 0;
273}
274early_param("mem", parse_mem);
275
276#ifdef CONFIG_PROC_VMCORE 240#ifdef CONFIG_PROC_VMCORE
277/* elfcorehdr= specifies the location of elf core header 241/* elfcorehdr= specifies the location of elf core header
278 * stored by the crashed kernel. 242 * stored by the crashed kernel.
@@ -725,12 +689,6 @@ static void set_mca_bus(int x)
725static void set_mca_bus(int x) { } 689static void set_mca_bus(int x) { }
726#endif 690#endif
727 691
728/* Overridden in paravirt.c if CONFIG_PARAVIRT */
729char * __init __attribute__((weak)) memory_setup(void)
730{
731 return machine_specific_memory_setup();
732}
733
734#ifdef CONFIG_NUMA 692#ifdef CONFIG_NUMA
735/* 693/*
736 * In the golden day, when everything among i386 and x86_64 will be 694 * In the golden day, when everything among i386 and x86_64 will be
@@ -786,8 +744,7 @@ void __init setup_arch(char **cmdline_p)
786#endif 744#endif
787 ARCH_SETUP 745 ARCH_SETUP
788 746
789 printk(KERN_INFO "BIOS-provided physical RAM map:\n"); 747 setup_memory_map();
790 print_memory_map(memory_setup());
791 748
792 copy_edd(); 749 copy_edd();
793 750
@@ -807,10 +764,7 @@ void __init setup_arch(char **cmdline_p)
807 764
808 parse_early_param(); 765 parse_early_param();
809 766
810 if (user_defined_memmap) { 767 finish_e820_parsing();
811 printk(KERN_INFO "user-defined physical RAM map:\n");
812 print_memory_map("user");
813 }
814 768
815 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); 769 strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
816 *cmdline_p = command_line; 770 *cmdline_p = command_line;