diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-19 05:27:32 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-19 05:28:41 -0400 |
commit | 929bf0d0156562ce631728b6fa53d68004d456d2 (patch) | |
tree | 739063990a8077b29ef97e69d73bce94573daae4 /arch/mips/loongson/common/cmdline.c | |
parent | def0a9b2573e00ab0b486cb5382625203ab4c4a6 (diff) | |
parent | 202c4675c55ddf6b443c7e057d2dff6b42ef71aa (diff) |
Merge branch 'linus' into perfcounters/core
Merge reason: Bring in tracing changes we depend on.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/mips/loongson/common/cmdline.c')
-rw-r--r-- | arch/mips/loongson/common/cmdline.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/mips/loongson/common/cmdline.c b/arch/mips/loongson/common/cmdline.c new file mode 100644 index 000000000000..75f1b243ee4e --- /dev/null +++ b/arch/mips/loongson/common/cmdline.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Based on Ocelot Linux port, which is | ||
3 | * Copyright 2001 MontaVista Software Inc. | ||
4 | * Author: jsun@mvista.com or jsun@junsun.net | ||
5 | * | ||
6 | * Copyright 2003 ICT CAS | ||
7 | * Author: Michael Guo <guoyi@ict.ac.cn> | ||
8 | * | ||
9 | * Copyright (C) 2007 Lemote Inc. & Insititute of Computing Technology | ||
10 | * Author: Fuxin Zhang, zhangfx@lemote.com | ||
11 | * | ||
12 | * Copyright (C) 2009 Lemote Inc. & Insititute of Computing Technology | ||
13 | * Author: Wu Zhangjin, wuzj@lemote.com | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify it | ||
16 | * under the terms of the GNU General Public License as published by the | ||
17 | * Free Software Foundation; either version 2 of the License, or (at your | ||
18 | * option) any later version. | ||
19 | */ | ||
20 | #include <asm/bootinfo.h> | ||
21 | |||
22 | #include <loongson.h> | ||
23 | |||
24 | int prom_argc; | ||
25 | /* pmon passes arguments in 32bit pointers */ | ||
26 | int *_prom_argv; | ||
27 | |||
28 | void __init prom_init_cmdline(void) | ||
29 | { | ||
30 | int i; | ||
31 | long l; | ||
32 | |||
33 | /* firmware arguments are initialized in head.S */ | ||
34 | prom_argc = fw_arg0; | ||
35 | _prom_argv = (int *)fw_arg1; | ||
36 | |||
37 | /* arg[0] is "g", the rest is boot parameters */ | ||
38 | arcs_cmdline[0] = '\0'; | ||
39 | for (i = 1; i < prom_argc; i++) { | ||
40 | l = (long)_prom_argv[i]; | ||
41 | if (strlen(arcs_cmdline) + strlen(((char *)l) + 1) | ||
42 | >= sizeof(arcs_cmdline)) | ||
43 | break; | ||
44 | strcat(arcs_cmdline, ((char *)l)); | ||
45 | strcat(arcs_cmdline, " "); | ||
46 | } | ||
47 | |||
48 | if ((strstr(arcs_cmdline, "console=")) == NULL) | ||
49 | strcat(arcs_cmdline, " console=ttyS0,115200"); | ||
50 | if ((strstr(arcs_cmdline, "root=")) == NULL) | ||
51 | strcat(arcs_cmdline, " root=/dev/hda1"); | ||
52 | } | ||