aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memblock.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-12-08 13:22:09 -0500
committerTejun Heo <tj@kernel.org>2011-12-08 13:22:09 -0500
commit0ee332c1451869963626bf9cac88f165a90990e1 (patch)
treea40e6c9c6cfe39ecbca37a08019be3c9e56a4a9b /include/linux/memblock.h
parenta2bf79e7dcc97b4e9654f273453f9264f49e41ff (diff)
memblock: Kill early_node_map[]
Now all ARCH_POPULATES_NODE_MAP archs select HAVE_MEBLOCK_NODE_MAP - there's no user of early_node_map[] left. Kill early_node_map[] and replace ARCH_POPULATES_NODE_MAP with HAVE_MEMBLOCK_NODE_MAP. Also, relocate for_each_mem_pfn_range() and helper from mm.h to memblock.h as page_alloc.c would no longer host an alternative implementation. This change is ultimately one to one mapping and shouldn't cause any observable difference; however, after the recent changes, there are some functions which now would fit memblock.c better than page_alloc.c and dependency on HAVE_MEMBLOCK_NODE_MAP instead of HAVE_MEMBLOCK doesn't make much sense on some of them. Further cleanups for functions inside HAVE_MEMBLOCK_NODE_MAP in mm.h would be nice. -v2: Fix compile bug introduced by mis-spelling CONFIG_HAVE_MEMBLOCK_NODE_MAP to CONFIG_MEMBLOCK_HAVE_NODE_MAP in mmzone.h. Reported by Stephen Rothwell. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Chen Liqin <liqin.chen@sunplusct.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: "H. Peter Anvin" <hpa@zytor.com>
Diffstat (limited to 'include/linux/memblock.h')
-rw-r--r--include/linux/memblock.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index c7b68f489d46..cd7606b71e5a 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -58,6 +58,26 @@ int memblock_remove(phys_addr_t base, phys_addr_t size);
58int memblock_free(phys_addr_t base, phys_addr_t size); 58int memblock_free(phys_addr_t base, phys_addr_t size);
59int memblock_reserve(phys_addr_t base, phys_addr_t size); 59int memblock_reserve(phys_addr_t base, phys_addr_t size);
60 60
61#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
62void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
63 unsigned long *out_end_pfn, int *out_nid);
64
65/**
66 * for_each_mem_pfn_range - early memory pfn range iterator
67 * @i: an integer used as loop variable
68 * @nid: node selector, %MAX_NUMNODES for all nodes
69 * @p_start: ptr to ulong for start pfn of the range, can be %NULL
70 * @p_end: ptr to ulong for end pfn of the range, can be %NULL
71 * @p_nid: ptr to int for nid of the range, can be %NULL
72 *
73 * Walks over configured memory ranges. Available after early_node_map is
74 * populated.
75 */
76#define for_each_mem_pfn_range(i, nid, p_start, p_end, p_nid) \
77 for (i = -1, __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid); \
78 i >= 0; __next_mem_pfn_range(&i, nid, p_start, p_end, p_nid))
79#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
80
61void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start, 81void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start,
62 phys_addr_t *out_end, int *out_nid); 82 phys_addr_t *out_end, int *out_nid);
63 83
@@ -101,9 +121,6 @@ static inline int memblock_get_region_node(const struct memblock_region *r)
101} 121}
102#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ 122#endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */
103 123
104/* The numa aware allocator is only available if
105 * CONFIG_ARCH_POPULATES_NODE_MAP is set
106 */
107phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end, 124phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end,
108 phys_addr_t size, phys_addr_t align, int nid); 125 phys_addr_t size, phys_addr_t align, int nid);
109phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid); 126phys_addr_t memblock_alloc_nid(phys_addr_t size, phys_addr_t align, int nid);