memblock, mem_hotplug: introduce MEMBLOCK_HOTPLUG flag to mark hotpluggable regions
[linux-drm-fsl-dcu.git] / include / linux / memblock.h
index 9a805ec6e7942b6e72288687c0152392bd99f038..b788faa71563cb88e90c76e17d5e7c5e5aae95c1 100644 (file)
@@ -19,6 +19,9 @@
 
 #define INIT_MEMBLOCK_REGIONS  128
 
+/* Definition of memblock flags. */
+#define MEMBLOCK_HOTPLUG       0x1     /* hotpluggable region */
+
 struct memblock_region {
        phys_addr_t base;
        phys_addr_t size;
@@ -60,6 +63,8 @@ int memblock_remove(phys_addr_t base, phys_addr_t size);
 int memblock_free(phys_addr_t base, phys_addr_t size);
 int memblock_reserve(phys_addr_t base, phys_addr_t size);
 void memblock_trim_memory(phys_addr_t align);
+int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size);
+int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size);
 
 #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
 int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
@@ -122,6 +127,18 @@ void __next_free_mem_range_rev(u64 *idx, int nid, phys_addr_t *out_start,
             i != (u64)ULLONG_MAX;                                      \
             __next_free_mem_range_rev(&i, nid, p_start, p_end, p_nid))
 
+static inline void memblock_set_region_flags(struct memblock_region *r,
+                                            unsigned long flags)
+{
+       r->flags |= flags;
+}
+
+static inline void memblock_clear_region_flags(struct memblock_region *r,
+                                              unsigned long flags)
+{
+       r->flags &= ~flags;
+}
+
 #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
 int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid);