From: Tom Rini - 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 2004-04-01 02:06:07.248277496 -0800 +++ 25-akpm/arch/ia64/kernel/efi.c 2004-04-01 02:06:07.254276584 -0800 @@ -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 2004-04-01 02:06:07.250277192 -0800 +++ 25-akpm/arch/ia64/kernel/setup.c 2004-04-01 02:06:07.255276432 -0800 @@ -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 2004-04-01 02:06:07.251277040 -0800 +++ 25-akpm/arch/ia64/kernel/vmlinux.lds.S 2004-04-01 02:06:07.256276280 -0800 @@ -135,6 +135,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 2003-09-15 06:40:47.000000000 -0700 +++ 25-akpm/include/asm-ia64/setup.h 2004-04-01 02:06:07.256276280 -0800 @@ -0,0 +1,6 @@ +#ifndef __IA64_SETUP_H +#define __IA64_SETUP_H + +#define COMMAND_LINE_SIZE 512 + +#endif _