This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new c95ed45ccc arhc/arm64: vector table may be far away form
arm64_fatal_handle
c95ed45ccc is described below
commit c95ed45ccc3e32e059254d4b0036128f40627648
Author: lipengfei28 <[email protected]>
AuthorDate: Tue Oct 22 16:29:06 2024 +0800
arhc/arm64: vector table may be far away form arm64_fatal_handle
use 33-bit (+/-4GB) pc-relative addressing to load
the address of arm64_fatal_handle
Signed-off-by: lipengfei28 <[email protected]>
---
arch/arm64/src/common/arm64_vectors.S | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/src/common/arm64_vectors.S
b/arch/arm64/src/common/arm64_vectors.S
index 667a97fb79..abb6fb5edc 100644
--- a/arch/arm64/src/common/arm64_vectors.S
+++ b/arch/arm64/src/common/arm64_vectors.S
@@ -141,7 +141,7 @@ SECTION_FUNC(text, arm64_sync_exc)
/* if this is a svc call ?*/
- bne arm64_fatal_handler
+ bne 2f
#ifdef CONFIG_LIB_SYSCALL
/* Handle user system calls separately */
@@ -189,6 +189,10 @@ reserved_syscall:
mov sp, x0
b arm64_exit_exception
+2:
+ adrp x5, arm64_fatal_handler
+ add x5, x5, #:lo12:arm64_fatal_handler
+ br x5
/****************************************************************************
* Name: arm64_irq_handler
@@ -232,8 +236,10 @@ SECTION_FUNC(text, arm64_irq_handler)
GTEXT(arm64_serror_handler)
SECTION_FUNC(text, arm64_serror_handler)
- mov x0, sp
- bl arm64_fatal_handler
+ mov x0, sp
+ adrp x5, arm64_fatal_handler
+ add x5, x5, #:lo12:arm64_fatal_handler
+ br x5
/* Return here only in case of recoverable error */
b arm64_exit_exception
@@ -249,7 +255,9 @@ SECTION_FUNC(text, arm64_serror_handler)
GTEXT(arm64_mode32_handler)
SECTION_FUNC(text, arm64_mode32_handler)
mov x0, sp
- bl arm64_fatal_handler
+ adrp x5, arm64_fatal_handler
+ add x5, x5, #:lo12:arm64_fatal_handler
+ br x5
/* Return here only in case of recoverable error */
b arm64_exit_exception
@@ -267,7 +275,9 @@ SECTION_FUNC(text, arm64_fiq_handler)
#ifndef CONFIG_ARM64_DECODEFIQ
mov x0, sp
- bl arm64_fatal_handler
+ adrp x5, arm64_fatal_handler
+ add x5, x5, #:lo12:arm64_fatal_handler
+ br x5
/* Return here only in case of recoverable error */