Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_X86_SPARSEMEM_H
0003 #define _ASM_X86_SPARSEMEM_H
0004 
0005 #ifdef CONFIG_SPARSEMEM
0006 /*
0007  * generic non-linear memory support:
0008  *
0009  * 1) we will not split memory into more chunks than will fit into the flags
0010  *    field of the struct page
0011  *
0012  * SECTION_SIZE_BITS        2^n: size of each section
0013  * MAX_PHYSMEM_BITS     2^n: max size of physical address space
0014  *
0015  */
0016 
0017 #ifdef CONFIG_X86_32
0018 # ifdef CONFIG_X86_PAE
0019 #  define SECTION_SIZE_BITS 29
0020 #  define MAX_PHYSMEM_BITS  36
0021 # else
0022 #  define SECTION_SIZE_BITS 26
0023 #  define MAX_PHYSMEM_BITS  32
0024 # endif
0025 #else /* CONFIG_X86_32 */
0026 # define SECTION_SIZE_BITS  27 /* matt - 128 is convenient right now */
0027 # define MAX_PHYSMEM_BITS   (pgtable_l5_enabled() ? 52 : 46)
0028 #endif
0029 
0030 #endif /* CONFIG_SPARSEMEM */
0031 
0032 #ifndef __ASSEMBLY__
0033 #ifdef CONFIG_NUMA_KEEP_MEMINFO
0034 extern int phys_to_target_node(phys_addr_t start);
0035 #define phys_to_target_node phys_to_target_node
0036 extern int memory_add_physaddr_to_nid(u64 start);
0037 #define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
0038 #endif
0039 #endif /* __ASSEMBLY__ */
0040 
0041 #endif /* _ASM_X86_SPARSEMEM_H */