diff options
author | Andi Kleen <ak@suse.de> | 2006-09-26 04:52:32 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:32 -0400 |
commit | 2c8c0e6b8d7700a990da8d24eff767f9ca223b96 (patch) | |
tree | b5477ee2558efff235c483d1619ce892db479d18 /arch/x86_64/kernel/e820.c | |
parent | 1a3f239ddf9208f2e52d36fef1c1c4518cbbbabe (diff) |
[PATCH] Convert x86-64 to early param
Instead of hackish manual parsing
Requires earlier i386 patchkit, but also fixes i386 early_printk again.
I removed some obsolete really early parameters which didn't do anything useful.
Also made a few parameters that needed it early (mostly oops printing setup)
Also removed one panic check that wasn't visible without
early console anyways (the early console is now initialized after that
panic)
This cleans up a lot of code.
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/x86_64/kernel/e820.c')
-rw-r--r-- | arch/x86_64/kernel/e820.c | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c index 1362aad4f3aa..a4739dc82937 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c | |||
@@ -596,31 +596,64 @@ void __init setup_memory_region(void) | |||
596 | e820_print_map(who); | 596 | e820_print_map(who); |
597 | } | 597 | } |
598 | 598 | ||
599 | void __init parse_memopt(char *p, char **from) | 599 | static int __init parse_memopt(char *p) |
600 | { | 600 | { |
601 | end_user_pfn = memparse(p, from); | 601 | if (!p) |
602 | return -EINVAL; | ||
603 | end_user_pfn = memparse(p, &p); | ||
602 | end_user_pfn >>= PAGE_SHIFT; | 604 | end_user_pfn >>= PAGE_SHIFT; |
605 | return 0; | ||
603 | } | 606 | } |
607 | early_param("mem", parse_memopt); | ||
608 | |||
609 | static int userdef __initdata; | ||
604 | 610 | ||
605 | void __init parse_memmapopt(char *p, char **from) | 611 | static int __init parse_memmap_opt(char *p) |
606 | { | 612 | { |
613 | char *oldp; | ||
607 | unsigned long long start_at, mem_size; | 614 | unsigned long long start_at, mem_size; |
608 | 615 | ||
609 | mem_size = memparse(p, from); | 616 | if (!strcmp(p, "exactmap")) { |
610 | p = *from; | 617 | #ifdef CONFIG_CRASH_DUMP |
618 | /* If we are doing a crash dump, we | ||
619 | * still need to know the real mem | ||
620 | * size before original memory map is | ||
621 | * reset. | ||
622 | */ | ||
623 | saved_max_pfn = e820_end_of_ram(); | ||
624 | #endif | ||
625 | end_pfn_map = 0; | ||
626 | e820.nr_map = 0; | ||
627 | userdef = 1; | ||
628 | return 0; | ||
629 | } | ||
630 | |||
631 | oldp = p; | ||
632 | mem_size = memparse(p, &p); | ||
633 | if (p == oldp) | ||
634 | return -EINVAL; | ||
611 | if (*p == '@') { | 635 | if (*p == '@') { |
612 | start_at = memparse(p+1, from); | 636 | start_at = memparse(p+1, &p); |
613 | add_memory_region(start_at, mem_size, E820_RAM); | 637 | add_memory_region(start_at, mem_size, E820_RAM); |
614 | } else if (*p == '#') { | 638 | } else if (*p == '#') { |
615 | start_at = memparse(p+1, from); | 639 | start_at = memparse(p+1, &p); |
616 | add_memory_region(start_at, mem_size, E820_ACPI); | 640 | add_memory_region(start_at, mem_size, E820_ACPI); |
617 | } else if (*p == '$') { | 641 | } else if (*p == '$') { |
618 | start_at = memparse(p+1, from); | 642 | start_at = memparse(p+1, &p); |
619 | add_memory_region(start_at, mem_size, E820_RESERVED); | 643 | add_memory_region(start_at, mem_size, E820_RESERVED); |
620 | } else { | 644 | } else { |
621 | end_user_pfn = (mem_size >> PAGE_SHIFT); | 645 | end_user_pfn = (mem_size >> PAGE_SHIFT); |
622 | } | 646 | } |
623 | p = *from; | 647 | return *p == '\0' ? 0 : -EINVAL; |
648 | } | ||
649 | early_param("memmap", parse_memmap_opt); | ||
650 | |||
651 | void finish_e820_parsing(void) | ||
652 | { | ||
653 | if (userdef) { | ||
654 | printk(KERN_INFO "user-defined physical RAM map:\n"); | ||
655 | e820_print_map("user"); | ||
656 | } | ||
624 | } | 657 | } |
625 | 658 | ||
626 | unsigned long pci_mem_start = 0xaeedbabe; | 659 | unsigned long pci_mem_start = 0xaeedbabe; |