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/incubator-nuttx.git

commit c99776659f35c34585e4fd03d29bceda1b4a2537
Author: Abdelatif Guettouche <[email protected]>
AuthorDate: Mon May 30 13:03:01 2022 +0200

    xtensa: Delete the assembly signal trampoline.
    
    Signed-off-by: Abdelatif Guettouche <[email protected]>
---
 arch/xtensa/src/common/xtensa.h                |  1 -
 arch/xtensa/src/common/xtensa_schedsigaction.c | 25 ++++++-----
 arch/xtensa/src/common/xtensa_sigtramp.S       | 62 --------------------------
 arch/xtensa/src/esp32/Make.defs                |  1 -
 arch/xtensa/src/esp32s2/Make.defs              |  1 -
 arch/xtensa/src/esp32s3/Make.defs              |  1 -
 6 files changed, 15 insertions(+), 76 deletions(-)

diff --git a/arch/xtensa/src/common/xtensa.h b/arch/xtensa/src/common/xtensa.h
index 008d4d5452..4b7a02d4a0 100644
--- a/arch/xtensa/src/common/xtensa.h
+++ b/arch/xtensa/src/common/xtensa.h
@@ -269,7 +269,6 @@ void xtensa_pause_handler(void);
 
 /* Signals */
 
-void _xtensa_sig_trampoline(void);
 void xtensa_sig_deliver(void);
 
 #ifdef CONFIG_LIB_SYSCALL
diff --git a/arch/xtensa/src/common/xtensa_schedsigaction.c 
b/arch/xtensa/src/common/xtensa_schedsigaction.c
index 485c2f4952..188d6a9f06 100644
--- a/arch/xtensa/src/common/xtensa_schedsigaction.c
+++ b/arch/xtensa/src/common/xtensa_schedsigaction.c
@@ -146,13 +146,14 @@ void up_schedule_sigaction(struct tcb_s *tcb, 
sig_deliver_t sigdeliver)
                */
 
               tcb->xcp.sigdeliver  = sigdeliver;
-              CURRENT_REGS[REG_PC] = (uint32_t)_xtensa_sig_trampoline;
+              CURRENT_REGS[REG_PC] = (uint32_t)xtensa_sig_deliver;
 #ifdef __XTENSA_CALL0_ABI__
               CURRENT_REGS[REG_PS] = (uint32_t)
                   (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM);
 #else
               CURRENT_REGS[REG_PS] = (uint32_t)
-                  (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE);
+                  (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM |
+                   PS_WOE | PS_CALLINC(1));
 #endif
 
               CURRENT_REGS[REG_A1] = (uint32_t)CURRENT_REGS +
@@ -191,13 +192,14 @@ void up_schedule_sigaction(struct tcb_s *tcb, 
sig_deliver_t sigdeliver)
            * disabled
            */
 
-          tcb->xcp.regs[REG_PC] = (uint32_t)_xtensa_sig_trampoline;
+          tcb->xcp.regs[REG_PC] = (uint32_t)xtensa_sig_deliver;
 #ifdef __XTENSA_CALL0_ABI__
           tcb->xcp.regs[REG_PS] = (uint32_t)
               (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM);
 #else
           tcb->xcp.regs[REG_PS] = (uint32_t)
-              (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE);
+              (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM |
+               PS_WOE | PS_CALLINC(1));
 #endif
         }
     }
@@ -296,13 +298,14 @@ void up_schedule_sigaction(struct tcb_s *tcb, 
sig_deliver_t sigdeliver)
                    * disabled
                    */
 
-                  tcb->xcp.regs[REG_PC] = (uint32_t)_xtensa_sig_trampoline;
+                  tcb->xcp.regs[REG_PC] = (uint32_t)xtensa_sig_deliver;
 #ifdef __XTENSA_CALL0_ABI__
                   tcb->xcp.regs[REG_PS] = (uint32_t)
                       (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM);
 #else
                   tcb->xcp.regs[REG_PS] = (uint32_t)
-                      (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE);
+                      (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM |
+                       PS_WOE | PS_CALLINC(1));
 #endif
                 }
               else
@@ -337,13 +340,14 @@ void up_schedule_sigaction(struct tcb_s *tcb, 
sig_deliver_t sigdeliver)
                    * disabled
                    */
 
-                  CURRENT_REGS[REG_PC] = (uint32_t)_xtensa_sig_trampoline;
+                  CURRENT_REGS[REG_PC] = (uint32_t)xtensa_sig_deliver;
 #ifdef __XTENSA_CALL0_ABI__
                   CURRENT_REGS[REG_PS] = (uint32_t)
                       (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM);
 #else
                   CURRENT_REGS[REG_PS] = (uint32_t)
-                      (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE);
+                      (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM |
+                       PS_WOE | PS_CALLINC(1));
 #endif
                 }
 
@@ -410,13 +414,14 @@ void up_schedule_sigaction(struct tcb_s *tcb, 
sig_deliver_t sigdeliver)
            * disabled
            */
 
-          tcb->xcp.regs[REG_PC] = (uint32_t)_xtensa_sig_trampoline;
+          tcb->xcp.regs[REG_PC] = (uint32_t)xtensa_sig_deliver;
 #ifdef __XTENSA_CALL0_ABI__
           tcb->xcp.regs[REG_PS] = (uint32_t)
               (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM);
 #else
           tcb->xcp.regs[REG_PS] = (uint32_t)
-              (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM | PS_WOE);
+              (PS_INTLEVEL(XCHAL_EXCM_LEVEL) | PS_UM |
+               PS_WOE | PS_CALLINC(1));
 #endif
         }
     }
diff --git a/arch/xtensa/src/common/xtensa_sigtramp.S 
b/arch/xtensa/src/common/xtensa_sigtramp.S
deleted file mode 100644
index 0c4f1aab38..0000000000
--- a/arch/xtensa/src/common/xtensa_sigtramp.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
- * arch/xtensa/src/common/xtensa_sigtramp.S
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.  The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-       .file   "xtensa_sigtramp.S"
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: _xtensa_sig_trampoline
- *
- * Description:
- *   Just sets up a proper window call to xtensa_sig_deliver().  We get
- *   here via a context switch setup in up_schedule_signaction.  Which
- *   re-vectors the context switch to this location.
- *
- *   Here we just call xtensa_sig_deliver() using the proper ABI.  NOTE
- *   that this function cannot return and depends on the fact that
- *   xtensa_sig_deliver() does not return.
- *
- *
- ****************************************************************************/
-
-       .text
-       .global _xtensa_sig_trampoline
-       .type   _xtensa_sig_trampoline, @function
-       .align  4
-
-_xtensa_sig_trampoline:
-#ifdef __XTENSA_CALL0_ABI__
-       call0   xtensa_sig_deliver              /* Call xtensa_sig_deliver */
-#else
-       call4   xtensa_sig_deliver              /* Call xtensa_sig_deliver */
-#endif
-
-1:     j               1b                                              /* 
xtensa_sig_deliver does not return */
-
-       .size   _xtensa_sig_trampoline, . - _xtensa_sig_trampoline
diff --git a/arch/xtensa/src/esp32/Make.defs b/arch/xtensa/src/esp32/Make.defs
index 54994e0ccc..6b340a7138 100644
--- a/arch/xtensa/src/esp32/Make.defs
+++ b/arch/xtensa/src/esp32/Make.defs
@@ -29,7 +29,6 @@ HEAD_CSRC  = esp32_start.c esp32_wdt.c
 # Common XTENSA files (arch/xtensa/src/common)
 
 CMN_ASRCS  = xtensa_context.S xtensa_coproc.S xtensa_cpuint.S xtensa_panic.S
-CMN_ASRCS += xtensa_sigtramp.S
 
 CMN_CSRCS  = xtensa_assert.c xtensa_blocktask.c
 CMN_CSRCS += xtensa_cpenable.c xtensa_createstack.c xtensa_exit.c
diff --git a/arch/xtensa/src/esp32s2/Make.defs 
b/arch/xtensa/src/esp32s2/Make.defs
index e5b72fc27e..6c4b9dced1 100644
--- a/arch/xtensa/src/esp32s2/Make.defs
+++ b/arch/xtensa/src/esp32s2/Make.defs
@@ -29,7 +29,6 @@ HEAD_CSRC  = esp32s2_start.c esp32s2_wdt.c
 # Common XTENSA files (arch/xtensa/src/common)
 
 CMN_ASRCS  = xtensa_context.S xtensa_coproc.S xtensa_cpuint.S xtensa_panic.S
-CMN_ASRCS += xtensa_sigtramp.S
 
 CMN_CSRCS  = xtensa_assert.c xtensa_blocktask.c
 CMN_CSRCS += xtensa_cpenable.c xtensa_createstack.c xtensa_exit.c
diff --git a/arch/xtensa/src/esp32s3/Make.defs 
b/arch/xtensa/src/esp32s3/Make.defs
index 98051ca66d..1d4015da6a 100644
--- a/arch/xtensa/src/esp32s3/Make.defs
+++ b/arch/xtensa/src/esp32s3/Make.defs
@@ -29,7 +29,6 @@ HEAD_CSRC  = esp32s3_start.c
 # Common XTENSA files (arch/xtensa/src/common)
 
 CMN_ASRCS  = xtensa_context.S xtensa_coproc.S xtensa_cpuint.S xtensa_panic.S
-CMN_ASRCS += xtensa_sigtramp.S
 
 CMN_CSRCS  = xtensa_assert.c xtensa_blocktask.c
 CMN_CSRCS += xtensa_cpenable.c xtensa_createstack.c xtensa_exit.c

Reply via email to