Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17546
b: refs/heads/master
c: 69cda7b
h: refs/heads/master
v: v3
  • Loading branch information
akpm@osdl.org authored and Linus Torvalds committed Jan 10, 2006
1 parent 45cc1b4 commit 0768a2e
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 2 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: bf2083050d7879390ddedbd64e431cf167854a34
refs/heads/master: 69cda7b1f06befb8d6a884b8a663d19dcaef590b
2 changes: 1 addition & 1 deletion trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ running once the system is up.
mem=nopentium [BUGS=IA-32] Disable usage of 4MB pages for kernel
memory.

memmap=exactmap [KNL,IA-32] Enable setting of an exact
memmap=exactmap [KNL,IA-32,X86_64] Enable setting of an exact
E820 memory map, as specified by the user.
Such memmap=exactmap lines can be constructed based on
BIOS output or other requirements. See the memmap=nn@ss
Expand Down
21 changes: 21 additions & 0 deletions trunk/arch/x86_64/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,27 @@ void __init parse_memopt(char *p, char **from)
end_user_pfn >>= PAGE_SHIFT;
}

void __init parse_memmapopt(char *p, char **from)
{
unsigned long long start_at, mem_size;

mem_size = memparse(p, from);
p = *from;
if (*p == '@') {
start_at = memparse(p+1, from);
add_memory_region(start_at, mem_size, E820_RAM);
} else if (*p == '#') {
start_at = memparse(p+1, from);
add_memory_region(start_at, mem_size, E820_ACPI);
} else if (*p == '$') {
start_at = memparse(p+1, from);
add_memory_region(start_at, mem_size, E820_RESERVED);
} else {
end_user_pfn = (mem_size >> PAGE_SHIFT);
}
p = *from;
}

unsigned long pci_mem_start = 0xaeedbabe;

/*
Expand Down
27 changes: 27 additions & 0 deletions trunk/arch/x86_64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ static __init void parse_cmdline_early (char ** cmdline_p)
{
char c = ' ', *to = command_line, *from = COMMAND_LINE;
int len = 0;
int userdef = 0;

/* Save unparsed command line copy for /proc/cmdline */
memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE);
Expand Down Expand Up @@ -357,6 +358,28 @@ static __init void parse_cmdline_early (char ** cmdline_p)
if (!memcmp(from, "mem=", 4))
parse_memopt(from+4, &from);

if (!memcmp(from, "memmap=", 7)) {
/* exactmap option is for used defined memory */
if (!memcmp(from+7, "exactmap", 8)) {
#ifdef CONFIG_CRASH_DUMP
/* If we are doing a crash dump, we
* still need to know the real mem
* size before original memory map is
* reset.
*/
saved_max_pfn = e820_end_of_ram();
#endif
from += 8+7;
end_pfn_map = 0;
e820.nr_map = 0;
userdef = 1;
}
else {
parse_memmapopt(from+7, &from);
userdef = 1;
}
}

#ifdef CONFIG_NUMA
if (!memcmp(from, "numa=", 5))
numa_setup(from+5);
Expand Down Expand Up @@ -403,6 +426,10 @@ static __init void parse_cmdline_early (char ** cmdline_p)
break;
*(to++) = c;
}
if (userdef) {
printk(KERN_INFO "user-defined physical RAM map:\n");
e820_print_map("user");
}
*to = '\0';
*cmdline_p = command_line;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86_64/e820.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ extern unsigned long e820_hole_size(unsigned long start_pfn,
unsigned long end_pfn);

extern void __init parse_memopt(char *p, char **end);
extern void __init parse_memmapopt(char *p, char **end);

extern struct e820map e820;
#endif/*!__ASSEMBLY__*/
Expand Down

0 comments on commit 0768a2e

Please sign in to comment.