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