diff options
author | Yinghai Lu <yinghai@kernel.org> | 2010-02-10 04:20:30 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-12 12:42:40 -0500 |
commit | dd645cee7b50b61cb2d05b59eb6027679c437af6 (patch) | |
tree | 7304337cef9df9dd31c2370015dd7b2051175042 /arch/x86/kernel/early_res.c | |
parent | 9b3be9f99203d9a400e8547f0e80f1d8f8e5738c (diff) |
x86: Add find_fw_memmap_area
... so we can move early_res up.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <1265793639-15071-27-git-send-email-yinghai@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/early_res.c')
-rw-r--r-- | arch/x86/kernel/early_res.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/x86/kernel/early_res.c b/arch/x86/kernel/early_res.c index 656cdf86a2fa..1458dc022343 100644 --- a/arch/x86/kernel/early_res.c +++ b/arch/x86/kernel/early_res.c | |||
@@ -7,16 +7,14 @@ | |||
7 | #include <linux/bootmem.h> | 7 | #include <linux/bootmem.h> |
8 | #include <linux/mm.h> | 8 | #include <linux/mm.h> |
9 | 9 | ||
10 | #include <asm/e820.h> | ||
11 | #include <asm/early_res.h> | 10 | #include <asm/early_res.h> |
12 | #include <asm/proto.h> | ||
13 | 11 | ||
14 | /* | 12 | /* |
15 | * Early reserved memory areas. | 13 | * Early reserved memory areas. |
16 | */ | 14 | */ |
17 | /* | 15 | /* |
18 | * need to make sure this one is bigger enough before | 16 | * need to make sure this one is bigger enough before |
19 | * find_e820_area could be used | 17 | * find_fw_memmap_area could be used |
20 | */ | 18 | */ |
21 | #define MAX_EARLY_RES_X 32 | 19 | #define MAX_EARLY_RES_X 32 |
22 | 20 | ||
@@ -180,6 +178,13 @@ void __init reserve_early_overlap_ok(u64 start, u64 end, char *name) | |||
180 | __reserve_early(start, end, name, 1); | 178 | __reserve_early(start, end, name, 1); |
181 | } | 179 | } |
182 | 180 | ||
181 | u64 __init __weak find_fw_memmap_area(u64 start, u64 end, u64 size, u64 align) | ||
182 | { | ||
183 | panic("should have find_fw_memmap_area defined with arch"); | ||
184 | |||
185 | return -1ULL; | ||
186 | } | ||
187 | |||
183 | static void __init __check_and_double_early_res(u64 ex_start, u64 ex_end) | 188 | static void __init __check_and_double_early_res(u64 ex_start, u64 ex_end) |
184 | { | 189 | { |
185 | u64 start, end, size, mem; | 190 | u64 start, end, size, mem; |
@@ -198,13 +203,13 @@ static void __init __check_and_double_early_res(u64 ex_start, u64 ex_end) | |||
198 | start = early_res[0].end; | 203 | start = early_res[0].end; |
199 | end = ex_start; | 204 | end = ex_start; |
200 | if (start + size < end) | 205 | if (start + size < end) |
201 | mem = find_e820_area(start, end, size, | 206 | mem = find_fw_memmap_area(start, end, size, |
202 | sizeof(struct early_res)); | 207 | sizeof(struct early_res)); |
203 | if (mem == -1ULL) { | 208 | if (mem == -1ULL) { |
204 | start = ex_end; | 209 | start = ex_end; |
205 | end = max_pfn_mapped << PAGE_SHIFT; | 210 | end = max_pfn_mapped << PAGE_SHIFT; |
206 | if (start + size < end) | 211 | if (start + size < end) |
207 | mem = find_e820_area(start, end, size, | 212 | mem = find_fw_memmap_area(start, end, size, |
208 | sizeof(struct early_res)); | 213 | sizeof(struct early_res)); |
209 | } | 214 | } |
210 | if (mem == -1ULL) | 215 | if (mem == -1ULL) |
@@ -343,7 +348,7 @@ int __init get_free_all_memory_range(struct range **rangep, int nodeid) | |||
343 | start = MAX_DMA32_PFN << PAGE_SHIFT; | 348 | start = MAX_DMA32_PFN << PAGE_SHIFT; |
344 | #endif | 349 | #endif |
345 | end = max_pfn_mapped << PAGE_SHIFT; | 350 | end = max_pfn_mapped << PAGE_SHIFT; |
346 | mem = find_e820_area(start, end, size, sizeof(struct range)); | 351 | mem = find_fw_memmap_area(start, end, size, sizeof(struct range)); |
347 | if (mem == -1ULL) | 352 | if (mem == -1ULL) |
348 | panic("can not find more space for range free"); | 353 | panic("can not find more space for range free"); |
349 | 354 | ||