sparsemem.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_SPARSEMEM_H
  3. #define _ASM_X86_SPARSEMEM_H
  4. #include <linux/types.h>
  5. #ifdef CONFIG_SPARSEMEM
  6. /*
  7. * generic non-linear memory support:
  8. *
  9. * 1) we will not split memory into more chunks than will fit into the flags
  10. * field of the struct page
  11. *
  12. * SECTION_SIZE_BITS 2^n: size of each section
  13. * MAX_PHYSMEM_BITS 2^n: max size of physical address space
  14. *
  15. */
  16. #ifdef CONFIG_X86_32
  17. # ifdef CONFIG_X86_PAE
  18. # define SECTION_SIZE_BITS 29
  19. # define MAX_PHYSMEM_BITS 36
  20. # else
  21. # define SECTION_SIZE_BITS 26
  22. # define MAX_PHYSMEM_BITS 32
  23. # endif
  24. #else /* CONFIG_X86_32 */
  25. # define SECTION_SIZE_BITS 27 /* matt - 128 is convenient right now */
  26. # define MAX_PHYSMEM_BITS (pgtable_l5_enabled() ? 52 : 46)
  27. #endif
  28. #endif /* CONFIG_SPARSEMEM */
  29. #ifndef __ASSEMBLY__
  30. #ifdef CONFIG_NUMA_KEEP_MEMINFO
  31. extern int phys_to_target_node(phys_addr_t start);
  32. #define phys_to_target_node phys_to_target_node
  33. extern int memory_add_physaddr_to_nid(u64 start);
  34. #define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
  35. extern int numa_fill_memblks(u64 start, u64 end);
  36. #define numa_fill_memblks numa_fill_memblks
  37. #endif
  38. #endif /* __ASSEMBLY__ */
  39. #endif /* _ASM_X86_SPARSEMEM_H */