aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/early_res.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2010-02-10 04:20:26 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-02-12 12:42:39 -0500
commitefdd0e81df0f23830c6d2cb971cf87f415b8dbdb (patch)
tree377941fbfeee4cd887ace1de0826a8df03aa965c /arch/x86/kernel/early_res.c
parent7da657d1f1dd27fa9d8289d5f7e53479c7fd3a95 (diff)
x86: Move back find_e820_area to e820.c
Makes early_res.c more clean, so later could move it to /kernel. Signed-off-by: Yinghai Lu <yinghai@kernel.org> LKML-Reference: <1265793639-15071-23-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.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/arch/x86/kernel/early_res.c b/arch/x86/kernel/early_res.c
index bfa1ba705d48..1b99a2619f9f 100644
--- a/arch/x86/kernel/early_res.c
+++ b/arch/x86/kernel/early_res.c
@@ -498,60 +498,3 @@ u64 __init find_early_area_size(u64 ei_start, u64 ei_last, u64 start,
498out: 498out:
499 return -1ULL; 499 return -1ULL;
500} 500}
501
502/*
503 * Find a free area with specified alignment in a specific range.
504 */
505u64 __init find_e820_area(u64 start, u64 end, u64 size, u64 align)
506{
507 int i;
508
509 for (i = 0; i < e820.nr_map; i++) {
510 struct e820entry *ei = &e820.map[i];
511 u64 addr;
512 u64 ei_start, ei_last;
513
514 if (ei->type != E820_RAM)
515 continue;
516
517 ei_last = ei->addr + ei->size;
518 ei_start = ei->addr;
519 addr = find_early_area(ei_start, ei_last, start, end,
520 size, align);
521
522 if (addr == -1ULL)
523 continue;
524
525 return addr;
526 }
527 return -1ULL;
528}
529
530/*
531 * Find next free range after *start
532 */
533u64 __init find_e820_area_size(u64 start, u64 *sizep, u64 align)
534{
535 int i;
536
537 for (i = 0; i < e820.nr_map; i++) {
538 struct e820entry *ei = &e820.map[i];
539 u64 addr;
540 u64 ei_start, ei_last;
541
542 if (ei->type != E820_RAM)
543 continue;
544
545 ei_last = ei->addr + ei->size;
546 ei_start = ei->addr;
547 addr = find_early_area_size(ei_start, ei_last, start,
548 sizep, align);
549
550 if (addr == -1ULL)
551 continue;
552
553 return addr;
554 }
555
556 return -1ULL;
557}