diff options
author | Sean Anderson <sean.anderson@seco.com> | 2023-10-27 16:40:15 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-11-10 12:52:33 -0500 |
commit | 47cfdb2192b1f8cb5061bde53fcce562afaeadf2 (patch) | |
tree | 83379c53e7d1821b8351db5dec24f1835f11c526 /arch/arm/lib/vectors.S | |
parent | 6ef83ab6be8978ab85a7d8967e9585ddf5f2bbbd (diff) |
arm: semihosting: Support semihosting fallback on 32-bit ARM
Add support for a semihosting fallback on 32-bit ARM. The assembly is
lightly adapted from the irq return code, except there is no offset
since lr already points to the correct instruction. The C side is mostly
like ARM64, except we have fewer cases to deal with.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Diffstat (limited to 'arch/arm/lib/vectors.S')
-rw-r--r-- | arch/arm/lib/vectors.S | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/lib/vectors.S b/arch/arm/lib/vectors.S index fe8ca403ac9..843f9b9c281 100644 --- a/arch/arm/lib/vectors.S +++ b/arch/arm/lib/vectors.S @@ -275,6 +275,13 @@ software_interrupt: get_bad_stack_swi bad_save_user_regs bl do_software_interrupt +#if CONFIG_IS_ENABLED(SEMIHOSTING_FALLBACK) + ldmia sp, {r0 - lr}^ @ Calling r0 - lr + mov r0, r0 + ldr lr, [sp, #S_PC] @ Get PC + add sp, sp, #S_FRAME_SIZE + movs pc, lr @ return & move spsr_svc into cpsr +#endif .align 5 prefetch_abort: |