diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-06-10 15:55:54 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 04:35:38 -0400 |
commit | ab4a465e96adf2f3a8aaa95384bacfa9ab661e35 (patch) | |
tree | a4c72ba76c93ff362b404106f6a6ce756a2075cf /arch/x86/kernel/e820_64.c | |
parent | df5f6c212cc049d1989b5ce71bb863a367c261e9 (diff) |
x86: e820 merge parsing of the mem=/memmap= boot parameters
since we now have 32-bit support for e820_register_active_regions(),
we can merge the parsing of the mem=/memmap= boot parameters.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/e820_64.c')
-rw-r--r-- | arch/x86/kernel/e820_64.c | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c index 0afee2ca0bf8..47952b1690b6 100644 --- a/arch/x86/kernel/e820_64.c +++ b/arch/x86/kernel/e820_64.c | |||
@@ -96,75 +96,6 @@ char *__init machine_specific_memory_setup(void) | |||
96 | return who; | 96 | return who; |
97 | } | 97 | } |
98 | 98 | ||
99 | static int __init parse_memopt(char *p) | ||
100 | { | ||
101 | if (!p) | ||
102 | return -EINVAL; | ||
103 | end_user_pfn = memparse(p, &p); | ||
104 | end_user_pfn >>= PAGE_SHIFT; | ||
105 | return 0; | ||
106 | } | ||
107 | early_param("mem", parse_memopt); | ||
108 | |||
109 | static int userdef __initdata; | ||
110 | |||
111 | static int __init parse_memmap_opt(char *p) | ||
112 | { | ||
113 | char *oldp; | ||
114 | unsigned long long start_at, mem_size; | ||
115 | |||
116 | if (!strcmp(p, "exactmap")) { | ||
117 | #ifdef CONFIG_CRASH_DUMP | ||
118 | /* | ||
119 | * If we are doing a crash dump, we still need to know | ||
120 | * the real mem size before original memory map is | ||
121 | * reset. | ||
122 | */ | ||
123 | e820_register_active_regions(0, 0, -1UL); | ||
124 | saved_max_pfn = e820_end_of_ram(); | ||
125 | remove_all_active_ranges(); | ||
126 | #endif | ||
127 | e820.nr_map = 0; | ||
128 | userdef = 1; | ||
129 | return 0; | ||
130 | } | ||
131 | |||
132 | oldp = p; | ||
133 | mem_size = memparse(p, &p); | ||
134 | if (p == oldp) | ||
135 | return -EINVAL; | ||
136 | |||
137 | userdef = 1; | ||
138 | if (*p == '@') { | ||
139 | start_at = memparse(p+1, &p); | ||
140 | add_memory_region(start_at, mem_size, E820_RAM); | ||
141 | } else if (*p == '#') { | ||
142 | start_at = memparse(p+1, &p); | ||
143 | add_memory_region(start_at, mem_size, E820_ACPI); | ||
144 | } else if (*p == '$') { | ||
145 | start_at = memparse(p+1, &p); | ||
146 | add_memory_region(start_at, mem_size, E820_RESERVED); | ||
147 | } else { | ||
148 | end_user_pfn = (mem_size >> PAGE_SHIFT); | ||
149 | } | ||
150 | return *p == '\0' ? 0 : -EINVAL; | ||
151 | } | ||
152 | early_param("memmap", parse_memmap_opt); | ||
153 | |||
154 | void __init finish_e820_parsing(void) | ||
155 | { | ||
156 | if (userdef) { | ||
157 | int nr = e820.nr_map; | ||
158 | |||
159 | if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr) < 0) | ||
160 | early_panic("Invalid user supplied memory map"); | ||
161 | e820.nr_map = nr; | ||
162 | |||
163 | printk(KERN_INFO "user-defined physical RAM map:\n"); | ||
164 | e820_print_map("user"); | ||
165 | } | ||
166 | } | ||
167 | |||
168 | int __init arch_get_ram_range(int slot, u64 *addr, u64 *size) | 99 | int __init arch_get_ram_range(int slot, u64 *addr, u64 *size) |
169 | { | 100 | { |
170 | int i; | 101 | int i; |