diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-06-12 05:43:40 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-06-26 06:00:50 -0400 |
commit | 38a9ff6d247cf9afcbe55ea245b650b8955029fd (patch) | |
tree | c2603e639b98463ebc1b2de95dcbfffd338c8138 /arch/arc/mm | |
parent | 502a0c775c7f0a01065e0d078e06c0440b86a11a (diff) |
ARC: Remove explicit passing around of ECR
With ECR now part of pt_regs
* No need to propagate from lowest asm handlers as arg
* No need to save it in tsk->thread.cause_code
* Avoid bit chopping to access the bit-fields
More code consolidation, cleanup
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm')
-rw-r--r-- | arch/arc/mm/fault.c | 12 | ||||
-rw-r--r-- | arch/arc/mm/tlbex.S | 1 |
2 files changed, 5 insertions, 8 deletions
diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c index fdafeb1917cc..318164cabdfc 100644 --- a/arch/arc/mm/fault.c +++ b/arch/arc/mm/fault.c | |||
@@ -52,15 +52,14 @@ bad_area: | |||
52 | return 1; | 52 | return 1; |
53 | } | 53 | } |
54 | 54 | ||
55 | void do_page_fault(struct pt_regs *regs, unsigned long address, | 55 | void do_page_fault(struct pt_regs *regs, unsigned long address) |
56 | unsigned long cause_code) | ||
57 | { | 56 | { |
58 | struct vm_area_struct *vma = NULL; | 57 | struct vm_area_struct *vma = NULL; |
59 | struct task_struct *tsk = current; | 58 | struct task_struct *tsk = current; |
60 | struct mm_struct *mm = tsk->mm; | 59 | struct mm_struct *mm = tsk->mm; |
61 | siginfo_t info; | 60 | siginfo_t info; |
62 | int fault, ret; | 61 | int fault, ret; |
63 | int write = cause_code & (1 << ECR_C_BIT_DTLB_ST_MISS); /* ST/EX */ | 62 | int write = regs->ecr_cause & ECR_C_PROTV_STORE; /* ST/EX */ |
64 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | | 63 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | |
65 | (write ? FAULT_FLAG_WRITE : 0); | 64 | (write ? FAULT_FLAG_WRITE : 0); |
66 | 65 | ||
@@ -111,7 +110,8 @@ good_area: | |||
111 | 110 | ||
112 | /* Handle protection violation, execute on heap or stack */ | 111 | /* Handle protection violation, execute on heap or stack */ |
113 | 112 | ||
114 | if (cause_code == ((ECR_V_PROTV << 16) | ECR_C_PROTV_INST_FETCH)) | 113 | if ((regs->ecr_vec == ECR_V_PROTV) && |
114 | (regs->ecr_cause == ECR_C_PROTV_INST_FETCH)) | ||
115 | goto bad_area; | 115 | goto bad_area; |
116 | 116 | ||
117 | if (write) { | 117 | if (write) { |
@@ -178,7 +178,6 @@ bad_area_nosemaphore: | |||
178 | /* User mode accesses just cause a SIGSEGV */ | 178 | /* User mode accesses just cause a SIGSEGV */ |
179 | if (user_mode(regs)) { | 179 | if (user_mode(regs)) { |
180 | tsk->thread.fault_address = address; | 180 | tsk->thread.fault_address = address; |
181 | tsk->thread.cause_code = cause_code; | ||
182 | info.si_signo = SIGSEGV; | 181 | info.si_signo = SIGSEGV; |
183 | info.si_errno = 0; | 182 | info.si_errno = 0; |
184 | /* info.si_code has been set above */ | 183 | /* info.si_code has been set above */ |
@@ -199,7 +198,7 @@ no_context: | |||
199 | if (fixup_exception(regs)) | 198 | if (fixup_exception(regs)) |
200 | return; | 199 | return; |
201 | 200 | ||
202 | die("Oops", regs, address, cause_code); | 201 | die("Oops", regs, address); |
203 | 202 | ||
204 | out_of_memory: | 203 | out_of_memory: |
205 | if (is_global_init(tsk)) { | 204 | if (is_global_init(tsk)) { |
@@ -220,7 +219,6 @@ do_sigbus: | |||
220 | goto no_context; | 219 | goto no_context; |
221 | 220 | ||
222 | tsk->thread.fault_address = address; | 221 | tsk->thread.fault_address = address; |
223 | tsk->thread.cause_code = cause_code; | ||
224 | info.si_signo = SIGBUS; | 222 | info.si_signo = SIGBUS; |
225 | info.si_errno = 0; | 223 | info.si_errno = 0; |
226 | info.si_code = BUS_ADRERR; | 224 | info.si_code = BUS_ADRERR; |
diff --git a/arch/arc/mm/tlbex.S b/arch/arc/mm/tlbex.S index bd8bc90f61d3..8d61fdf7a43b 100644 --- a/arch/arc/mm/tlbex.S +++ b/arch/arc/mm/tlbex.S | |||
@@ -382,7 +382,6 @@ do_slow_path_pf: | |||
382 | ; ------- setup args for Linux Page fault Hanlder --------- | 382 | ; ------- setup args for Linux Page fault Hanlder --------- |
383 | mov_s r0, sp | 383 | mov_s r0, sp |
384 | lr r1, [efa] | 384 | lr r1, [efa] |
385 | lr r2, [ecr] | ||
386 | 385 | ||
387 | ; We don't want exceptions to be disabled while the fault is handled. | 386 | ; We don't want exceptions to be disabled while the fault is handled. |
388 | ; Now that we have saved the context we return from exception hence | 387 | ; Now that we have saved the context we return from exception hence |