pgtable-bits.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_CSKY_PGTABLE_BITS_H
  3. #define __ASM_CSKY_PGTABLE_BITS_H
  4. /* implemented in software */
  5. #define _PAGE_PRESENT (1<<0)
  6. #define _PAGE_READ (1<<1)
  7. #define _PAGE_WRITE (1<<2)
  8. #define _PAGE_ACCESSED (1<<3)
  9. #define _PAGE_MODIFIED (1<<4)
  10. /* implemented in hardware */
  11. #define _PAGE_GLOBAL (1<<6)
  12. #define _PAGE_VALID (1<<7)
  13. #define _PAGE_DIRTY (1<<8)
  14. #define _PAGE_CACHE (3<<9)
  15. #define _PAGE_UNCACHE (2<<9)
  16. #define _PAGE_SO _PAGE_UNCACHE
  17. #define _CACHE_MASK (7<<9)
  18. #define _CACHE_CACHED _PAGE_CACHE
  19. #define _CACHE_UNCACHED _PAGE_UNCACHE
  20. #define _PAGE_PROT_NONE _PAGE_READ
  21. /*
  22. * Encode and decode a swap entry
  23. *
  24. * Format of swap PTE:
  25. * bit 0: _PAGE_PRESENT (zero)
  26. * bit 1: _PAGE_READ (zero)
  27. * bit 2 - 5: swap type[0 - 3]
  28. * bit 6: _PAGE_GLOBAL (zero)
  29. * bit 7: _PAGE_VALID (zero)
  30. * bit 8: swap type[4]
  31. * bit 9 - 31: swap offset
  32. */
  33. #define __swp_type(x) ((((x).val >> 2) & 0xf) | \
  34. (((x).val >> 4) & 0x10))
  35. #define __swp_offset(x) ((x).val >> 9)
  36. #define __swp_entry(type, offset) ((swp_entry_t) { \
  37. ((type & 0xf) << 2) | \
  38. ((type & 0x10) << 4) | \
  39. ((offset) << 9)})
  40. #define HAVE_ARCH_UNMAPPED_AREA
  41. #endif /* __ASM_CSKY_PGTABLE_BITS_H */