Merge git://git.infradead.org/users/willy/linux-nvme
[linux/fpc-iii.git] / arch / mips / mti-sead3 / sead3-cmdline.c
bloba2e6cec67f57ff62af405661b732badefec3b9b1
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
7 */
8 #include <linux/init.h>
9 #include <linux/string.h>
11 #include <asm/bootinfo.h>
13 extern int prom_argc;
14 extern int *_prom_argv;
17 * YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer.
18 * This macro take care of sign extension.
20 #define prom_argv(index) ((char *)(long)_prom_argv[(index)])
22 char * __init prom_getcmdline(void)
24 return &(arcs_cmdline[0]);
27 void __init prom_init_cmdline(void)
29 char *cp;
30 int actr;
32 actr = 1; /* Always ignore argv[0] */
34 cp = &(arcs_cmdline[0]);
35 while (actr < prom_argc) {
36 strcpy(cp, prom_argv(actr));
37 cp += strlen(prom_argv(actr));
38 *cp++ = ' ';
39 actr++;
41 if (cp != &(arcs_cmdline[0])) {
42 /* get rid of trailing space */
43 --cp;
44 *cp = '\0';