summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-12-22 12:53:32 (GMT)
committerRussell King <rmk+kernel@arm.linux.org.uk>2016-01-04 11:25:05 (GMT)
commit06312f44ad638c02e26c5f187c9ee8f94cbaa3a2 (patch)
tree4daf83fefd042acc133d5063a0e365a2912d175b /mm
parent527e9316f8ec44bd53d90fb9f611fa7ffff52bb9 (diff)
parent81a0bc39ea1960bbf8ece6a895d7cfd2d9efa28a (diff)
downloadlinux-06312f44ad638c02e26c5f187c9ee8f94cbaa3a2.tar.xz
Merge tag 'arm32-efi-for-v4.5' of git://git.linaro.org/people/ard.biesheuvel/linux-arm into devel-stable
This implements UEFI kernel support for 32-bit ARM, based on the existing arm64 support and existing generic early ioremap support. It is based on commit f7d924894265 ("arm64/efi: refactor EFI init and runtime code for reuse by 32-bit ARM"), which was pulled from the arm64 repo [1] as branch 'aarch64/efi' [1] git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
Diffstat (limited to 'mm')
-rw-r--r--mm/memblock.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index d300f13..07ff069 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -822,6 +822,17 @@ int __init_memblock memblock_mark_mirror(phys_addr_t base, phys_addr_t size)
return memblock_setclr_flag(base, size, 1, MEMBLOCK_MIRROR);
}
+/**
+ * memblock_mark_nomap - Mark a memory region with flag MEMBLOCK_NOMAP.
+ * @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_mark_nomap(phys_addr_t base, phys_addr_t size)
+{
+ return memblock_setclr_flag(base, size, 1, MEMBLOCK_NOMAP);
+}
/**
* __next_reserved_mem_region - next function for for_each_reserved_region()
@@ -913,6 +924,10 @@ void __init_memblock __next_mem_range(u64 *idx, int nid, ulong flags,
if ((flags & MEMBLOCK_MIRROR) && !memblock_is_mirror(m))
continue;
+ /* skip nomap memory unless we were asked for it explicitly */
+ if (!(flags & MEMBLOCK_NOMAP) && memblock_is_nomap(m))
+ continue;
+
if (!type_b) {
if (out_start)
*out_start = m_start;
@@ -1022,6 +1037,10 @@ void __init_memblock __next_mem_range_rev(u64 *idx, int nid, ulong flags,
if ((flags & MEMBLOCK_MIRROR) && !memblock_is_mirror(m))
continue;
+ /* skip nomap memory unless we were asked for it explicitly */
+ if (!(flags & MEMBLOCK_NOMAP) && memblock_is_nomap(m))
+ continue;
+
if (!type_b) {
if (out_start)
*out_start = m_start;
@@ -1519,6 +1538,15 @@ int __init_memblock memblock_is_memory(phys_addr_t addr)
return memblock_search(&memblock.memory, addr) != -1;
}
+int __init_memblock memblock_is_map_memory(phys_addr_t addr)
+{
+ int i = memblock_search(&memblock.memory, addr);
+
+ if (i == -1)
+ return false;
+ return !memblock_is_nomap(&memblock.memory.regions[i]);
+}
+
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
unsigned long *start_pfn, unsigned long *end_pfn)