2 * cmdline.c: Kernel command line creation using ARCS argc/argv.
4 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
6 * $Id: cmdline.c,v 1.1 1998/10/18 13:32:08 tsbogend Exp $
8 #include <linux/init.h>
9 #include <linux/kernel.h>
10 #include <linux/string.h>
12 #include <asm/sgialib.h>
13 #include <asm/bootinfo.h>
15 /* #define DEBUG_CMDLINE */
17 char arcs_cmdline
[CL_SIZE
];
19 char * __init
prom_getcmdline(void)
21 return &(arcs_cmdline
[0]);
24 static char *ignored
[] = {
32 #define NENTS(foo) ((sizeof((foo)) / (sizeof((foo[0])))))
34 void __init
prom_init_cmdline(void)
39 actr
= 1; /* Always ignore argv[0] */
41 cp
= &(arcs_cmdline
[0]);
42 while(actr
< prom_argc
) {
43 for(i
= 0; i
< NENTS(ignored
); i
++) {
44 int len
= strlen(ignored
[i
]);
46 if(!strncmp(prom_argv
[actr
], ignored
[i
], len
))
50 strcpy(cp
, prom_argv
[actr
]);
51 cp
+= strlen(prom_argv
[actr
]);
57 if (cp
!= &(arcs_cmdline
[0])) /* get rid of trailing space */
62 prom_printf("prom_init_cmdline: %s\n", &(arcs_cmdline
[0]));