diff options
author | Vineet Gupta <vgupta@kernel.org> | 2020-05-20 10:39:09 +0300 |
---|---|---|
committer | Vineet Gupta <vgupta@kernel.org> | 2023-08-18 20:30:07 +0300 |
commit | 13347c10396055c4c6c38a54d10bc6ed5024fbe9 (patch) | |
tree | f224f1f4d129965c58d1e6a8ab5b56e1f2c7f411 /arch/arc/include/asm/entry-compact.h | |
parent | 0e93ecaeebd5d0f189d1fa50a614ac0816a8c703 (diff) | |
download | linux-13347c10396055c4c6c38a54d10bc6ed5024fbe9.tar.xz |
ARC: entry: Add more common chores to EXCEPTION_PROLOGUE
THe high level structure of most ARC exception handlers is
1. save regfile with EXCEPTION_PROLOGUE
2. setup r0: EFA (not part of pt_regs)
3. setup r1: pointer to pt_regs (SP)
4. drop down to pure kernel mode (from exception)
5. call the Linux "C" handler
Remove the boiler plate code by moving #2, #3, #4 into #1.
The exceptions to most exceptions are syscall Trap and Machine check
which don't do some of above for various reasons, so call a newly
introduced variant EXCEPTION_PROLOGUE_KEEP_AE (same as original
EXCEPTION_PROLOGUE)
Tested-by: Pavel Kozlov <Pavel.Kozlov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@kernel.org>
Diffstat (limited to 'arch/arc/include/asm/entry-compact.h')
-rw-r--r-- | arch/arc/include/asm/entry-compact.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arc/include/asm/entry-compact.h b/arch/arc/include/asm/entry-compact.h index 4e2ae82779ed..a0e760eb35a8 100644 --- a/arch/arc/include/asm/entry-compact.h +++ b/arch/arc/include/asm/entry-compact.h @@ -140,7 +140,7 @@ * * After this it is safe to call the "C" handlers *-------------------------------------------------------------*/ -.macro EXCEPTION_PROLOGUE +.macro EXCEPTION_PROLOGUE_KEEP_AE /* Need at least 1 reg to code the early exception prologue */ PROLOG_FREEUP_REG r9, @ex_saved_reg1 @@ -179,6 +179,16 @@ ; OUTPUT: r10 has ECR expected by EV_Trap .endm +.macro EXCEPTION_PROLOGUE + + EXCEPTION_PROLOGUE_KEEP_AE ; return ECR in r10 + + lr r0, [efa] + mov r1, sp + + FAKE_RET_FROM_EXCPN ; clobbers r9 +.endm + /*-------------------------------------------------------------- * Restore all registers used by system call or Exceptions * SP should always be pointing to the next free stack element |