sparsemem.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_SPARSEMEM_H
  3. #define _ASM_X86_SPARSEMEM_H
  4. #ifdef CONFIG_SPARSEMEM
  5. /*
  6. * generic non-linear memory support:
  7. *
  8. * 1) we will not split memory into more chunks than will fit into the flags
  9. * field of the struct page
  10. *
  11. * SECTION_SIZE_BITS 2^n: size of each section
  12. * MAX_PHYSADDR_BITS 2^n: max size of physical address space
  13. * MAX_PHYSMEM_BITS 2^n: how much memory we can have in that space
  14. *
  15. */
  16. #ifdef CONFIG_X86_32
  17. # ifdef CONFIG_X86_PAE
  18. # define SECTION_SIZE_BITS 29
  19. # define MAX_PHYSADDR_BITS 36
  20. # define MAX_PHYSMEM_BITS 36
  21. # else
  22. # define SECTION_SIZE_BITS 26
  23. # define MAX_PHYSADDR_BITS 32
  24. # define MAX_PHYSMEM_BITS 32
  25. # endif
  26. #else /* CONFIG_X86_32 */
  27. # define SECTION_SIZE_BITS 27 /* matt - 128 is convenient right now */
  28. # ifdef CONFIG_X86_5LEVEL
  29. # define MAX_PHYSADDR_BITS 52
  30. # define MAX_PHYSMEM_BITS 52
  31. # else
  32. # define MAX_PHYSADDR_BITS 44
  33. # define MAX_PHYSMEM_BITS 46
  34. # endif
  35. #endif
  36. #endif /* CONFIG_SPARSEMEM */
  37. #endif /* _ASM_X86_SPARSEMEM_H */