ARC: entry: Add more common chores to EXCEPTION_PROLOGUE
authorVineet Gupta <vgupta@kernel.org>
Wed, 20 May 2020 07:39:09 +0000 (00:39 -0700)
committerVineet Gupta <vgupta@kernel.org>
Fri, 18 Aug 2023 17:30:07 +0000 (10:30 -0700)
commit13347c10396055c4c6c38a54d10bc6ed5024fbe9
treef224f1f4d129965c58d1e6a8ab5b56e1f2c7f411
parent0e93ecaeebd5d0f189d1fa50a614ac0816a8c703
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>
arch/arc/include/asm/entry-arcv2.h
arch/arc/include/asm/entry-compact.h
arch/arc/kernel/entry-arcv2.S
arch/arc/kernel/entry-compact.S
arch/arc/kernel/entry.S