1 /* 2 * cmdline.c: read the command line passed to us by the PROM. 3 * 4 * Copyright (C) 1998 Harald Koerfgen 5 * Copyright (C) 2002, 2004 Maciej W. Rozycki 6 */ 7 #include <linux/init.h> 8 #include <linux/kernel.h> 9 #include <linux/string.h> 10 #include <linux/types.h> 11 12 #include <asm/bootinfo.h> 13 #include <asm/dec/prom.h> 14 15 #undef PROM_DEBUG 16 17 char arcs_cmdline[CL_SIZE]; 18 prom_init_cmdline(s32 argc,s32 * argv,u32 magic)19void __init prom_init_cmdline(s32 argc, s32 *argv, u32 magic) 20 { 21 char *arg; 22 int start_arg, i; 23 24 /* 25 * collect args and prepare cmd_line 26 */ 27 if (!prom_is_rex(magic)) 28 start_arg = 1; 29 else 30 start_arg = 2; 31 for (i = start_arg; i < argc; i++) { 32 arg = (void *)(long)(argv[i]); 33 strcat(arcs_cmdline, arg); 34 if (i < (argc - 1)) 35 strcat(arcs_cmdline, " "); 36 } 37 38 #ifdef PROM_DEBUG 39 printk("arcs_cmdline: %s\n", &(arcs_cmdline[0])); 40 #endif 41 } 42