Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 377458
b: refs/heads/master
c: e3f12a5
h: refs/heads/master
v: v3
  • Loading branch information
Akira Takeuchi authored and David Howells committed Jun 28, 2013
1 parent e16426e commit 21e3e85
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c6dc9f0a4eeb7c014904475372c66e6d0ac5a572
refs/heads/master: e3f12a53042e26202993baa3ad4ff8768173653d
54 changes: 21 additions & 33 deletions trunk/arch/mn10300/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct mn10300_cpuinfo boot_cpu_data;
/* For PCI or other memory-mapped resources */
unsigned long pci_mem_start = 0x18000000;

static char __initdata cmd_line[COMMAND_LINE_SIZE];
char redboot_command_line[COMMAND_LINE_SIZE] =
"console=ttyS0,115200 root=/dev/mtdblock3 rw";

Expand Down Expand Up @@ -74,45 +75,19 @@ static const char *const mn10300_cputypes[] = {
};

/*
*
* Pick out the memory size. We look for mem=size,
* where size is "size[KkMm]"
*/
static void __init parse_mem_cmdline(char **cmdline_p)
static int __init early_mem(char *p)
{
char *from, *to, c;

/* save unparsed command line copy for /proc/cmdline */
strcpy(boot_command_line, redboot_command_line);

/* see if there's an explicit memory size option */
from = redboot_command_line;
to = redboot_command_line;
c = ' ';

for (;;) {
if (c == ' ' && !memcmp(from, "mem=", 4)) {
if (to != redboot_command_line)
to--;
memory_size = memparse(from + 4, &from);
}

c = *(from++);
if (!c)
break;

*(to++) = c;
}

*to = '\0';
*cmdline_p = redboot_command_line;
memory_size = memparse(p, &p);

if (memory_size == 0)
panic("Memory size not known\n");

memory_end = (unsigned long) CONFIG_KERNEL_RAM_BASE_ADDRESS +
memory_size;
if (memory_end > phys_memory_end)
memory_end = phys_memory_end;
return 0;
}
early_param("mem", early_mem);

/*
* architecture specific setup
Expand All @@ -125,7 +100,20 @@ void __init setup_arch(char **cmdline_p)
cpu_init();
unit_setup();
smp_init_cpus();
parse_mem_cmdline(cmdline_p);

/* save unparsed command line copy for /proc/cmdline */
strlcpy(boot_command_line, redboot_command_line, COMMAND_LINE_SIZE);

/* populate cmd_line too for later use, preserving boot_command_line */
strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
*cmdline_p = cmd_line;

parse_early_param();

memory_end = (unsigned long) CONFIG_KERNEL_RAM_BASE_ADDRESS +
memory_size;
if (memory_end > phys_memory_end)
memory_end = phys_memory_end;

init_mm.start_code = (unsigned long)&_text;
init_mm.end_code = (unsigned long) &_etext;
Expand Down

0 comments on commit 21e3e85

Please sign in to comment.