diff options
author | Vineet Gupta <vgupta@kernel.org> | 2020-05-21 23:33:24 +0300 |
---|---|---|
committer | Vineet Gupta <vgupta@kernel.org> | 2023-12-09 03:30:24 +0300 |
commit | 9de7fc30f288ccee11c74613b9a0ee4904f6875f (patch) | |
tree | f56defa60f62c82f7f4d168c64a0bc30d33706e4 /arch/arc/include/asm/entry-compact.h | |
parent | 33cc938e65a98f1d29d0a18403dbbee050dcad9a (diff) | |
download | linux-9de7fc30f288ccee11c74613b9a0ee4904f6875f.tar.xz |
ARC: entry: SAVE_ABI_CALLEE_REG: ISA/ABI specific helper
And for ARcompact variant replace the PUSH/POP macros with gas provided
push/pop pseudo-instructions
This allows ISA specific implementation
e.g. Current ARCv2 PUSH/POP could be replaced with STD/LDL to save 2
registers at a time (w/o bothering with SP update each time) or
perhaps use ENTER_S/LEAVE_S to reduce code size
For ARCv3 ABI changed so callee regs are now r14-r26 (vs. r13-r25)
thus would need a different implementation.
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 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arc/include/asm/entry-compact.h b/arch/arc/include/asm/entry-compact.h index a0e760eb35a8..9841f1186417 100644 --- a/arch/arc/include/asm/entry-compact.h +++ b/arch/arc/include/asm/entry-compact.h @@ -33,6 +33,38 @@ #include <asm/irqflags-compact.h> #include <asm/thread_info.h> /* For THREAD_SIZE */ +.macro SAVE_ABI_CALLEE_REGS + push r13 + push r14 + push r15 + push r16 + push r17 + push r18 + push r19 + push r20 + push r21 + push r22 + push r23 + push r24 + push r25 +.endm + +.macro RESTORE_ABI_CALLEE_REGS + pop r25 + pop r24 + pop r23 + pop r22 + pop r21 + pop r20 + pop r19 + pop r18 + pop r17 + pop r16 + pop r15 + pop r14 + pop r13 +.endm + /*-------------------------------------------------------------- * Switch to Kernel Mode stack if SP points to User Mode stack * |