* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-2.3.21 / arch / mips / arc / cmdline.c
blobd60ff2bab8771d3b72be60991d1902e7b05e907f
1 /*
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 $
7 */
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[] = {
25 "ConsoleIn=",
26 "ConsoleOut=",
27 "SystemPartition=",
28 "OSLoader=",
29 "OSLoadPartition=",
30 "OSLoadFilename="
32 #define NENTS(foo) ((sizeof((foo)) / (sizeof((foo[0])))))
34 void __init prom_init_cmdline(void)
36 char *cp;
37 int actr, i;
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))
47 goto pic_cont;
49 /* Ok, we want it. */
50 strcpy(cp, prom_argv[actr]);
51 cp += strlen(prom_argv[actr]);
52 *cp++ = ' ';
54 pic_cont:
55 actr++;
57 if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
58 --cp;
59 *cp = '\0';
61 #ifdef DEBUG_CMDLINE
62 prom_printf("prom_init_cmdline: %s\n", &(arcs_cmdline[0]));
63 #endif