You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/07/21 02:30:17 UTC

[incubator-nuttx] branch master updated (19fddc4 -> 011c938)

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

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 19fddc4  Kintis:LPUART add RX DMA
     new d2eeeee  Fix xtensa_btdump() to look at the exception frame
     new 011c938  Remove xtensa_backtrace.S reference from esp32s2 as well

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 arch/xtensa/src/common/xtensa.h           |   4 --
 arch/xtensa/src/common/xtensa_backtrace.S | 104 ------------------------------
 arch/xtensa/src/common/xtensa_dumpstate.c |   6 +-
 arch/xtensa/src/esp32/Make.defs           |   4 --
 arch/xtensa/src/esp32s2/Make.defs         |   4 --
 5 files changed, 5 insertions(+), 117 deletions(-)
 delete mode 100644 arch/xtensa/src/common/xtensa_backtrace.S

[incubator-nuttx] 02/02: Remove xtensa_backtrace.S reference from esp32s2 as well

Posted by xi...@apache.org.
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 011c938116716038443d3d385f3f34aa37729b97
Author: Alan C. Assis <ac...@gmail.com>
AuthorDate: Tue Jul 20 16:32:50 2021 -0300

    Remove xtensa_backtrace.S reference from esp32s2 as well
---
 arch/xtensa/src/esp32s2/Make.defs | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/xtensa/src/esp32s2/Make.defs b/arch/xtensa/src/esp32s2/Make.defs
index 7074f98..a5b1140 100644
--- a/arch/xtensa/src/esp32s2/Make.defs
+++ b/arch/xtensa/src/esp32s2/Make.defs
@@ -50,10 +50,6 @@ ifeq ($(CONFIG_DEBUG_ALERT),y)
   CMN_CSRCS += xtensa_dumpstate.c
 endif
 
-ifeq ($(CONFIG_XTENSA_DUMPBT_ON_ASSERT),y)
-  CMN_ASRCS += xtensa_backtrace.S
-endif
-
 ifeq ($(CONFIG_SPINLOCK),y)
   CMN_CSRCS += xtensa_testset.c
 endif

[incubator-nuttx] 01/02: Fix xtensa_btdump() to look at the exception frame

Posted by xi...@apache.org.
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 d2eeeee262ef2d66cf4d7708ce64d0687b08e4e4
Author: Alan C. Assis <ac...@gmail.com>
AuthorDate: Tue Jul 20 09:34:14 2021 -0300

    Fix xtensa_btdump() to look at the exception frame
    
    Remove xtensa_backtrace_start() since it is not used anymore
---
 arch/xtensa/src/common/xtensa.h           |   4 --
 arch/xtensa/src/common/xtensa_backtrace.S | 104 ------------------------------
 arch/xtensa/src/common/xtensa_dumpstate.c |   6 +-
 arch/xtensa/src/esp32/Make.defs           |   4 --
 4 files changed, 5 insertions(+), 113 deletions(-)

diff --git a/arch/xtensa/src/common/xtensa.h b/arch/xtensa/src/common/xtensa.h
index 63eb4f1..4e2bc49 100644
--- a/arch/xtensa/src/common/xtensa.h
+++ b/arch/xtensa/src/common/xtensa.h
@@ -348,9 +348,5 @@ void xtensa_pminitialize(void);
 void up_stack_color(FAR void *stackbase, size_t nbytes);
 #endif
 
-#ifdef CONFIG_XTENSA_DUMPBT_ON_ASSERT
-void xtensa_backtrace_start(uint32_t *pc, uint32_t *sp, uint32_t *next_pc);
-#endif
-
 #endif /* __ASSEMBLY__ */
 #endif /* __ARCH_XTENSA_SRC_COMMON_XTENSA_H */
diff --git a/arch/xtensa/src/common/xtensa_backtrace.S b/arch/xtensa/src/common/xtensa_backtrace.S
deleted file mode 100644
index 8970ff8..0000000
--- a/arch/xtensa/src/common/xtensa_backtrace.S
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
- * arch/xtensa/src/common/xtensa_backtrace.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.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <arch/xtensa/core.h>
-#include <arch/xtensa/xtensa_specregs.h>
-
-#include "xtensa_abi.h"
-
-/*
- * This is how the call stack looks like when calling the function below
- * from xtensa_dumpstate():
- *
- *         High Addr
- *     ..................
- *     |    i-3 BSA     |
- *     |   i-1 locals   | xtensa_assert()
- *     .................. i-1 SP
- *     |    i-2 BSA     |
- *     |    i locals    | xtensa_dumpstate()
- *     ------------------ i SP
- *     |    i-1 BSA     |
- *     |   i+1 locals   | xtensa_btdump()
- *     ------------------ i+1 SP
- *     |     i BSA      |
- *     |   i+2 locals   | xtensa_backtrace_start()
- *     ------------------ i+2 SP
- *     |    i+1 BSA     |
- *     |   i+3 locals   | xtensa_window_spill()
- *     ------------------ i+3 SP
- *     .................. Low Addr
- */
-
-/****************************************************************************
- * Name: xtensa_backtrace_start
- *
- * Description:
- *   Get the first frame of the current stack's backtrace.
- *
- *   Given the following function call flow (B -> A -> X -> xtensa_backtrace_start),
- *   this function will do the following:
- *     - Flush CPU registers and window frames onto the current stack
- *     - Return PC and SP of function A (i.e. start of the stack's backtrace)
- *     - Return PC of function B (i.e. next_pc)
- *
- * Input Parameters:
- *   pc      - PC of the first frame in the backtrace
- *   sp      - SP of the first frame in the backtrace
- *   next_pc - PC of the first frame's caller
- *
- *   C callable as:
- *     void xtensa_backtrace_start(uint32_t *pc, uint32_t *sp, uint32_t *next_pc)
- *
- ****************************************************************************/
-
-    .section    .iram1, "ax"
-    .global     xtensa_backtrace_start
-    .type       xtensa_backtrace_start, @function
-    .align      4
-
-xtensa_backtrace_start:
-
-  ENTRY(32)
-
-  call8   xtensa_window_spill  /* Spill registers onto stack (excluding this
-                                * function) */
-
-  /* a2, a3, a4 should be out arguments for i SP, i PC, i-1 PC respectively.
-   * Use a5 and a6 as scratch.
-   */
-
-  l32e    a5, sp, -16     /* Get i PC, which is ret address of i+1 */
-  s32i    a5, a2, 0       /* Store i PC to arg *pc */
-  l32e    a6, sp, -12     /* Get i+1 SP. Used to access i BS */
-  l32e    a5, a6, -12     /* Get i SP */
-  s32i    a5, a3, 0       /* Store i SP to arg *sp */
-  l32e    a5, a6, -16     /* Get i-1 PC, which is ret address of i */
-  s32i    a5, a4, 0       /* Store i-1 PC to arg *next_pc */
-  RET0
-
-	.size	xtensa_backtrace_start, . - xtensa_backtrace_start
-
diff --git a/arch/xtensa/src/common/xtensa_dumpstate.c b/arch/xtensa/src/common/xtensa_dumpstate.c
index f94fc33..9ca34a7 100644
--- a/arch/xtensa/src/common/xtensa_dumpstate.c
+++ b/arch/xtensa/src/common/xtensa_dumpstate.c
@@ -232,7 +232,11 @@ static inline void xtensa_btdump(void)
   int i;
   bool corrupted = false;
 
-  xtensa_backtrace_start(&pc, &sp, &npc);
+  uint32_t *regs = (uint32_t *)CURRENT_REGS;
+
+  pc  = regs[REG_PC];
+  npc = regs[REG_A0]; /* return register */
+  sp  = regs[REG_A1]; /* stack pointer */
 
   _alert("Backtrace0: %x:%x\n", stackpc(pc), sp);
 
diff --git a/arch/xtensa/src/esp32/Make.defs b/arch/xtensa/src/esp32/Make.defs
index 89ac4fa..268deae 100644
--- a/arch/xtensa/src/esp32/Make.defs
+++ b/arch/xtensa/src/esp32/Make.defs
@@ -50,10 +50,6 @@ ifeq ($(CONFIG_DEBUG_ALERT),y)
   CMN_CSRCS += xtensa_dumpstate.c
 endif
 
-ifeq ($(CONFIG_XTENSA_DUMPBT_ON_ASSERT),y)
-  CMN_ASRCS += xtensa_backtrace.S
-endif
-
 ifeq ($(CONFIG_SPINLOCK),y)
   CMN_CSRCS += xtensa_testset.c
 endif