Path: blob/master/arch/mips/loongson/common/cmdline.c
10818 views
/*1* Based on Ocelot Linux port, which is2* Copyright 2001 MontaVista Software Inc.3* Author: [email protected] or [email protected]4*5* Copyright 2003 ICT CAS6* Author: Michael Guo <[email protected]>7*8* Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology9* Author: Fuxin Zhang, [email protected]10*11* Copyright (C) 2009 Lemote Inc.12* Author: Wu Zhangjin, [email protected]13*14* This program is free software; you can redistribute it and/or modify it15* under the terms of the GNU General Public License as published by the16* Free Software Foundation; either version 2 of the License, or (at your17* option) any later version.18*/19#include <asm/bootinfo.h>2021#include <loongson.h>2223void __init prom_init_cmdline(void)24{25int prom_argc;26/* pmon passes arguments in 32bit pointers */27int *_prom_argv;28int i;29long l;3031/* firmware arguments are initialized in head.S */32prom_argc = fw_arg0;33_prom_argv = (int *)fw_arg1;3435/* arg[0] is "g", the rest is boot parameters */36arcs_cmdline[0] = '\0';37for (i = 1; i < prom_argc; i++) {38l = (long)_prom_argv[i];39if (strlen(arcs_cmdline) + strlen(((char *)l) + 1)40>= sizeof(arcs_cmdline))41break;42strcat(arcs_cmdline, ((char *)l));43strcat(arcs_cmdline, " ");44}4546prom_init_machtype();47}484950