X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=arch%2Fum%2Fkernel%2Fum_arch.c;h=8736d098f0eed6ce704b137a455c5a0aa5f4660e;hb=f7f1b0f1e2fbadeab12d24236000e778aa9b1ead;hp=bffd8316f89230c576d9d810e24ef5b13021c9f7;hpb=e3f6fb6212a7102bdb56ba38fa1e98fe72950475;p=linux-2.6.git diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index bffd8316f..8736d098f 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -23,6 +23,7 @@ #include "asm/ptrace.h" #include "asm/elf.h" #include "asm/user.h" +#include "asm/setup.h" #include "ubd_user.h" #include "asm/current.h" #include "user_util.h" @@ -40,6 +41,20 @@ #define DEFAULT_COMMAND_LINE "root=98:0" +/* Changed in linux_main and setup_arch, which run before SMP is started */ +static char command_line[COMMAND_LINE_SIZE] = { 0 }; + +static void add_arg(char *arg) +{ + if (strlen(command_line) + strlen(arg) + 1 > COMMAND_LINE_SIZE) { + printf("add_arg: Too many command line arguments!\n"); + exit(1); + } + if(strlen(command_line) > 0) + strcat(command_line, " "); + strcat(command_line, arg); +} + struct cpuinfo_um boot_cpu_data = { .loops_per_jiffy = 0, .ipi_pipe = { -1, -1 } @@ -95,12 +110,6 @@ struct seq_operations cpuinfo_op = { .show = show_cpuinfo, }; -pte_t * __bad_pagetable(void) -{ - panic("Someone should implement __bad_pagetable"); - return(NULL); -} - /* Set in linux_main */ unsigned long host_task_size; unsigned long task_size; @@ -314,9 +323,11 @@ int linux_main(int argc, char **argv) if((i == 1) && (argv[i][0] == ' ')) continue; add = 1; uml_checksetup(argv[i], &add); - if(add) add_arg(saved_command_line, argv[i]); + if (add) + add_arg(argv[i]); } - if(have_root == 0) add_arg(saved_command_line, DEFAULT_COMMAND_LINE); + if(have_root == 0) + add_arg(DEFAULT_COMMAND_LINE); mode_tt = force_tt ? 1 : !can_do_skas(); #ifndef CONFIG_MODE_TT @@ -432,7 +443,7 @@ void __init setup_arch(char **cmdline_p) { notifier_chain_register(&panic_notifier_list, &panic_exit_notifier); paging_init(); - strcpy(command_line, saved_command_line); + strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; setup_hostinfo(); } @@ -448,14 +459,3 @@ void __init check_bugs(void) void apply_alternatives(void *start, void *end) { } - -/* - * Overrides for Emacs so that we follow Linus's tabbing style. - * Emacs will notice this stuff at the end of the file and automatically - * adjust the settings for this buffer only. This must remain at the end - * of the file. - * --------------------------------------------------------------------------- - * Local variables: - * c-file-style: "linux" - * End: - */