aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memblock.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2015-11-30 07:28:15 -0500
committerWill Deacon <will.deacon@arm.com>2015-12-09 11:56:58 -0500
commitbf3d3cc580f9960883ebf9ea05868f336d9491c2 (patch)
treebffaba5a78b9c022716fae0977f6d0f6d88941bb /include/linux/memblock.h
parent31ade3b83e1821da5fbb2f11b5b3d4ab2ec39db8 (diff)
mm/memblock: add MEMBLOCK_NOMAP attribute to memblock memory table
This introduces the MEMBLOCK_NOMAP attribute and the required plumbing to make it usable as an indicator that some parts of normal memory should not be covered by the kernel direct mapping. It is up to the arch to actually honor the attribute when laying out this mapping, but the memblock code itself is modified to disregard these regions for allocations and other general use. Cc: linux-mm@kvack.org Cc: Alexander Kuleshov <kuleshovmail@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/linux/memblock.h')
-rw-r--r--include/linux/memblock.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 24daf8fc4d7c..fec66f86eeff 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -25,6 +25,7 @@ enum {
25 MEMBLOCK_NONE = 0x0, /* No special request */ 25 MEMBLOCK_NONE = 0x0, /* No special request */
26 MEMBLOCK_HOTPLUG = 0x1, /* hotpluggable region */ 26 MEMBLOCK_HOTPLUG = 0x1, /* hotpluggable region */
27 MEMBLOCK_MIRROR = 0x2, /* mirrored region */ 27 MEMBLOCK_MIRROR = 0x2, /* mirrored region */
28 MEMBLOCK_NOMAP = 0x4, /* don't add to kernel direct mapping */
28}; 29};
29 30
30struct memblock_region { 31struct memblock_region {
@@ -82,6 +83,7 @@ bool memblock_overlaps_region(struct memblock_type *type,
82int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size); 83int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size);
83int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size); 84int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size);
84int memblock_mark_mirror(phys_addr_t base, phys_addr_t size); 85int memblock_mark_mirror(phys_addr_t base, phys_addr_t size);
86int memblock_mark_nomap(phys_addr_t base, phys_addr_t size);
85ulong choose_memblock_flags(void); 87ulong choose_memblock_flags(void);
86 88
87/* Low level functions */ 89/* Low level functions */
@@ -184,6 +186,11 @@ static inline bool memblock_is_mirror(struct memblock_region *m)
184 return m->flags & MEMBLOCK_MIRROR; 186 return m->flags & MEMBLOCK_MIRROR;
185} 187}
186 188
189static inline bool memblock_is_nomap(struct memblock_region *m)
190{
191 return m->flags & MEMBLOCK_NOMAP;
192}
193
187#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 194#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
188int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn, 195int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
189 unsigned long *end_pfn); 196 unsigned long *end_pfn);
@@ -319,6 +326,7 @@ phys_addr_t memblock_start_of_DRAM(void);
319phys_addr_t memblock_end_of_DRAM(void); 326phys_addr_t memblock_end_of_DRAM(void);
320void memblock_enforce_memory_limit(phys_addr_t memory_limit); 327void memblock_enforce_memory_limit(phys_addr_t memory_limit);
321int memblock_is_memory(phys_addr_t addr); 328int memblock_is_memory(phys_addr_t addr);
329int memblock_is_map_memory(phys_addr_t addr);
322int memblock_is_region_memory(phys_addr_t base, phys_addr_t size); 330int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
323int memblock_is_reserved(phys_addr_t addr); 331int memblock_is_reserved(phys_addr_t addr);
324bool memblock_is_region_reserved(phys_addr_t base, phys_addr_t size); 332bool memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);