summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAKASHI Takahiro <takahiro.akashi@linaro.org>2017-04-03 11:23:54 +0900
committerCatalin Marinas <catalin.marinas@arm.com>2017-04-05 18:26:46 +0100
commit4c546b8a34690ca858e50f2017b8bb6e358365d1 (patch)
tree538554955b542d534790f0aa96ff8c101baeb444 /mm
parentdffb0113d522a1410dbc136281caf7b6751ec6f4 (diff)
downloadlinux-4c546b8a34690ca858e50f2017b8bb6e358365d1.tar.gz
linux-4c546b8a34690ca858e50f2017b8bb6e358365d1.tar.bz2
linux-4c546b8a34690ca858e50f2017b8bb6e358365d1.zip
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 696f06d17c4e..2f4ca8104ea4 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -805,6 +805,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