aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/setup.c
diff options
context:
space:
mode:
authorbibo,mao <bibo.mao@intel.com>2006-12-06 20:14:06 -0500
committerAndi Kleen <andi@basil.nowhere.org>2006-12-06 20:14:06 -0500
commitb2dff6a88cbed59d787a8ca7367c76ba385e1187 (patch)
treecc0d407ac764eda23f09181b447ce5d347d73ad5 /arch/i386/kernel/setup.c
parent8e3342f736dd1c19ce7c28625dedd7d8730fc7ad (diff)
[PATCH] i386: Move find_max_pfn function to e820.c
Move more code from setup.c into e820.c Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386/kernel/setup.c')
-rw-r--r--arch/i386/kernel/setup.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index b7509aec0eb1..3d808054fdf7 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -63,9 +63,6 @@
63#include <setup_arch.h> 63#include <setup_arch.h>
64#include <bios_ebda.h> 64#include <bios_ebda.h>
65 65
66/* Forward Declaration. */
67void __init find_max_pfn(void);
68
69/* This value is set up by the early boot code to point to the value 66/* This value is set up by the early boot code to point to the value
70 immediately after the boot time page tables. It contains a *physical* 67 immediately after the boot time page tables. It contains a *physical*
71 address, and must not be in the .bss segment! */ 68 address, and must not be in the .bss segment! */
@@ -387,29 +384,6 @@ static int __init parse_reservetop(char *arg)
387} 384}
388early_param("reservetop", parse_reservetop); 385early_param("reservetop", parse_reservetop);
389 386
390/*
391 * Callback for efi_memory_walk.
392 */
393static int __init
394efi_find_max_pfn(unsigned long start, unsigned long end, void *arg)
395{
396 unsigned long *max_pfn = arg, pfn;
397
398 if (start < end) {
399 pfn = PFN_UP(end -1);
400 if (pfn > *max_pfn)
401 *max_pfn = pfn;
402 }
403 return 0;
404}
405
406static int __init
407efi_memory_present_wrapper(unsigned long start, unsigned long end, void *arg)
408{
409 memory_present(0, PFN_UP(start), PFN_DOWN(end));
410 return 0;
411}
412
413 /* 387 /*
414 * This function checks if the entire range <start,end> is mapped with type. 388 * This function checks if the entire range <start,end> is mapped with type.
415 * 389 *
@@ -443,35 +417,6 @@ e820_all_mapped(unsigned long s, unsigned long e, unsigned type)
443} 417}
444 418
445/* 419/*
446 * Find the highest page frame number we have available
447 */
448void __init find_max_pfn(void)
449{
450 int i;
451
452 max_pfn = 0;
453 if (efi_enabled) {
454 efi_memmap_walk(efi_find_max_pfn, &max_pfn);
455 efi_memmap_walk(efi_memory_present_wrapper, NULL);
456 return;
457 }
458
459 for (i = 0; i < e820.nr_map; i++) {
460 unsigned long start, end;
461 /* RAM? */
462 if (e820.map[i].type != E820_RAM)
463 continue;
464 start = PFN_UP(e820.map[i].addr);
465 end = PFN_DOWN(e820.map[i].addr + e820.map[i].size);
466 if (start >= end)
467 continue;
468 if (end > max_pfn)
469 max_pfn = end;
470 memory_present(0, start, end);
471 }
472}
473
474/*
475 * Determine low and high memory ranges: 420 * Determine low and high memory ranges:
476 */ 421 */
477unsigned long __init find_max_low_pfn(void) 422unsigned long __init find_max_low_pfn(void)