1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_SPARSEMEM_H
3 #define _ASM_POWERPC_SPARSEMEM_H 1
6 #ifdef CONFIG_SPARSEMEM
8 * SECTION_SIZE_BITS 2^N: how big each section will be
9 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
11 #define SECTION_SIZE_BITS 24
13 * If we store section details in page->flags we can't increase the MAX_PHYSMEM_BITS
14 * if we increase SECTIONS_WIDTH we will not store node details in page->flags and
15 * page_to_nid does a page->section->node lookup
16 * Hence only increase for VMEMMAP.
18 #ifdef CONFIG_SPARSEMEM_VMEMMAP
19 #define MAX_PHYSMEM_BITS 47
21 #define MAX_PHYSMEM_BITS 46
24 #endif /* CONFIG_SPARSEMEM */
26 #ifdef CONFIG_MEMORY_HOTPLUG
27 extern int create_section_mapping(unsigned long start, unsigned long end, int nid);
28 extern int remove_section_mapping(unsigned long start, unsigned long end);
30 #ifdef CONFIG_PPC_BOOK3S_64
31 extern void resize_hpt_for_hotplug(unsigned long new_mem_size);
33 static inline void resize_hpt_for_hotplug(unsigned long new_mem_size) { }
37 extern int hot_add_scn_to_nid(unsigned long scn_addr);
39 static inline int hot_add_scn_to_nid(unsigned long scn_addr)
43 #endif /* CONFIG_NUMA */
44 #endif /* CONFIG_MEMORY_HOTPLUG */
46 #endif /* __KERNEL__ */
47 #endif /* _ASM_POWERPC_SPARSEMEM_H */