1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LINUX_BOOTMEM_INFO_H
3 #define __LINUX_BOOTMEM_INFO_H
8 * Types for free bootmem stored in page->lru.next. These have to be in
9 * some random range in unsigned long space for debugging purposes.
12 MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE = 12,
13 SECTION_INFO = MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE,
16 MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO,
19 #ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE
20 void __init register_page_bootmem_info_node(struct pglist_data *pgdat);
22 void get_page_bootmem(unsigned long info, struct page *page,
24 void put_page_bootmem(struct page *page);
27 * Any memory allocated via the memblock allocator and not via the
28 * buddy will be marked reserved already in the memmap. For those
29 * pages, we can call this function to free it to buddy allocator.
31 static inline void free_bootmem_page(struct page *page)
33 unsigned long magic = page->index;
36 * The reserve_bootmem_region sets the reserved flag on bootmem
39 VM_BUG_ON_PAGE(page_ref_count(page) != 2, page);
41 if (magic == SECTION_INFO || magic == MIX_SECTION_INFO)
42 put_page_bootmem(page);
44 VM_BUG_ON_PAGE(1, page);
47 static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
51 static inline void put_page_bootmem(struct page *page)
55 static inline void get_page_bootmem(unsigned long info, struct page *page,
60 static inline void free_bootmem_page(struct page *page)
62 free_reserved_page(page);
66 #endif /* __LINUX_BOOTMEM_INFO_H */