Path: blob/master/arch/mips/mti-malta/malta-cmdline.c
10818 views
/*1* Carsten Langgaard, [email protected]2* Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved.3*4* This program is free software; you can distribute it and/or modify it5* under the terms of the GNU General Public License (Version 2) as6* published by the Free Software Foundation.7*8* This program is distributed in the hope it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* for more details.12*13* You should have received a copy of the GNU General Public License along14* with this program; if not, write to the Free Software Foundation, Inc.,15* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.16*17* Kernel command line creation using the prom monitor (YAMON) argc/argv.18*/19#include <linux/init.h>20#include <linux/string.h>2122#include <asm/bootinfo.h>2324extern int prom_argc;25extern int *_prom_argv;2627/*28* YAMON (32-bit PROM) pass arguments and environment as 32-bit pointer.29* This macro take care of sign extension.30*/31#define prom_argv(index) ((char *)(long)_prom_argv[(index)])3233char * __init prom_getcmdline(void)34{35return &(arcs_cmdline[0]);36}373839void __init prom_init_cmdline(void)40{41char *cp;42int actr;4344actr = 1; /* Always ignore argv[0] */4546cp = &(arcs_cmdline[0]);47while(actr < prom_argc) {48strcpy(cp, prom_argv(actr));49cp += strlen(prom_argv(actr));50*cp++ = ' ';51actr++;52}53if (cp != &(arcs_cmdline[0])) {54/* get rid of trailing space */55--cp;56*cp = '\0';57}58}596061