#endif
/* Save Pre Intr/Exception User SP on kernel stack */
- st.a sp, [r9, -16] ; Make room for orig_r0, orig_r8, user_r25
+ st.a sp, [r9, -16] ; Make room for orig_r0, event, user_r25
/* CAUTION:
* SP should be set at the very end when we are done with everything
*-------------------------------------------------------------*/
.macro SAVE_ALL_EXCEPTION marker
- st \marker, [sp, 8] /* orig_r8 */
+ st \marker, [sp, 8] /* event */
st r0, [sp, 4] /* orig_r0, needed only for sys calls */
/* Restore r9 used to code the early prologue */
* Save scratch regs for exceptions
*-------------------------------------------------------------*/
.macro SAVE_ALL_SYS
- SAVE_ALL_EXCEPTION orig_r8_IS_EXCPN
+ SAVE_ALL_EXCEPTION event_EXCPN
.endm
/*--------------------------------------------------------------
* Save scratch regs for sys calls
*-------------------------------------------------------------*/
.macro SAVE_ALL_TRAP
- /*
- * 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
+ SAVE_ALL_EXCEPTION event_SCALL
.endm
/*--------------------------------------------------------------
RESTORE_R12_TO_R0
ld sp, [sp] /* restore original sp */
- /* orig_r0, orig_r8, user_r25 skipped automatically */
+ /* orig_r0, event, user_r25 skipped automatically */
.endm
#endif
/* now we are ready to save the remaining context :) */
- st orig_r8_IS_IRQ1, [sp, 8] /* Event Type */
+ st event_IRQ1, [sp, 8] /* Event Type */
st 0, [sp, 4] /* orig_r0 , N/A for IRQ */
SAVE_R0_TO_R12
ld r9, [@int2_saved_reg]
/* now we are ready to save the remaining context :) */
- st orig_r8_IS_IRQ2, [sp, 8] /* Event Type */
+ st event_IRQ2, [sp, 8] /* Event Type */
st 0, [sp, 4] /* orig_r0 , N/A for IRQ */
SAVE_R0_TO_R12
RESTORE_R12_TO_R0
ld sp, [sp] /* restore original sp */
- /* orig_r0, orig_r8, user_r25 skipped automatically */
+ /* orig_r0, event, user_r25 skipped automatically */
.endm
.macro RESTORE_ALL_INT2
RESTORE_R12_TO_R0
ld sp, [sp] /* restore original sp */
- /* orig_r0, orig_r8, user_r25 skipped automatically */
+ /* orig_r0, event, user_r25 skipped automatically */
.endm
long orig_r0;
/*to distinguish bet excp, syscall, irq */
- union {
-#ifdef CONFIG_CPU_BIG_ENDIAN
- /* so that assembly code is same for LE/BE */
- unsigned long orig_r8:16, event:16;
-#else
- unsigned long event:16, orig_r8:16;
-#endif
- long orig_r8_word;
- };
+ unsigned long event;
long user_r25;
};
/* return 1 if PC in delay slot */
#define delay_mode(regs) ((regs->status32 & STATUS_DE_MASK) == STATUS_DE_MASK)
-#define in_syscall(regs) (regs->event & orig_r8_IS_SCALL)
-#define in_brkpt_trap(regs) (regs->event & orig_r8_IS_BRKPT)
+#define in_syscall(regs) (regs->event & event_SCALL)
+#define in_brkpt_trap(regs) (regs->event & event_BRKPT)
-#define syscall_wont_restart(regs) (regs->event |= orig_r8_IS_SCALL_RESTARTED)
-#define syscall_restartable(regs) !(regs->event & orig_r8_IS_SCALL_RESTARTED)
+#define syscall_wont_restart(regs) (regs->event |= event_SCALL_RESTARTED)
+#define syscall_restartable(regs) !(regs->event & event_SCALL_RESTARTED)
#define current_pt_regs() \
({ \
#endif /* !__ASSEMBLY__ */
-#define orig_r8_IS_SCALL 0x0001
-#define orig_r8_IS_SCALL_RESTARTED 0x0002
-#define orig_r8_IS_BRKPT 0x0004
-#define orig_r8_IS_EXCPN 0x0008
-#define orig_r8_IS_IRQ1 0x0010
-#define orig_r8_IS_IRQ2 0x0020
+#define event_SCALL 0x0001
+#define event_SCALL_RESTARTED 0x0002
+#define event_BRKPT 0x0004
+#define event_EXCPN 0x0008
+#define event_IRQ1 0x0010
+#define event_IRQ2 0x0020
#endif /* __ASM_PTRACE_H */
syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
{
if (user_mode(regs) && in_syscall(regs))
- return regs->orig_r8;
+ return regs->r8;
else
return -1;
}
static inline void
syscall_rollback(struct task_struct *task, struct pt_regs *regs)
{
- /* XXX: I can't fathom how pt_regs->r8 will be clobbered ? */
- regs->r8 = regs->orig_r8;
+ regs->r0 = regs->orig_r0;
}
static inline long
long r19, r18, r17, r16, r15, r14, r13;
} callee;
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 a brkpt trap */
};
#endif /* !__ASSEMBLY__ */
BLANK();
DEFINE(PT_status32, offsetof(struct pt_regs, status32));
- DEFINE(PT_orig_r8, offsetof(struct pt_regs, orig_r8_word));
+ DEFINE(PT_event, offsetof(struct pt_regs, event));
DEFINE(PT_sp, offsetof(struct pt_regs, sp));
DEFINE(PT_r0, offsetof(struct pt_regs, r0));
DEFINE(PT_r1, offsetof(struct pt_regs, r1));
trap_with_param:
; stop_pc info by gdb needs this info
- stw orig_r8_IS_BRKPT, [sp, PT_orig_r8]
+ st event_BRKPT, [sp, PT_event]
mov r0, r12
lr r1, [efa]
; things to what they were, before returning from L2 context
;----------------------------------------------------------------
- ldw r9, [sp, PT_orig_r8] ; get orig_r8 to make sure it is
- brne r9, orig_r8_IS_IRQ2, 149f ; infact a L2 ISR ret path
+ ld r9, [sp, PT_event] ; Ensure L2 ISR ret path
+ brne r9, event_IRQ2, 149f
ld r9, [sp, PT_status32] ; get statu32_l2 (saved in pt_regs)
bbit0 r9, STATUS_A1_BIT, 149f ; L1 not active when L2 IRQ, so normal
* ------------------
* | SP |
* | orig_r0 |
- * | orig_r8 |
+ * | event |
* | user_r25 |
* ------------------ <===== END of PAGE
*/