1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LOONGARCH_SPARSEMEM_H
3 #define _LOONGARCH_SPARSEMEM_H
5 #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 29 /* 2^29 = Largest Huge Page Size */
12 #define MAX_PHYSMEM_BITS 48
14 #ifdef CONFIG_SPARSEMEM_VMEMMAP
15 #define VMEMMAP_SIZE (sizeof(struct page) * (1UL << (cpu_pabits + 1 - PAGE_SHIFT)))
18 #endif /* CONFIG_SPARSEMEM */
21 #define VMEMMAP_SIZE 0 /* 1, For FLATMEM; 2, For SPARSEMEM without VMEMMAP. */
24 #ifdef CONFIG_MEMORY_HOTPLUG
25 int memory_add_physaddr_to_nid(u64 addr
);
26 #define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
29 #define INIT_MEMBLOCK_RESERVED_REGIONS (INIT_MEMBLOCK_REGIONS + NR_CPUS)
31 #endif /* _LOONGARCH_SPARSEMEM_H */