pte-book3e.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef _ASM_POWERPC_PTE_BOOK3E_H
  2. #define _ASM_POWERPC_PTE_BOOK3E_H
  3. #ifdef __KERNEL__
  4. /* PTE bit definitions for processors compliant to the Book3E
  5. * architecture 2.06 or later. The position of the PTE bits
  6. * matches the HW definition of the optional Embedded Page Table
  7. * category.
  8. */
  9. /* Architected bits */
  10. #define _PAGE_PRESENT 0x000001 /* software: pte contains a translation */
  11. #define _PAGE_FILE 0x000002 /* (!present only) software: pte holds file offset */
  12. #define _PAGE_SW1 0x000002
  13. #define _PAGE_BAP_SR 0x000004
  14. #define _PAGE_BAP_UR 0x000008
  15. #define _PAGE_BAP_SW 0x000010
  16. #define _PAGE_BAP_UW 0x000020
  17. #define _PAGE_BAP_SX 0x000040
  18. #define _PAGE_BAP_UX 0x000080
  19. #define _PAGE_PSIZE_MSK 0x000f00
  20. #define _PAGE_PSIZE_4K 0x000200
  21. #define _PAGE_PSIZE_64K 0x000600
  22. #define _PAGE_PSIZE_1M 0x000a00
  23. #define _PAGE_PSIZE_16M 0x000e00
  24. #define _PAGE_DIRTY 0x001000 /* C: page changed */
  25. #define _PAGE_SW0 0x002000
  26. #define _PAGE_U3 0x004000
  27. #define _PAGE_U2 0x008000
  28. #define _PAGE_U1 0x010000
  29. #define _PAGE_U0 0x020000
  30. #define _PAGE_ACCESSED 0x040000
  31. #define _PAGE_LENDIAN 0x080000
  32. #define _PAGE_GUARDED 0x100000
  33. #define _PAGE_COHERENT 0x200000 /* M: enforce memory coherence */
  34. #define _PAGE_NO_CACHE 0x400000 /* I: cache inhibit */
  35. #define _PAGE_WRITETHRU 0x800000 /* W: cache write-through */
  36. /* "Higher level" linux bit combinations */
  37. #define _PAGE_EXEC _PAGE_BAP_SX /* Can be executed from potentially */
  38. #define _PAGE_HWEXEC _PAGE_BAP_UX /* .. and was cache cleaned */
  39. #define _PAGE_RW (_PAGE_BAP_SW | _PAGE_BAP_UW) /* User write permission */
  40. #define _PAGE_KERNEL_RW (_PAGE_BAP_SW | _PAGE_BAP_SR | _PAGE_DIRTY)
  41. #define _PAGE_KERNEL_RO (_PAGE_BAP_SR)
  42. #define _PAGE_USER (_PAGE_BAP_UR | _PAGE_BAP_SR) /* Can be read */
  43. #define _PAGE_HASHPTE 0
  44. #define _PAGE_BUSY 0
  45. #define _PAGE_SPECIAL _PAGE_SW0
  46. /* Flags to be preserved on PTE modifications */
  47. #define _PAGE_HPTEFLAGS _PAGE_BUSY
  48. /* Base page size */
  49. #ifdef CONFIG_PPC_64K_PAGES
  50. #define _PAGE_PSIZE _PAGE_PSIZE_64K
  51. #define PTE_RPN_SHIFT (28)
  52. #else
  53. #define _PAGE_PSIZE _PAGE_PSIZE_4K
  54. #define PTE_RPN_SHIFT (24)
  55. #endif
  56. /* On 32-bit, we never clear the top part of the PTE */
  57. #ifdef CONFIG_PPC32
  58. #define _PTE_NONE_MASK 0xffffffff00000000ULL
  59. #endif
  60. #endif /* __KERNEL__ */
  61. #endif /* _ASM_POWERPC_PTE_FSL_BOOKE_H */