18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _ASM_POWERPC_SPARSEMEM_H
38c2ecf20Sopenharmony_ci#define _ASM_POWERPC_SPARSEMEM_H 1
48c2ecf20Sopenharmony_ci#ifdef __KERNEL__
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifdef CONFIG_SPARSEMEM
78c2ecf20Sopenharmony_ci/*
88c2ecf20Sopenharmony_ci * SECTION_SIZE_BITS		2^N: how big each section will be
98c2ecf20Sopenharmony_ci * MAX_PHYSMEM_BITS		2^N: how much memory we can have in that space
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci#define SECTION_SIZE_BITS       24
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#endif /* CONFIG_SPARSEMEM */
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#ifdef CONFIG_MEMORY_HOTPLUG
168c2ecf20Sopenharmony_ciextern int remove_section_mapping(unsigned long start, unsigned long end);
178c2ecf20Sopenharmony_ciextern int memory_add_physaddr_to_nid(u64 start);
188c2ecf20Sopenharmony_ci#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#ifdef CONFIG_NUMA
218c2ecf20Sopenharmony_ciextern int hot_add_scn_to_nid(unsigned long scn_addr);
228c2ecf20Sopenharmony_ci#else
238c2ecf20Sopenharmony_cistatic inline int hot_add_scn_to_nid(unsigned long scn_addr)
248c2ecf20Sopenharmony_ci{
258c2ecf20Sopenharmony_ci	return 0;
268c2ecf20Sopenharmony_ci}
278c2ecf20Sopenharmony_ci#endif /* CONFIG_NUMA */
288c2ecf20Sopenharmony_ci#endif /* CONFIG_MEMORY_HOTPLUG */
298c2ecf20Sopenharmony_ci#endif /* __KERNEL__ */
308c2ecf20Sopenharmony_ci#endif /* _ASM_POWERPC_SPARSEMEM_H */
31