BCMA - Reorder SPROM fill
[openwrt.git] / target / linux / lantiq / patches-2.6.32 / 230-cmdline_hack.patch
1 --- a/arch/mips/lantiq/prom.c
2 +++ b/arch/mips/lantiq/prom.c
3 @@ -39,20 +39,51 @@ void prom_free_prom_memory(void)
4 {
5 }
6
7 +#ifdef CONFIG_IMAGE_CMDLINE_HACK
8 +extern char __image_cmdline[];
9 +
10 +static void __init
11 +prom_init_image_cmdline(void)
12 +{
13 + char *p = __image_cmdline;
14 + int replace = 0;
15 +
16 + if (*p == '-') {
17 + replace = 1;
18 + p++;
19 + }
20 +
21 + if (*p == '\0')
22 + return;
23 +
24 + if (replace) {
25 + strlcpy(arcs_cmdline, p, sizeof(arcs_cmdline));
26 + } else {
27 + strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
28 + strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
29 + }
30 +}
31 +#else
32 +static void __init prom_init_image_cmdline(void) { return; }
33 +#endif
34 +
35 static void __init prom_init_cmdline(void)
36 {
37 int argc = fw_arg0;
38 char **argv = (char **) KSEG1ADDR(fw_arg1);
39 int i;
40
41 + arcs_cmdline[0] = '\0';
42 +
43 for (i = 0; i < argc; i++) {
44 - char *p = (char *) KSEG1ADDR(argv[i]);
45 + char *p = (char *) KSEG1ADDR(argv[i]);
46
47 - if (p && *p) {
48 + if (CPHYSADDR(p) && *p) {
49 strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
50 strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
51 }
52 }
53 + prom_init_image_cmdline();
54 }
55
56 void __init prom_init(void)
This page took 0.049939 seconds and 5 git commands to generate.