diff options
Diffstat (limited to 'arch/arc/include/asm/entry.h')
-rw-r--r-- | arch/arc/include/asm/entry.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/arch/arc/include/asm/entry.h b/arch/arc/include/asm/entry.h index 6b42bf5c45ec..9eada5b28be6 100644 --- a/arch/arc/include/asm/entry.h +++ b/arch/arc/include/asm/entry.h @@ -343,18 +343,12 @@ *-------------------------------------------------------------*/ .macro SAVE_ALL_EXCEPTION marker + st \marker, [sp, 8] + st r0, [sp, 4] /* orig_r0, needed only for sys calls */ + /* Restore r9 used to code the early prologue */ EXCPN_PROLOG_RESTORE_REG r9 - /* Save the complete regfile now */ - - /* orig_r8 marker: - * syscalls -> 1 to NR_SYSCALLS - * Exceptions -> NR_SYSCALLS + 1 - * Break-point-> NR_SYSCALLS + 2 - */ - st \marker, [sp, 8] - st r0, [sp, 4] /* orig_r0, needed only for sys calls */ SAVE_CALLER_SAVED st.a r26, [sp, -4] /* gp */ st.a fp, [sp, -4] @@ -384,14 +378,25 @@ * Save scratch regs for exceptions *-------------------------------------------------------------*/ .macro SAVE_ALL_SYS - SAVE_ALL_EXCEPTION (NR_syscalls + 1) + SAVE_ALL_EXCEPTION orig_r8_IS_EXCPN .endm /*-------------------------------------------------------------- * Save scratch regs for sys calls *-------------------------------------------------------------*/ .macro SAVE_ALL_TRAP - SAVE_ALL_EXCEPTION r8 + /* + * 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 /*-------------------------------------------------------------- @@ -442,7 +447,7 @@ ld r9, [@int1_saved_reg] /* now we are ready to save the remaining context :) */ - st -1, [sp, 8] /* orig_r8, -1 for interuppt level one */ + st orig_r8_IS_IRQ1, [sp, 8] /* Event Type */ st 0, [sp, 4] /* orig_r0 , N/A for IRQ */ SAVE_CALLER_SAVED st.a r26, [sp, -4] /* gp */ |