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
6 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
8 #include <linux/init.h>
9 #include <linux/string.h>
11 #include <asm/bootinfo.h>
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)
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
));
41 if (cp
!= &(arcs_cmdline
[0])) {
42 /* get rid of trailing space */