|
12 | 12 |
|
13 | 13 | #ifndef __ASSEMBLY__ |
14 | 14 |
|
| 15 | +typedef union { |
| 16 | + struct { |
| 17 | +#ifdef CONFIG_CPU_BIG_ENDIAN |
| 18 | + unsigned long state:8, vec:8, cause:8, param:8; |
| 19 | +#else |
| 20 | + unsigned long param:8, cause:8, vec:8, state:8; |
| 21 | +#endif |
| 22 | + }; |
| 23 | + unsigned long full; |
| 24 | +} ecr_reg; |
| 25 | + |
15 | 26 | /* THE pt_regs: Defines how regs are saved during entry into kernel */ |
16 | 27 |
|
17 | 28 | #ifdef CONFIG_ISA_ARCOMPACT |
@@ -40,40 +51,18 @@ struct pt_regs { |
40 | 51 | * Last word used by Linux for extra state mgmt (syscall-restart) |
41 | 52 | * For interrupts, use artificial ECR values to note current prio-level |
42 | 53 | */ |
43 | | - union { |
44 | | - struct { |
45 | | -#ifdef CONFIG_CPU_BIG_ENDIAN |
46 | | - unsigned long state:8, ecr_vec:8, |
47 | | - ecr_cause:8, ecr_param:8; |
48 | | -#else |
49 | | - unsigned long ecr_param:8, ecr_cause:8, |
50 | | - ecr_vec:8, state:8; |
51 | | -#endif |
52 | | - }; |
53 | | - unsigned long event; |
54 | | - }; |
| 54 | + ecr_reg ecr; |
55 | 55 | }; |
56 | 56 |
|
57 | | -#define MAX_REG_OFFSET offsetof(struct pt_regs, event) |
| 57 | +#define MAX_REG_OFFSET offsetof(struct pt_regs, ecr) |
58 | 58 |
|
59 | 59 | #else |
60 | 60 |
|
61 | 61 | struct pt_regs { |
62 | 62 |
|
63 | 63 | unsigned long orig_r0; |
64 | 64 |
|
65 | | - union { |
66 | | - struct { |
67 | | -#ifdef CONFIG_CPU_BIG_ENDIAN |
68 | | - unsigned long state:8, ecr_vec:8, |
69 | | - ecr_cause:8, ecr_param:8; |
70 | | -#else |
71 | | - unsigned long ecr_param:8, ecr_cause:8, |
72 | | - ecr_vec:8, state:8; |
73 | | -#endif |
74 | | - }; |
75 | | - unsigned long event; |
76 | | - }; |
| 65 | + ecr_reg ecr; /* Exception Cause Reg */ |
77 | 66 |
|
78 | 67 | unsigned long bta; /* erbta */ |
79 | 68 |
|
@@ -131,13 +120,13 @@ struct callee_regs { |
131 | 120 | /* return 1 if PC in delay slot */ |
132 | 121 | #define delay_mode(regs) ((regs->status32 & STATUS_DE_MASK) == STATUS_DE_MASK) |
133 | 122 |
|
134 | | -#define in_syscall(regs) ((regs->ecr_vec == ECR_V_TRAP) && !regs->ecr_param) |
135 | | -#define in_brkpt_trap(regs) ((regs->ecr_vec == ECR_V_TRAP) && regs->ecr_param) |
| 123 | +#define in_syscall(regs) ((regs->ecr.vec == ECR_V_TRAP) && !regs->ecr.param) |
| 124 | +#define in_brkpt_trap(regs) ((regs->ecr.vec == ECR_V_TRAP) && regs->ecr.param) |
136 | 125 |
|
137 | 126 | #define STATE_SCALL_RESTARTED 0x01 |
138 | 127 |
|
139 | | -#define syscall_wont_restart(reg) (reg->state |= STATE_SCALL_RESTARTED) |
140 | | -#define syscall_restartable(reg) !(reg->state & STATE_SCALL_RESTARTED) |
| 128 | +#define syscall_wont_restart(regs) (regs->ecr.state |= STATE_SCALL_RESTARTED) |
| 129 | +#define syscall_restartable(regs) !(regs->ecr.state & STATE_SCALL_RESTARTED) |
141 | 130 |
|
142 | 131 | #define current_pt_regs() \ |
143 | 132 | ({ \ |
|
0 commit comments