memblock, x86: Make ARCH_DISCARD_MEMBLOCK a config option
[deliverable/linux.git] / arch / x86 / mm / memblock.c
CommitLineData
fb74fb6d
YL
1#include <linux/kernel.h>
2#include <linux/types.h>
3#include <linux/init.h>
4#include <linux/bitops.h>
5#include <linux/memblock.h>
6#include <linux/bootmem.h>
7#include <linux/mm.h>
8#include <linux/range.h>
9
9dc5d569
YL
10void __init memblock_x86_reserve_range(u64 start, u64 end, char *name)
11{
12 if (start == end)
13 return;
14
301ff3e8 15 if (WARN_ONCE(start > end, "memblock_x86_reserve_range: wrong range [%#llx, %#llx)\n", start, end))
9dc5d569
YL
16 return;
17
301ff3e8
YL
18 memblock_dbg(" memblock_x86_reserve_range: [%#010llx-%#010llx] %16s\n", start, end - 1, name);
19
9dc5d569
YL
20 memblock_reserve(start, end - start);
21}
22
23void __init memblock_x86_free_range(u64 start, u64 end)
24{
25 if (start == end)
26 return;
27
301ff3e8 28 if (WARN_ONCE(start > end, "memblock_x86_free_range: wrong range [%#llx, %#llx)\n", start, end))
9dc5d569
YL
29 return;
30
301ff3e8
YL
31 memblock_dbg(" memblock_x86_free_range: [%#010llx-%#010llx]\n", start, end - 1);
32
9dc5d569
YL
33 memblock_free(start, end - start);
34}
This page took 0.089339 seconds and 5 git commands to generate.