summaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2010-08-25 13:39:16 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-08-27 11:10:57 -0700
commit6bcc8176d07f108da3b1af17fb2c0e82c80e948e (patch)
tree8e9f969a3e55e32180a45bac701dc56512da1ac6 /arch/x86/mm
parentedbe7d23b4482e7f33179290bcff3b1feae1c5f3 (diff)
downloadlinux-6bcc8176d07f108da3b1af17fb2c0e82c80e948e.tar.gz
linux-6bcc8176d07f108da3b1af17fb2c0e82c80e948e.tar.bz2
linux-6bcc8176d07f108da3b1af17fb2c0e82c80e948e.zip
x86, memblock: Add memblock_x86_find_in_range_node()
It can be used to find NODE_DATA for numa. Need to make sure early_node_map[] is filled before it is called, otherwise it will fallback to memblock_find_in_range(), with node range. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/memblock.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/mm/memblock.c b/arch/x86/mm/memblock.c
index 53a7a5aebd6b..22ff0a39b227 100644
--- a/arch/x86/mm/memblock.c
+++ b/arch/x86/mm/memblock.c
@@ -234,6 +234,21 @@ void __init memblock_x86_free_range(u64 start, u64 end)
}
/*
+ * Need to call this function after memblock_x86_register_active_regions,
+ * so early_node_map[] is filled already.
+ */
+u64 __init memblock_x86_find_in_range_node(int nid, u64 start, u64 end, u64 size, u64 align)
+{
+ u64 addr;
+ addr = find_memory_core_early(nid, size, align, start, end);
+ if (addr != MEMBLOCK_ERROR)
+ return addr;
+
+ /* Fallback, should already have start end within node range */
+ return memblock_find_in_range(start, end, size, align);
+}
+
+/*
* Finds an active region in the address range from start_pfn to last_pfn and
* returns its range in ei_startpfn and ei_endpfn for the memblock entry.
*/