1b8b572e1SStephen Rothwell #ifndef _ASM_POWERPC_SPARSEMEM_H 2b8b572e1SStephen Rothwell #define _ASM_POWERPC_SPARSEMEM_H 1 3b8b572e1SStephen Rothwell #ifdef __KERNEL__ 4b8b572e1SStephen Rothwell 5b8b572e1SStephen Rothwell #ifdef CONFIG_SPARSEMEM 6b8b572e1SStephen Rothwell /* 7b8b572e1SStephen Rothwell * SECTION_SIZE_BITS 2^N: how big each section will be 8b8b572e1SStephen Rothwell * MAX_PHYSADDR_BITS 2^N: how much physical address space we have 9b8b572e1SStephen Rothwell * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space 10b8b572e1SStephen Rothwell */ 11b8b572e1SStephen Rothwell #define SECTION_SIZE_BITS 24 12b8b572e1SStephen Rothwell 13048ee099SAneesh Kumar K.V #define MAX_PHYSADDR_BITS 46 14048ee099SAneesh Kumar K.V #define MAX_PHYSMEM_BITS 46 15b8b572e1SStephen Rothwell 16b8b572e1SStephen Rothwell #endif /* CONFIG_SPARSEMEM */ 17b8b572e1SStephen Rothwell 18b8b572e1SStephen Rothwell #ifdef CONFIG_MEMORY_HOTPLUG 19a1194097SAnton Blanchard extern int create_section_mapping(unsigned long start, unsigned long end); 20b8b572e1SStephen Rothwell extern int remove_section_mapping(unsigned long start, unsigned long end); 2136b390fdSMichael Ellerman 2236b390fdSMichael Ellerman #ifdef CONFIG_PPC_BOOK3S_64 2336b390fdSMichael Ellerman extern void resize_hpt_for_hotplug(unsigned long new_mem_size); 2436b390fdSMichael Ellerman #else 2536b390fdSMichael Ellerman static inline void resize_hpt_for_hotplug(unsigned long new_mem_size) { } 2636b390fdSMichael Ellerman #endif 2736b390fdSMichael Ellerman 28b8b572e1SStephen Rothwell #ifdef CONFIG_NUMA 29b8b572e1SStephen Rothwell extern int hot_add_scn_to_nid(unsigned long scn_addr); 30b8b572e1SStephen Rothwell #else 31b8b572e1SStephen Rothwell static inline int hot_add_scn_to_nid(unsigned long scn_addr) 32b8b572e1SStephen Rothwell { 33b8b572e1SStephen Rothwell return 0; 34b8b572e1SStephen Rothwell } 35b8b572e1SStephen Rothwell #endif /* CONFIG_NUMA */ 36b8b572e1SStephen Rothwell #endif /* CONFIG_MEMORY_HOTPLUG */ 37b8b572e1SStephen Rothwell 38b8b572e1SStephen Rothwell #endif /* __KERNEL__ */ 39b8b572e1SStephen Rothwell #endif /* _ASM_POWERPC_SPARSEMEM_H */ 40