2010-08-26 03:39:15 +07:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/bitops.h>
|
|
|
|
#include <linux/memblock.h>
|
|
|
|
#include <linux/bootmem.h>
|
|
|
|
#include <linux/mm.h>
|
|
|
|
#include <linux/range.h>
|
|
|
|
|
2010-08-26 03:39:15 +07:00
|
|
|
void __init memblock_x86_reserve_range(u64 start, u64 end, char *name)
|
|
|
|
{
|
|
|
|
if (start == end)
|
|
|
|
return;
|
|
|
|
|
2010-08-26 03:39:17 +07:00
|
|
|
if (WARN_ONCE(start > end, "memblock_x86_reserve_range: wrong range [%#llx, %#llx)\n", start, end))
|
2010-08-26 03:39:15 +07:00
|
|
|
return;
|
|
|
|
|
2010-08-26 03:39:17 +07:00
|
|
|
memblock_dbg(" memblock_x86_reserve_range: [%#010llx-%#010llx] %16s\n", start, end - 1, name);
|
|
|
|
|
2010-08-26 03:39:15 +07:00
|
|
|
memblock_reserve(start, end - start);
|
|
|
|
}
|
|
|
|
|
|
|
|
void __init memblock_x86_free_range(u64 start, u64 end)
|
|
|
|
{
|
|
|
|
if (start == end)
|
|
|
|
return;
|
|
|
|
|
2010-08-26 03:39:17 +07:00
|
|
|
if (WARN_ONCE(start > end, "memblock_x86_free_range: wrong range [%#llx, %#llx)\n", start, end))
|
2010-08-26 03:39:15 +07:00
|
|
|
return;
|
|
|
|
|
2010-08-26 03:39:17 +07:00
|
|
|
memblock_dbg(" memblock_x86_free_range: [%#010llx-%#010llx]\n", start, end - 1);
|
|
|
|
|
2010-08-26 03:39:15 +07:00
|
|
|
memblock_free(start, end - start);
|
|
|
|
}
|