aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 856f0ee7e84a..c0402da7cce0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -937,6 +937,53 @@ extern void free_area_init(unsigned long * zones_size);
937extern void free_area_init_node(int nid, pg_data_t *pgdat, 937extern void free_area_init_node(int nid, pg_data_t *pgdat,
938 unsigned long * zones_size, unsigned long zone_start_pfn, 938 unsigned long * zones_size, unsigned long zone_start_pfn,
939 unsigned long *zholes_size); 939 unsigned long *zholes_size);
940#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
941/*
942 * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its
943 * zones, allocate the backing mem_map and account for memory holes in a more
944 * architecture independent manner. This is a substitute for creating the
945 * zone_sizes[] and zholes_size[] arrays and passing them to
946 * free_area_init_node()
947 *
948 * An architecture is expected to register range of page frames backed by
949 * physical memory with add_active_range() before calling
950 * free_area_init_nodes() passing in the PFN each zone ends at. At a basic
951 * usage, an architecture is expected to do something like
952 *
953 * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn,
954 * max_highmem_pfn};
955 * for_each_valid_physical_page_range()
956 * add_active_range(node_id, start_pfn, end_pfn)
957 * free_area_init_nodes(max_zone_pfns);
958 *
959 * If the architecture guarantees that there are no holes in the ranges
960 * registered with add_active_range(), free_bootmem_active_regions()
961 * will call free_bootmem_node() for each registered physical page range.
962 * Similarly sparse_memory_present_with_active_regions() calls
963 * memory_present() for each range when SPARSEMEM is enabled.
964 *
965 * See mm/page_alloc.c for more information on each function exposed by
966 * CONFIG_ARCH_POPULATES_NODE_MAP
967 */
968extern void free_area_init_nodes(unsigned long *max_zone_pfn);
969extern void add_active_range(unsigned int nid, unsigned long start_pfn,
970 unsigned long end_pfn);
971extern void shrink_active_range(unsigned int nid, unsigned long old_end_pfn,
972 unsigned long new_end_pfn);
973extern void remove_all_active_ranges(void);
974extern unsigned long absent_pages_in_range(unsigned long start_pfn,
975 unsigned long end_pfn);
976extern void get_pfn_range_for_nid(unsigned int nid,
977 unsigned long *start_pfn, unsigned long *end_pfn);
978extern unsigned long find_min_pfn_with_active_regions(void);
979extern unsigned long find_max_pfn_with_active_regions(void);
980extern void free_bootmem_with_active_regions(int nid,
981 unsigned long max_low_pfn);
982extern void sparse_memory_present_with_active_regions(int nid);
983#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
984extern int early_pfn_to_nid(unsigned long pfn);
985#endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */
986#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
940extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); 987extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long);
941extern void setup_per_zone_pages_min(void); 988extern void setup_per_zone_pages_min(void);
942extern void mem_init(void); 989extern void mem_init(void);