summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2017-04-03 02:23:54 (GMT)
committerAKASHI Takahiro <takahiro.akashi@linaro.org>2017-06-08 09:39:16 (GMT)
commit3acb7bc37d56d5dc80112459c0d72c6be8bde3c9 (patch)
treea6a0671add3ced365b02c4ca175bca72720e6767 /mm
parentf1aa865ae5d4608cbfbb02f42baa1ef5ed95fce2 (diff)
downloadlinux-3acb7bc37d56d5dc80112459c0d72c6be8bde3c9.tar.xz
memblock: add memblock_clear_nomap()
This function, with a combination of memblock_mark_nomap(), will be used in a later kdump patch for arm64 when it temporarily isolates some range of memory from the other memory blocks in order to create a specific kernel mapping at boot time. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/memblock.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index 68849d0..183fd46 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -814,6 +814,18 @@ int __init_memblock memblock_mark_nomap(phys_addr_t base, phys_addr_t size)
}
/**
+ * memblock_clear_nomap - Clear flag MEMBLOCK_NOMAP for a specified region.
+ * @base: the base phys addr of the region
+ * @size: the size of the region
+ *
+ * Return 0 on success, -errno on failure.
+ */
+int __init_memblock memblock_clear_nomap(phys_addr_t base, phys_addr_t size)
+{
+ return memblock_setclr_flag(base, size, 0, MEMBLOCK_NOMAP);
+}
+
+/**
* __next_reserved_mem_region - next function for for_each_reserved_region()
* @idx: pointer to u64 loop variable
* @out_start: ptr to phys_addr_t for start address of the region, can be %NULL