CC: Andi Kleen - Remove saved_command_line (and saving of the command line). - Call parse_early_options - Convert earlyprintk= --- 25-akpm/arch/x86_64/kernel/early_printk.c | 2 +- 25-akpm/arch/x86_64/kernel/head64.c | 16 +++++----------- 25-akpm/arch/x86_64/kernel/setup.c | 7 ++----- 25-akpm/arch/x86_64/kernel/vmlinux.lds.S | 3 +++ 25-akpm/include/asm-x86_64/bootsetup.h | 1 - 25-akpm/include/asm-x86_64/setup.h | 6 +----- 6 files changed, 12 insertions(+), 23 deletions(-) diff -puN arch/x86_64/kernel/early_printk.c~early-param-x86_64 arch/x86_64/kernel/early_printk.c --- 25/arch/x86_64/kernel/early_printk.c~early-param-x86_64 Thu Mar 25 15:34:51 2004 +++ 25-akpm/arch/x86_64/kernel/early_printk.c Thu Mar 25 15:34:51 2004 @@ -219,4 +219,4 @@ void __init disable_early_printk(void) } } -__setup("earlyprintk=", setup_early_printk); +__early_param("earlyprintk=", setup_early_printk); diff -puN arch/x86_64/kernel/head64.c~early-param-x86_64 arch/x86_64/kernel/head64.c --- 25/arch/x86_64/kernel/head64.c~early-param-x86_64 Thu Mar 25 15:34:51 2004 +++ 25-akpm/arch/x86_64/kernel/head64.c Thu Mar 25 15:34:51 2004 @@ -34,8 +34,6 @@ extern char x86_boot_params[2048]; #define OLD_CL_BASE_ADDR 0x90000 #define OLD_CL_OFFSET 0x90022 -extern char saved_command_line[]; - static void __init copy_bootdata(char *real_mode_data) { int new_data; @@ -52,8 +50,7 @@ static void __init copy_bootdata(char *r printk("old bootloader convention, maybe loadlin?\n"); } command_line = (char *) ((u64)(new_data)); - memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); - printk("Bootdata ok (command line is %s)\n", saved_command_line); + printk("Bootdata ok (command line is %s)\n", command_line); } static void __init setup_boot_cpu_data(void) @@ -81,18 +78,15 @@ void __init x86_64_start_kernel(char * r pda_init(0); copy_bootdata(real_mode_data); /* default console: */ - if (!strstr(saved_command_line, "console=")) - strcat(saved_command_line, " console=tty0"); - s = strstr(saved_command_line, "earlyprintk="); - if (s != NULL) - setup_early_printk(s); + if (!strstr(command_line, "console=")) + strcat(command_line, " console=tty0"); #ifdef CONFIG_DISCONTIGMEM - s = strstr(saved_command_line, "numa="); + s = strstr(command_line, "numa="); if (s != NULL) numa_setup(s+5); #endif #ifdef CONFIG_X86_IO_APIC - if (strstr(saved_command_line, "disableapic")) + if (strstr(command_line, "disableapic")) disable_apic = 1; #endif setup_boot_cpu_data(); diff -puN arch/x86_64/kernel/setup.c~early-param-x86_64 arch/x86_64/kernel/setup.c --- 25/arch/x86_64/kernel/setup.c~early-param-x86_64 Thu Mar 25 15:34:51 2004 +++ 25-akpm/arch/x86_64/kernel/setup.c Thu Mar 25 15:34:51 2004 @@ -54,6 +54,7 @@ #include #include #include +#include /* For COMMAND_LINE_SIZE */ /* * Machine setup.. @@ -99,7 +100,6 @@ extern int root_mountflags; extern char _text, _etext, _edata, _end; char command_line[COMMAND_LINE_SIZE]; -char saved_command_line[COMMAND_LINE_SIZE]; struct resource standard_io_resources[] = { { "dma1", 0x00, 0x1f, IORESOURCE_BUSY }, @@ -195,10 +195,6 @@ static __init void parse_cmdline_early ( char c = ' ', *to = command_line, *from = COMMAND_LINE; int len = 0; - /* Save unparsed command line copy for /proc/cmdline */ - memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; - for (;;) { if (c != ' ') goto next_char; @@ -401,6 +397,7 @@ void __init setup_arch(char **cmdline_p) data_resource.end = virt_to_phys(&_edata)-1; parse_cmdline_early(cmdline_p); + parse_early_options(cmdline_p); /* * partially used pages are not usable - thus diff -puN arch/x86_64/kernel/vmlinux.lds.S~early-param-x86_64 arch/x86_64/kernel/vmlinux.lds.S --- 25/arch/x86_64/kernel/vmlinux.lds.S~early-param-x86_64 Thu Mar 25 15:34:51 2004 +++ 25-akpm/arch/x86_64/kernel/vmlinux.lds.S Thu Mar 25 15:34:51 2004 @@ -89,6 +89,9 @@ SECTIONS __setup_start = .; .init.setup : { *(.init.setup) } __setup_end = .; + __early_begin = .; + __early_param : { *(__early_param) } + __early_end = .; __start___param = .; __param : { *(__param) } __stop___param = .; diff -puN include/asm-x86_64/bootsetup.h~early-param-x86_64 include/asm-x86_64/bootsetup.h --- 25/include/asm-x86_64/bootsetup.h~early-param-x86_64 Thu Mar 25 15:34:51 2004 +++ 25-akpm/include/asm-x86_64/bootsetup.h Thu Mar 25 15:34:51 2004 @@ -27,7 +27,6 @@ extern char x86_boot_params[2048]; #define INITRD_SIZE (*(unsigned int *) (PARAM+0x21c)) #define EDID_INFO (*(struct edid_info *) (PARAM+0x440)) #define COMMAND_LINE saved_command_line -#define COMMAND_LINE_SIZE 256 #define RAMDISK_IMAGE_START_MASK 0x07FF #define RAMDISK_PROMPT_FLAG 0x8000 diff -puN include/asm-x86_64/setup.h~early-param-x86_64 include/asm-x86_64/setup.h --- 25/include/asm-x86_64/setup.h~early-param-x86_64 Thu Mar 25 15:34:51 2004 +++ 25-akpm/include/asm-x86_64/setup.h Thu Mar 25 15:34:51 2004 @@ -1,10 +1,6 @@ -/* - * Just a place holder. We don't want to have to test x86 before - * we include stuff - */ - #ifndef _x8664_SETUP_H #define _x8664_SETUP_H +#define COMMAND_LINE_SIZE 256 #endif _