pgtable-32.h 987 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2012 Regents of the University of California
  4. */
  5. #ifndef _ASM_RISCV_PGTABLE_32_H
  6. #define _ASM_RISCV_PGTABLE_32_H
  7. #include <asm-generic/pgtable-nopmd.h>
  8. #include <linux/bits.h>
  9. #include <linux/const.h>
  10. /* Size of region mapped by a page global directory */
  11. #define PGDIR_SHIFT 22
  12. #define PGDIR_SIZE (_AC(1, UL) << PGDIR_SHIFT)
  13. #define PGDIR_MASK (~(PGDIR_SIZE - 1))
  14. #define MAX_POSSIBLE_PHYSMEM_BITS 34
  15. /*
  16. * rv32 PTE format:
  17. * | XLEN-1 10 | 9 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
  18. * PFN reserved for SW D A G U X W R V
  19. */
  20. #define _PAGE_PFN_MASK GENMASK(31, 10)
  21. #define _PAGE_NOCACHE 0
  22. #define _PAGE_IO 0
  23. #define _PAGE_MTMASK 0
  24. /* Set of bits to preserve across pte_modify() */
  25. #define _PAGE_CHG_MASK (~(unsigned long)(_PAGE_PRESENT | _PAGE_READ | \
  26. _PAGE_WRITE | _PAGE_EXEC | \
  27. _PAGE_USER | _PAGE_GLOBAL))
  28. #endif /* _ASM_RISCV_PGTABLE_32_H */