summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/setup.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2013-01-24 12:20:09 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2013-01-29 19:32:57 -0800
commit595ad9af8584908ea5fb698b836169d05b99f186 (patch)
tree851492cc2fa5c02b4b5122b7af154f7a8d7777c3 /arch/x86/kernel/setup.c
parentd1af6d045fba6b070fa81f54dfe9227214be99ea (diff)
downloadblackbird-op-linux-595ad9af8584908ea5fb698b836169d05b99f186.tar.gz
blackbird-op-linux-595ad9af8584908ea5fb698b836169d05b99f186.zip
memblock: Add memblock_mem_size()
Use it to get mem size under the limit_pfn. to replace local version in x86 reserved_initrd. -v2: remove not needed cast that is pointed out by HPA. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Link: http://lkml.kernel.org/r/1359058816-7615-29-git-send-email-yinghai@kernel.org Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r--arch/x86/kernel/setup.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index b80bee10982f..bbe8cdf7515e 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -363,20 +363,6 @@ static void __init relocate_initrd(void)
ramdisk_here, ramdisk_here + ramdisk_size - 1);
}
-static u64 __init get_mem_size(unsigned long limit_pfn)
-{
- int i;
- u64 mapped_pages = 0;
- unsigned long start_pfn, end_pfn;
-
- for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, NULL) {
- start_pfn = min_t(unsigned long, start_pfn, limit_pfn);
- end_pfn = min_t(unsigned long, end_pfn, limit_pfn);
- mapped_pages += end_pfn - start_pfn;
- }
-
- return mapped_pages << PAGE_SHIFT;
-}
static void __init early_reserve_initrd(void)
{
/* Assume only end is not page aligned */
@@ -404,7 +390,7 @@ static void __init reserve_initrd(void)
initrd_start = 0;
- mapped_size = get_mem_size(max_pfn_mapped);
+ mapped_size = memblock_mem_size(max_pfn_mapped);
if (ramdisk_size >= (mapped_size>>1))
panic("initrd too large to handle, "
"disabling initrd (%lld needed, %lld available)\n",
OpenPOWER on IntegriCloud