| 5/8 | param: arch_get_boot_command_line() (take II)arch/alpha/kernel/setup.c--- a/arch/alpha/kernel/setup.c+++ b/arch/alpha/kernel/setup.c@@ -496,8 +496,27 @@ register_cpus(void) arch_initcall(register_cpus); +void arch_get_boot_command_line(void)+{+ /*+ * Locate the command line.+ */+ /* Hack for Jensen... since we're restricted to 8 or 16 chars for+ boot flags depending on the boot mode, we need some shorthand.+ This should do for installation. */+ if (strcmp(COMMAND_LINE, "INSTALL") == 0) {+ strlcpy(command_line, "root=/dev/fd0 load_ramdisk=1",+ sizeof command_line);+ } else {+ strlcpy(command_line, COMMAND_LINE, sizeof command_line);+ }++ /* FIXME: Can we skip command_line and just use boot_command_line? */+ strcpy(boot_command_line, command_line);+}+ void __init-setup_arch(char **cmdline_p)+setup_arch(void) { extern char _end[]; @@ -542,21 +561,8 @@ setup_arch(char **cmdline_p) kernel_end = callback_init(kernel_end); /* - * Locate the command line.- */- /* Hack for Jensen... since we're restricted to 8 or 16 chars for- boot flags depending on the boot mode, we need some shorthand.- This should do for installation. */- if (strcmp(COMMAND_LINE, "INSTALL") == 0) {- strlcpy(command_line, "root=/dev/fd0 load_ramdisk=1", sizeof command_line);- } else {- strlcpy(command_line, COMMAND_LINE, sizeof command_line);- }- strcpy(boot_command_line, command_line);- *cmdline_p = command_line;-- /* * Process command-line arguments.+ * FIXME: Use core_param. */ while ((p = strsep(&args, " \t")) != NULL) { if (!*p) continue;diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c--- a/arch/arm/kernel/setup.c+++ b/arch/arm/kernel/setup.c@@ -115,7 +115,6 @@ static struct meminfo meminfo __initdata static struct meminfo meminfo __initdata = { 0, }; static const char *cpu_name; static const char *machine_name;-static char __initdata command_line[COMMAND_LINE_SIZE]; static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };@@ -414,10 +413,12 @@ __early_param("mem=", early_mem); /* * Initial parsing of the command line.+ * FIXME: Use generic core_param. This actually removes args from the+ * cmdline as seen in /proc! */-static void __init parse_cmdline(char **cmdline_p, char *from)+static void __init parse_cmdline(char *from) {- char c = ' ', *to = command_line;+ char c = ' ', *to = boot_command_line; int len = 0; for (;;) {@@ -429,7 +430,7 @@ static void __init parse_cmdline(char ** int arglen = strlen(p->arg); if (memcmp(from, p->arg, arglen) == 0) {- if (to != command_line)+ if (to != boot_command_line) to -= 1; from += arglen; p->fn(&from);@@ -448,7 +449,6 @@ static void __init parse_cmdline(char ** *to++ = c; } *to = '\0';- *cmdline_p = command_line; } static void __init@@ -673,7 +673,8 @@ static int __init customize_machine(void } arch_initcall(customize_machine); -void __init setup_arch(char **cmdline_p)+/* We not only get the command line here, we parse the tags as well. */+void __init arch_get_boot_command_line(void) { struct tag *tags = (struct tag *)&init_tags; struct machine_desc *mdesc;@@ -681,10 +682,6 @@ void __init setup_arch(char **cmdline_p) setup_processor(); mdesc = setup_machine(machine_arch_type);- machine_name = mdesc->name;-- if (mdesc->soft_reboot)- reboot_setup("s"); if (__atags_pointer) tags = phys_to_virt(__atags_pointer);@@ -703,21 +700,29 @@ void __init setup_arch(char **cmdline_p) if (mdesc->fixup) mdesc->fixup(mdesc, tags, &from, &meminfo); - if (tags->hdr.tag == ATAG_CORE) {- if (meminfo.nr_banks != 0)- squash_mem_tags(tags);- save_atags(tags);- parse_tags(tags);- }+ if (meminfo.nr_banks != 0)+ squash_mem_tags(tags);+ save_atags(tags);+ parse_tags(tags);++ /* This copies into boot_command_line */+ parse_cmdline(from);+}++void __init setup_arch(void)+{+ struct machine_desc *mdesc = setup_machine(machine_arch_type);++ machine_name = mdesc->name;++ if (mdesc->soft_reboot)+ reboot_setup("s"); init_mm.start_code = (unsigned long) &_text; init_mm.end_code = (unsigned long) &_etext; init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; - memcpy(boot_command_line, from, COMMAND_LINE_SIZE);- boot_command_line[COMMAND_LINE_SIZE-1] = '\0';- parse_cmdline(cmdline_p, from); paging_init(&meminfo, mdesc); request_standard_resources(&meminfo, mdesc); diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c--- a/arch/avr32/kernel/setup.c+++ b/arch/avr32/kernel/setup.c@@ -39,8 +39,6 @@ struct avr32_cpuinfo boot_cpu_data = { .loops_per_jiffy = 5000000 }; EXPORT_SYMBOL(boot_cpu_data);--static char __initdata command_line[COMMAND_LINE_SIZE]; /* * Standard memory resources@@ -536,7 +534,12 @@ static void __init setup_bootmem(void) } } -void __init setup_arch (char **cmdline_p)+void __init arch_get_boot_command_line(void)+{+ parse_tags(bootloader_tags);+}++void __init setup_arch(void) { struct clk *cpu_clk; @@ -553,8 +556,6 @@ void __init setup_arch (char **cmdline_p kernel_code.end = __pa(init_mm.end_code - 1); kernel_data.start = __pa(init_mm.end_code); kernel_data.end = __pa(init_mm.brk - 1);-- parse_tags(bootloader_tags); setup_processor(); setup_platform();@@ -579,8 +580,6 @@ void __init setup_arch (char **cmdline_p ((cpu_hz + 500) / 1000) % 1000); } - strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);- *cmdline_p = command_line; parse_early_param(); setup_bootmem();diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c--- a/arch/blackfin/kernel/setup.c+++ b/arch/blackfin/kernel/setup.c@@ -710,23 +710,23 @@ static inline int __init get_mem_size(vo BUG(); } -void __init setup_arch(char **cmdline_p)+void arch_get_boot_command_line(void)+{+#if defined(CONFIG_CMDLINE_BOOL)+ strlcpy(command_line, CONFIG_CMDLINE, sizeof(command_line));+#endif++ /* FIXME: Get rid of command_line and just use boot_command_line? */+ strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);+}++void __init setup_arch(void) { unsigned long sclk, cclk; #ifdef CONFIG_DUMMY_CONSOLE conswitchp = &dummy_con; #endif--#if defined(CONFIG_CMDLINE_BOOL)- strncpy(&command_line[0], CONFIG_CMDLINE, sizeof(command_line));- command_line[sizeof(command_line) - 1] = 0;-#endif-- /* Keep a copy of command line */- *cmdline_p = &command_line[0];- memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);- boot_command_line[COMMAND_LINE_SIZE - 1] = '\0'; /* setup memory defaults from the user config */ physical_mem_end = 0;diff --git a/arch/cris/kernel/setup.c b/arch/cris/kernel/setup.c--- a/arch/cris/kernel/setup.c+++ b/arch/cris/kernel/setup.c@@ -40,6 +40,20 @@ static struct cpu cpu_devices[NR_CPUS]; extern void show_etrax_copyright(void); /* arch-vX/kernel/setup.c */ +void __init arch_get_boot_command_line(void)+{+#ifdef CONFIG_ETRAX_CMDLINE+ if (!strcmp(cris_command_line, "")) {+ strlcpy(cris_command_line, CONFIG_ETRAX_CMDLINE,+ COMMAND_LINE_SIZE);+ cris_command_line[COMMAND_LINE_SIZE - 1] = '\0';+ }+#endif++ /* FIXME: Do we need cris_command_line at all? */+ strlcpy(boot_command_line, cris_command_line, COMMAND_LINE_SIZE);+}+ /* This mainly sets up the memory area, and can be really confusing. * * The physical DRAM is virtually mapped into dram_start to dram_end@@ -56,7 +70,7 @@ extern void show_etrax_copyright(void); * */ -void __init setup_arch(char **cmdline_p)+void __init setup_arch(void) { extern void init_etrax_debug(void); unsigned long bootmap_size;@@ -144,19 +158,6 @@ void __init setup_arch(char **cmdline_p) paging_init(); - *cmdline_p = cris_command_line;--#ifdef CONFIG_ETRAX_CMDLINE- if (!strcmp(cris_command_line, "")) {- strlcpy(cris_command_line, CONFIG_ETRAX_CMDLINE, COMMAND_LINE_SIZE);- cris_command_line[COMMAND_LINE_SIZE - 1] = '\0';- }-#endif-- /* Save command line for future references. */- memcpy(boot_command_line, cris_command_line, COMMAND_LINE_SIZE);- boot_command_line[COMMAND_LINE_SIZE - 1] = '\0';- /* give credit for the CRIS port */ show_etrax_copyright(); diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c--- a/arch/frv/kernel/setup.c+++ b/arch/frv/kernel/setup.c@@ -721,6 +721,7 @@ void __cpuinit calibrate_delay(void) /*****************************************************************************/ /* * look through the command line for some things we need to know immediately+ * FIXME: Use core_param or early_param. */ static void __init parse_cmdline_early(char *cmdline) {@@ -747,19 +748,22 @@ static void __init parse_cmdline_early(c } /* end parse_cmdline_early() */ +void __init arch_get_boot_command_line(void)+{+ memcpy(boot_command_line, redboot_command_line, COMMAND_LINE_SIZE);+}+ /*****************************************************************************/ /* * */-void __init setup_arch(char **cmdline_p)+void __init setup_arch(void) { #ifdef CONFIG_MMU printk("Linux FR-V port done by Red Hat Inc <[email protected]>\n"); #else printk("uClinux FR-V port done by Red Hat Inc <[email protected]>\n"); #endif-- memcpy(boot_command_line, redboot_command_line, COMMAND_LINE_SIZE); determine_cpu(); determine_clocks(1);@@ -794,7 +798,6 @@ void __init setup_arch(char **cmdline_p) /* deal with the command line - RedBoot may have passed one to the kernel */ memcpy(command_line, boot_command_line, sizeof(command_line));- *cmdline_p = &command_line[0]; parse_cmdline_early(command_line); /* set up the memory descriptiondiff --git a/arch/h8300/kernel/setup.c b/arch/h8300/kernel/setup.c--- a/arch/h8300/kernel/setup.c+++ b/arch/h8300/kernel/setup.c@@ -91,7 +91,18 @@ static const struct console gdb_console }; #endif -void __init setup_arch(char **cmdline_p)+/* FIXME: Can we avoid command_line temporary? */+void __init arch_get_boot_command_line(void)+{+#ifdef CONFIG_DEFAULT_CMDLINE+ /* set from default command line */+ if (*command_line == '\0')+ strcpy(command_line, CONFIG_KERNEL_COMMAND);+#endif+ strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);+}++void __init setup_arch(void) { int bootmap_size; @@ -145,19 +156,9 @@ void __init setup_arch(char **cmdline_p) (int) memory_end, (int) &_ramend); #endif -#ifdef CONFIG_DEFAULT_CMDLINE- /* set from default command line */- if (*command_line == '\0')- strcpy(command_line,CONFIG_KERNEL_COMMAND);-#endif- /* Keep a copy of command line */- *cmdline_p = &command_line[0];- memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);- boot_command_line[COMMAND_LINE_SIZE-1] = 0;- #ifdef DEBUG- if (strlen(*cmdline_p)) - printk(KERN_DEBUG "Command line: '%s'\n", *cmdline_p);+ if (strlen(command_line))+ printk(KERN_DEBUG "Command line: '%s'\n", command_line); #endif /*diff --git a/arch/ia64/dig/setup.c b/arch/ia64/dig/setup.c--- a/arch/ia64/dig/setup.c+++ b/arch/ia64/dig/setup.c@@ -25,7 +25,7 @@ #include <asm/system.h> void __init-dig_setup (char **cmdline_p)+dig_setup(void) { unsigned int orig_x, orig_y, num_cols, num_rows, font_height; diff --git a/arch/ia64/hp/sim/hpsim_setup.c b/arch/ia64/hp/sim/hpsim_setup.c--- a/arch/ia64/hp/sim/hpsim_setup.c+++ b/arch/ia64/hp/sim/hpsim_setup.c@@ -38,7 +38,7 @@ ia64_ctl_trace (long on) } void __init-hpsim_setup (char **cmdline_p)+hpsim_setup(void) { ROOT_DEV = Root_SDA1; /* default to first SCSI drive */ diff --git a/arch/ia64/include/asm/machvec.h b/arch/ia64/include/asm/machvec.h--- a/arch/ia64/include/asm/machvec.h+++ b/arch/ia64/include/asm/machvec.h@@ -25,7 +25,7 @@ struct msi_desc; struct msi_desc; struct dma_attrs; -typedef void ia64_mv_setup_t (char **);+typedef void ia64_mv_setup_t (void); typedef void ia64_mv_cpu_init_t (void); typedef void ia64_mv_irq_init_t (void); typedef void ia64_mv_send_ipi_t (int, int, int, int);@@ -111,7 +111,7 @@ machvec_noop_bus (struct pci_bus *bus) { } -extern void machvec_setup (char **);+extern void machvec_setup(void); extern void machvec_timer_interrupt (int, void *); extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int); extern void machvec_dma_sync_sg (struct device *, struct scatterlist *, int, int);diff --git a/arch/ia64/include/asm/paravirt.h b/arch/ia64/include/asm/paravirt.h--- a/arch/ia64/include/ |
|---|