5level-fixup.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _5LEVEL_FIXUP_H
  3. #define _5LEVEL_FIXUP_H
  4. #define __ARCH_HAS_5LEVEL_HACK
  5. #define __PAGETABLE_P4D_FOLDED
  6. #define P4D_SHIFT PGDIR_SHIFT
  7. #define P4D_SIZE PGDIR_SIZE
  8. #define P4D_MASK PGDIR_MASK
  9. #define PTRS_PER_P4D 1
  10. #define p4d_t pgd_t
  11. #define pud_alloc(mm, p4d, address) \
  12. ((unlikely(pgd_none(*(p4d))) && __pud_alloc(mm, p4d, address)) ? \
  13. NULL : pud_offset(p4d, address))
  14. #define p4d_alloc(mm, pgd, address) (pgd)
  15. #define p4d_offset(pgd, start) (pgd)
  16. #define p4d_none(p4d) 0
  17. #define p4d_bad(p4d) 0
  18. #define p4d_present(p4d) 1
  19. #define p4d_ERROR(p4d) do { } while (0)
  20. #define p4d_clear(p4d) pgd_clear(p4d)
  21. #define p4d_val(p4d) pgd_val(p4d)
  22. #define p4d_populate(mm, p4d, pud) pgd_populate(mm, p4d, pud)
  23. #define p4d_page(p4d) pgd_page(p4d)
  24. #define p4d_page_vaddr(p4d) pgd_page_vaddr(p4d)
  25. #define __p4d(x) __pgd(x)
  26. #define set_p4d(p4dp, p4d) set_pgd(p4dp, p4d)
  27. #undef p4d_free_tlb
  28. #define p4d_free_tlb(tlb, x, addr) do { } while (0)
  29. #define p4d_free(mm, x) do { } while (0)
  30. #define __p4d_free_tlb(tlb, x, addr) do { } while (0)
  31. #undef p4d_addr_end
  32. #define p4d_addr_end(addr, end) (end)
  33. #endif