psw.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #ifndef _PARISC_PSW_H
  2. #define PSW_I 0x00000001
  3. #define PSW_D 0x00000002
  4. #define PSW_P 0x00000004
  5. #define PSW_Q 0x00000008
  6. #define PSW_R 0x00000010
  7. #define PSW_F 0x00000020
  8. #define PSW_G 0x00000040 /* PA1.x only */
  9. #define PSW_O 0x00000080 /* PA2.0 only */
  10. /* ssm/rsm instructions number PSW_W and PSW_E differently */
  11. #define PSW_SM_I PSW_I /* Enable External Interrupts */
  12. #define PSW_SM_D PSW_D
  13. #define PSW_SM_P PSW_P
  14. #define PSW_SM_Q PSW_Q /* Enable Interrupt State Collection */
  15. #define PSW_SM_R PSW_R /* Enable Recover Counter Trap */
  16. #define PSW_SM_W 0x200 /* PA2.0 only : Enable Wide Mode */
  17. #define PSW_SM_QUIET PSW_SM_R+PSW_SM_Q+PSW_SM_P+PSW_SM_D+PSW_SM_I
  18. #define PSW_CB 0x0000ff00
  19. #define PSW_M 0x00010000
  20. #define PSW_V 0x00020000
  21. #define PSW_C 0x00040000
  22. #define PSW_B 0x00080000
  23. #define PSW_X 0x00100000
  24. #define PSW_N 0x00200000
  25. #define PSW_L 0x00400000
  26. #define PSW_H 0x00800000
  27. #define PSW_T 0x01000000
  28. #define PSW_S 0x02000000
  29. #define PSW_E 0x04000000
  30. #define PSW_W 0x08000000 /* PA2.0 only */
  31. #define PSW_W_BIT 36 /* PA2.0 only */
  32. #define PSW_Z 0x40000000 /* PA1.x only */
  33. #define PSW_Y 0x80000000 /* PA1.x only */
  34. #ifdef CONFIG_64BIT
  35. # define PSW_HI_CB 0x000000ff /* PA2.0 only */
  36. #endif
  37. #ifdef CONFIG_64BIT
  38. # define USER_PSW_HI_MASK PSW_HI_CB
  39. # define WIDE_PSW PSW_W
  40. #else
  41. # define WIDE_PSW 0
  42. #endif
  43. /* Used when setting up for rfi */
  44. #define KERNEL_PSW (WIDE_PSW | PSW_C | PSW_Q | PSW_P | PSW_D)
  45. #define REAL_MODE_PSW (WIDE_PSW | PSW_Q)
  46. #define USER_PSW_MASK (WIDE_PSW | PSW_T | PSW_N | PSW_X | PSW_B | PSW_V | PSW_CB)
  47. #define USER_PSW (PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I)
  48. #ifndef __ASSEMBLY__
  49. /* The program status word as bitfields. */
  50. struct pa_psw {
  51. unsigned int y:1;
  52. unsigned int z:1;
  53. unsigned int rv:2;
  54. unsigned int w:1;
  55. unsigned int e:1;
  56. unsigned int s:1;
  57. unsigned int t:1;
  58. unsigned int h:1;
  59. unsigned int l:1;
  60. unsigned int n:1;
  61. unsigned int x:1;
  62. unsigned int b:1;
  63. unsigned int c:1;
  64. unsigned int v:1;
  65. unsigned int m:1;
  66. unsigned int cb:8;
  67. unsigned int o:1;
  68. unsigned int g:1;
  69. unsigned int f:1;
  70. unsigned int r:1;
  71. unsigned int q:1;
  72. unsigned int p:1;
  73. unsigned int d:1;
  74. unsigned int i:1;
  75. };
  76. #ifdef CONFIG_64BIT
  77. #define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW + 4))
  78. #else
  79. #define pa_psw(task) ((struct pa_psw *) ((char *) (task) + TASK_PT_PSW))
  80. #endif
  81. #endif /* !__ASSEMBLY__ */
  82. #endif