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>
This commit is contained in:
@@ -422,18 +422,7 @@
|
|||||||
* Save scratch regs for sys calls
|
* Save scratch regs for sys calls
|
||||||
*-------------------------------------------------------------*/
|
*-------------------------------------------------------------*/
|
||||||
.macro SAVE_ALL_TRAP
|
.macro SAVE_ALL_TRAP
|
||||||
/*
|
SAVE_ALL_EXCEPTION orig_r8_IS_SCALL
|
||||||
* Setup pt_regs->orig_r8.
|
|
||||||
* Encode syscall number (r8) in upper short word of event type (r9)
|
|
||||||
* N.B. #1: This is already endian safe (see ptrace.h)
|
|
||||||
* #2: Only r9 can be used as scratch as it is already clobbered
|
|
||||||
* and it's contents are no longer needed by the latter part
|
|
||||||
* of exception prologue
|
|
||||||
*/
|
|
||||||
lsl r9, r8, 16
|
|
||||||
or r9, r9, orig_r8_IS_SCALL
|
|
||||||
|
|
||||||
SAVE_ALL_EXCEPTION r9
|
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
/*--------------------------------------------------------------
|
/*--------------------------------------------------------------
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ static inline long
|
|||||||
syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
|
syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
if (user_mode(regs) && in_syscall(regs))
|
if (user_mode(regs) && in_syscall(regs))
|
||||||
return regs->orig_r8;
|
return regs->r8;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -26,8 +26,7 @@ syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
|
|||||||
static inline void
|
static inline void
|
||||||
syscall_rollback(struct task_struct *task, struct pt_regs *regs)
|
syscall_rollback(struct task_struct *task, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
/* XXX: I can't fathom how pt_regs->r8 will be clobbered ? */
|
regs->r0 = regs->orig_r0;
|
||||||
regs->r8 = regs->orig_r8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline long
|
static inline long
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ struct user_regs_struct {
|
|||||||
long r19, r18, r17, r16, r15, r14, r13;
|
long r19, r18, r17, r16, r15, r14, r13;
|
||||||
} callee;
|
} callee;
|
||||||
long efa; /* break pt addr, for break points in delay slots */
|
long efa; /* break pt addr, for break points in delay slots */
|
||||||
long stop_pc; /* give dbg stop_pc directly after checking orig_r8 */
|
long stop_pc; /* give dbg stop_pc after ensuring brkpt trap */
|
||||||
};
|
};
|
||||||
#endif /* !__ASSEMBLY__ */
|
#endif /* !__ASSEMBLY__ */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user