This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 9ac137475ca476e05de34332f41f845073a4a1e8
Author: Saravanan Sekar <[email protected]>
AuthorDate: Thu Nov 5 12:43:08 2026 +0530

    arch/tricore: Make tricore_svcall.c independent of the iLLD.
    
    tricore_svcall.c read PCXI with the iLLD CPU_PCXI and returned with the
    iLLD __jumpBackToLink().  Use the offset from arch/csfr.h, and write the
    ji a11 return directly in the GNU and TASKING register syntax, as the
    function is entered by a jump.
    
    Signed-off-by: Saravanan Sekar <[email protected]>
---
 arch/tricore/src/common/tricore_svcall.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/tricore/src/common/tricore_svcall.c 
b/arch/tricore/src/common/tricore_svcall.c
index 2c712d4b66e..42685a23690 100644
--- a/arch/tricore/src/common/tricore_svcall.c
+++ b/arch/tricore/src/common/tricore_svcall.c
@@ -67,7 +67,7 @@ void tricore_svcall(volatile void *trap)
 
   UP_DSB();
 
-  plregs = tricore_csa2addr(tricore_mfcr(CPU_PCXI));
+  plregs = tricore_csa2addr(tricore_mfcr(TRICORE_CPU_PCXI));
   puregs = tricore_csa2addr(plregs[REG_LPCXI]);
 
   /* Set irq flag */
@@ -94,7 +94,7 @@ void tricore_svcall(volatile void *trap)
 
       case SYS_restore_context:
         *running_task = tcb;
-        tricore_mtcr(CPU_PCXI, tricore_addr2csa(tcb->xcp.regs));
+        tricore_mtcr(TRICORE_CPU_PCXI, tricore_addr2csa(tcb->xcp.regs));
         UP_ISB();
         break;
 
@@ -107,5 +107,11 @@ void tricore_svcall(volatile void *trap)
 
   up_set_interrupt_context(false);
 
-  __jumpBackToLink();
+  /* Return to the caller, tricore_svcall is entered by a jump */
+
+#ifdef CONFIG_TRICORE_TOOLCHAIN_TASKING
+  __asm__ volatile ("ji a11" : : : "a11");
+#else
+  __asm__ volatile ("ji %a11");
+#endif
 }

Reply via email to