summaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/memblock.c
diff options
context:
space:
mode:
authorYinghai Lu2010-08-25 22:39:15 +0200
committerH. Peter Anvin2010-08-27 20:10:41 +0200
commit9dc5d569c133819c1ce069ebb1d771c62de32580 (patch)
tree8040a307b9b448d092dfd7ef8f56fc6b08d26cab /arch/x86/mm/memblock.c
parentx86, memblock: Add memblock_x86_to_bootmem() (diff)
downloadkernel-qcow2-linux-9dc5d569c133819c1ce069ebb1d771c62de32580.tar.gz
kernel-qcow2-linux-9dc5d569c133819c1ce069ebb1d771c62de32580.tar.xz
kernel-qcow2-linux-9dc5d569c133819c1ce069ebb1d771c62de32580.zip
x86, memblock: Add memblock_x86_reserve_range/memblock_x86_free_range
They are wrappers for core versions, which take start/end/name instead of base/size. This will make x86 conversion eaasier. could add more debug print out -v2: change get_max_mapped() to memblock.default_alloc_limit according to Michael Ellerman and Ben change to memblock_x86_reserve_range and memblock_x86_free_range according to Michael Ellerman -v3: call check_and_double after reserve/free, so could avoid to use find_memblock_area. Suggested by Michael Ellerman Signed-off-by: Yinghai Lu <yinghai@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/mm/memblock.c')
-rw-r--r--arch/x86/mm/memblock.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/mm/memblock.c b/arch/x86/mm/memblock.c
index 8101084d452a..9829eaf1dbda 100644
--- a/arch/x86/mm/memblock.c
+++ b/arch/x86/mm/memblock.c
@@ -114,3 +114,25 @@ void __init memblock_x86_to_bootmem(u64 start, u64 end)
memblock_reserve_reserved_regions();
}
#endif
+
+void __init memblock_x86_reserve_range(u64 start, u64 end, char *name)
+{
+ if (start == end)
+ return;
+
+ if (WARN_ONCE(start > end, "memblock_x86_reserve_range: wrong range [%#llx, %#llx]\n", start, end))
+ return;
+
+ memblock_reserve(start, end - start);
+}
+
+void __init memblock_x86_free_range(u64 start, u64 end)
+{
+ if (start == end)
+ return;
+
+ if (WARN_ONCE(start > end, "memblock_x86_free_range: wrong range [%#llx, %#llx]\n", start, end))
+ return;
+
+ memblock_free(start, end - start);
+}