CC: davidm@hpl.hp.com - Remove saved_command_line (and saving of the command line). - Call parse_early_options - Convert mem= to __early_param. --- 25-akpm/arch/ia64/kernel/efi.c | 34 +++++++++++++-------------------- 25-akpm/arch/ia64/kernel/setup.c | 6 ----- 25-akpm/arch/ia64/kernel/vmlinux.lds.S | 6 +++++ 25-akpm/include/asm-ia64/setup.h | 6 +++++ 4 files changed, 27 insertions(+), 25 deletions(-) diff -puN arch/ia64/kernel/efi.c~early-param-ia64 arch/ia64/kernel/efi.c --- 25/arch/ia64/kernel/efi.c~early-param-ia64 Thu Mar 25 15:34:34 2004 +++ 25-akpm/arch/ia64/kernel/efi.c Thu Mar 25 15:34:34 2004 @@ -469,6 +469,19 @@ efi_map_pal_code (void) } } +static int __init +early_mem(char *cp) +{ + mem_limit = memparse(cp, &cp) - 1; + + if (mem_limit != ~0UL) + printk(KERN_INFO "Ignoring memory above %luMB\n", + mem_limit >> 20); + + return 0; +} +__early_param("mem=", early_mem); + void __init efi_init (void) { @@ -476,28 +489,9 @@ efi_init (void) efi_config_table_t *config_tables; efi_char16_t *c16; u64 efi_desc_size; - char *cp, *end, vendor[100] = "unknown"; - extern char saved_command_line[]; + char vendor[100] = "unknown"; int i; - /* it's too early to be able to use the standard kernel command line support... */ - for (cp = saved_command_line; *cp; ) { - if (memcmp(cp, "mem=", 4) == 0) { - cp += 4; - mem_limit = memparse(cp, &end) - 1; - if (end != cp) - break; - cp = end; - } else { - while (*cp != ' ' && *cp) - ++cp; - while (*cp == ' ') - ++cp; - } - } - if (mem_limit != ~0UL) - printk(KERN_INFO "Ignoring memory above %luMB\n", mem_limit >> 20); - efi.systab = __va(ia64_boot_param->efi_systab); /* diff -puN arch/ia64/kernel/setup.c~early-param-ia64 arch/ia64/kernel/setup.c --- 25/arch/ia64/kernel/setup.c~early-param-ia64 Thu Mar 25 15:34:34 2004 +++ 25-akpm/arch/ia64/kernel/setup.c Thu Mar 25 15:34:34 2004 @@ -88,10 +88,6 @@ unsigned char aux_device_present = 0xaa; unsigned long ia64_max_iommu_merge_mask = ~0UL; EXPORT_SYMBOL(ia64_max_iommu_merge_mask); -#define COMMAND_LINE_SIZE 512 - -char saved_command_line[COMMAND_LINE_SIZE]; /* used in proc filesystem */ - /* * We use a special marker for the end of memory and it uses the extra (+1) slot */ @@ -288,7 +284,7 @@ setup_arch (char **cmdline_p) ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist); *cmdline_p = __va(ia64_boot_param->command_line); - strlcpy(saved_command_line, *cmdline_p, sizeof(saved_command_line)); + parse_early_options(cmdline_p); efi_init(); io_port_init(); diff -puN arch/ia64/kernel/vmlinux.lds.S~early-param-ia64 arch/ia64/kernel/vmlinux.lds.S --- 25/arch/ia64/kernel/vmlinux.lds.S~early-param-ia64 Thu Mar 25 15:34:34 2004 +++ 25-akpm/arch/ia64/kernel/vmlinux.lds.S Thu Mar 25 15:34:34 2004 @@ -134,6 +134,12 @@ SECTIONS *(.init.setup) __setup_end = .; } + __early_param : AT(ADDR(__early_param) - LOAD_OFFSET) + { + __early_begin = .; + *(__early_param) + __early_end = .; + } __param : AT(ADDR(__param) - LOAD_OFFSET) { __start___param = .; diff -puN /dev/null include/asm-ia64/setup.h --- /dev/null Thu Apr 11 07:25:15 2002 +++ 25-akpm/include/asm-ia64/setup.h Thu Mar 25 15:34:34 2004 @@ -0,0 +1,6 @@ +#ifndef __IA64_SETUP_H +#define __IA64_SETUP_H + +#define COMMAND_LINE_SIZE 512 + +#endif _