aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/include
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-06-22 03:08:59 -0400
committerVineet Gupta <vgupta@synopsys.com>2013-06-22 09:53:26 -0400
commit352c1d95e3220d0ea33cefac5c1f0deb2c4470c6 (patch)
tree2e487e17b6c45610ae819e01be6a7a0f534c35e8 /arch/arc/include
parent359105bdb06f8421fd8e69ae47fd052e398b6778 (diff)
ARC: stop using pt_regs->orig_r8
Historically, pt_regs have had orig_r8, an overloaded container for (1) backup copy of r8 (syscall number Trap Exceptions) (2) additional system state: (syscall/Exception/Interrupt) There is no point in keeping (1) since syscall number is never clobbered in-place, in pt_regs, unlike r0 which duals as first syscall arg as well as syscall return value and in case of syscall restart, the orig arg0 needs restoring (from orig_r0) after having been updated in-place with syscall ret value. This further paves way to convert (2) to contain ECR itself (rather than current madeup values) Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/include')
-rw-r--r--arch/arc/include/asm/entry.h13
-rw-r--r--arch/arc/include/asm/syscall.h5
-rw-r--r--arch/arc/include/uapi/asm/ptrace.h2
3 files changed, 4 insertions, 16 deletions
diff --git a/arch/arc/include/asm/entry.h b/arch/arc/include/asm/entry.h
index 72a7ed47117a..de01bc842a9a 100644
--- a/arch/arc/include/asm/entry.h
+++ b/arch/arc/include/asm/entry.h
@@ -422,18 +422,7 @@
422 * Save scratch regs for sys calls 422 * Save scratch regs for sys calls
423 *-------------------------------------------------------------*/ 423 *-------------------------------------------------------------*/
424.macro SAVE_ALL_TRAP 424.macro SAVE_ALL_TRAP
425 /* 425 SAVE_ALL_EXCEPTION orig_r8_IS_SCALL
426 * Setup pt_regs->orig_r8.
427 * Encode syscall number (r8) in upper short word of event type (r9)
428 * N.B. #1: This is already endian safe (see ptrace.h)
429 * #2: Only r9 can be used as scratch as it is already clobbered
430 * and it's contents are no longer needed by the latter part
431 * of exception prologue
432 */
433 lsl r9, r8, 16
434 or r9, r9, orig_r8_IS_SCALL
435
436 SAVE_ALL_EXCEPTION r9
437.endm 426.endm
438 427
439/*-------------------------------------------------------------- 428/*--------------------------------------------------------------
diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscall.h
index 33ab3048e9b2..29de09804306 100644
--- a/arch/arc/include/asm/syscall.h
+++ b/arch/arc/include/asm/syscall.h
@@ -18,7 +18,7 @@ static inline long
18syscall_get_nr(struct task_struct *task, struct pt_regs *regs) 18syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
19{ 19{
20 if (user_mode(regs) && in_syscall(regs)) 20 if (user_mode(regs) && in_syscall(regs))
21 return regs->orig_r8; 21 return regs->r8;
22 else 22 else
23 return -1; 23 return -1;
24} 24}
@@ -26,8 +26,7 @@ syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
26static inline void 26static inline void
27syscall_rollback(struct task_struct *task, struct pt_regs *regs) 27syscall_rollback(struct task_struct *task, struct pt_regs *regs)
28{ 28{
29 /* XXX: I can't fathom how pt_regs->r8 will be clobbered ? */ 29 regs->r0 = regs->orig_r0;
30 regs->r8 = regs->orig_r8;
31} 30}
32 31
33static inline long 32static inline long
diff --git a/arch/arc/include/uapi/asm/ptrace.h b/arch/arc/include/uapi/asm/ptrace.h
index 4599109f68f2..2618cc13ba75 100644
--- a/arch/arc/include/uapi/asm/ptrace.h
+++ b/arch/arc/include/uapi/asm/ptrace.h
@@ -44,7 +44,7 @@ struct user_regs_struct {
44 long r19, r18, r17, r16, r15, r14, r13; 44 long r19, r18, r17, r16, r15, r14, r13;
45 } callee; 45 } callee;
46 long efa; /* break pt addr, for break points in delay slots */ 46 long efa; /* break pt addr, for break points in delay slots */
47 long stop_pc; /* give dbg stop_pc directly after checking orig_r8 */ 47 long stop_pc; /* give dbg stop_pc after ensuring brkpt trap */
48}; 48};
49#endif /* !__ASSEMBLY__ */ 49#endif /* !__ASSEMBLY__ */
50 50