You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gu...@apache.org on 2021/12/20 03:02:25 UTC

[incubator-nuttx] branch master updated: assert: unify stack and register dump across platforms

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3e76c32  assert: unify stack and register dump across platforms
3e76c32 is described below

commit 3e76c3266e245c6b80f194d2f153d40750eea9bc
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Thu Dec 16 03:28:26 2021 +0200

    assert: unify stack and register dump across platforms
    
    Signed-off-by: Petro Karashchenko <pe...@gmail.com>
---
 arch/arm/src/arm/arm_assert.c                 | 24 +++----
 arch/arm/src/armv6-m/arm_assert.c             | 47 ++++---------
 arch/arm/src/armv7-a/arm_assert.c             | 30 ++++----
 arch/arm/src/armv7-m/arm_assert.c             | 49 ++++----------
 arch/arm/src/armv7-r/arm_assert.c             | 30 ++++----
 arch/arm/src/armv8-m/arm_assert.c             | 49 ++++----------
 arch/avr/src/avr/up_dumpstate.c               | 98 +++++++++++----------------
 arch/avr/src/avr32/up_dumpstate.c             | 56 ++++++---------
 arch/hc/src/m9s12/m9s12_assert.c              | 41 +++++------
 arch/mips/src/mips32/mips_dumpstate.c         | 20 +++---
 arch/mips/src/mips32/mips_swint0.c            | 10 ++-
 arch/misoc/src/lm32/lm32_dumpstate.c          | 57 ++++++++--------
 arch/misoc/src/lm32/lm32_swint.c              | 10 ++-
 arch/misoc/src/minerva/minerva_dumpstate.c    | 74 ++++++++++----------
 arch/misoc/src/minerva/minerva_swint.c        | 10 ++-
 arch/or1k/src/common/up_assert.c              | 61 ++++++-----------
 arch/renesas/src/m16c/m16c_dumpstate.c        | 28 ++++----
 arch/renesas/src/rx65n/rx65n_dumpstate.c      | 65 +++++++++---------
 arch/renesas/src/sh1/sh1_dumpstate.c          | 16 ++---
 arch/risc-v/src/common/riscv_tls.c            |  4 +-
 arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c |  2 +-
 arch/risc-v/src/esp32c3/esp32c3_wireless.c    |  2 +-
 arch/risc-v/src/mpfs/mpfs_spi.c               |  8 +--
 arch/risc-v/src/mpfs/mpfs_spi.h               |  8 +--
 arch/risc-v/src/rv32im/riscv_assert.c         | 22 +++---
 arch/risc-v/src/rv32im/riscv_swint.c          |  2 -
 arch/risc-v/src/rv64gc/riscv_assert.c         | 24 +++----
 arch/risc-v/src/rv64gc/riscv_swint.c          |  2 -
 arch/x86/include/i486/arch.h                  |  8 +--
 arch/x86/src/common/up_assert.c               | 20 +++---
 arch/x86/src/i486/up_regdump.c                | 10 +--
 arch/x86_64/include/intel64/arch.h            | 18 ++---
 arch/x86_64/src/common/up_assert.c            | 45 ++++++------
 arch/xtensa/src/common/xtensa_dumpstate.c     |  8 +--
 arch/z16/src/common/z16_registerdump.c        | 20 +++---
 arch/z16/src/common/z16_stackdump.c           | 15 ++--
 arch/z80/src/common/z80_assert.c              |  4 +-
 arch/z80/src/common/z80_internal.h            |  8 +--
 arch/z80/src/common/z80_stackdump.c           | 30 ++++----
 arch/z80/src/ez80/ez80_registerdump.c         | 16 ++---
 arch/z80/src/z180/z180_registerdump.c         | 12 ++--
 arch/z80/src/z8/z8_registerdump.c             |  6 +-
 arch/z80/src/z80/z80_registerdump.c           | 10 +--
 43 files changed, 474 insertions(+), 605 deletions(-)

diff --git a/arch/arm/src/arm/arm_assert.c b/arch/arm/src/arm/arm_assert.c
index e21c617..9d97da2 100644
--- a/arch/arm/src/arm/arm_assert.c
+++ b/arch/arm/src/arm/arm_assert.c
@@ -69,11 +69,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: arm_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void arm_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -89,16 +89,14 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
              ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-#  define up_stackdump(sp,stack_top)
 #endif
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: arm_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static inline void up_registerdump(void)
+static inline void arm_registerdump(void)
 {
   volatile uint32_t *regs = CURRENT_REGS;
   int reg;
@@ -125,8 +123,6 @@ static inline void up_registerdump(void)
 
   _alert("CPSR: %08x\n", regs[REG_CPSR]);
 }
-#else
-# define up_registerdump()
 #endif
 
 /****************************************************************************
@@ -160,7 +156,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -171,7 +167,7 @@ static void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump();
+  arm_registerdump();
 
   /* Get the limits on the user stack memory */
 
@@ -203,12 +199,12 @@ static void up_dumpstate(void)
       /* Yes.. dump the interrupt stack */
 
       _alert("Interrupt Stack\n", sp);
-      up_stackdump(sp, istackbase + istacksize);
+      arm_stackdump(sp, istackbase + istacksize);
     }
   else if (CURRENT_REGS)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      arm_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Extract the user stack pointer if we are in an interrupt handler.
@@ -246,12 +242,12 @@ static void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      arm_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      arm_stackdump(ustackbase, ustackbase + ustacksize);
     }
 
 #ifdef CONFIG_ARCH_USBDUMP
diff --git a/arch/arm/src/armv6-m/arm_assert.c b/arch/arm/src/armv6-m/arm_assert.c
index e8719bc..70bb9a9 100644
--- a/arch/arm/src/armv6-m/arm_assert.c
+++ b/arch/arm/src/armv6-m/arm_assert.c
@@ -68,11 +68,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: arm_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void arm_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -88,16 +88,14 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
              ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-#  define up_stackdump(sp,stack_top)
 #endif
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: arm_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static inline void up_registerdump(FAR volatile uint32_t *regs)
+static inline void arm_registerdump(FAR volatile uint32_t *regs)
 {
   /* Are user registers available from interrupt processing? */
 
@@ -121,14 +119,14 @@ static inline void up_registerdump(FAR volatile uint32_t *regs)
          regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
 #ifdef CONFIG_BUILD_PROTECTED
   _alert("xPSR: %08x PRIMASK: %08x EXEC_RETURN: %08x\n",
-        regs[REG_XPSR], regs[REG_PRIMASK], regs[REG_EXC_RETURN]);
+         regs[REG_XPSR], regs[REG_PRIMASK], regs[REG_EXC_RETURN]);
 #else
   _alert("xPSR: %08x PRIMASK: %08x\n",
-        regs[REG_XPSR], regs[REG_PRIMASK]);
+         regs[REG_XPSR], regs[REG_PRIMASK]);
 #endif
 }
 #else
-# define up_registerdump(regs)
+# define arm_registerdump(regs)
 #endif
 
 /****************************************************************************
@@ -167,7 +165,7 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
 
   /* Dump the registers */
 
-  up_registerdump(tcb->xcp.regs);
+  arm_registerdump(tcb->xcp.regs);
 }
 
 /****************************************************************************
@@ -215,7 +213,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -232,7 +230,7 @@ static void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump(CURRENT_REGS);
+  arm_registerdump(CURRENT_REGS);
 
   /* Get the limits on the user stack memory */
 
@@ -263,12 +261,12 @@ static void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      arm_stackdump(sp, istackbase + istacksize);
     }
   else if (CURRENT_REGS)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      arm_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Extract the user stack pointer if we are in an interrupt handler.
@@ -288,21 +286,6 @@ static void up_dumpstate(void)
 #ifdef CONFIG_STACK_COLORATION
   _alert("  used: %08x\n", up_check_tcbstack(rtcb));
 #endif
-
-  /* Dump the user stack if the stack pointer lies within the allocated user
-   * stack memory.
-   */
-
-  if (sp >= ustackbase && sp < ustackbase + ustacksize)
-    {
-      up_stackdump(sp, ustackbase);
-    }
-  else
-    {
-      _alert("ERROR: Stack pointer is not within the allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
-    }
-
 #else
   _alert("sp:         %08x\n", sp);
   _alert("stack base: %08x\n", ustackbase);
@@ -310,6 +293,7 @@ static void up_dumpstate(void)
 #ifdef CONFIG_STACK_COLORATION
   _alert("stack used: %08x\n", up_check_tcbstack(rtcb));
 #endif
+#endif
 
   /* Dump the user stack if the stack pointer lies within the allocated user
    * stack memory.
@@ -317,14 +301,13 @@ static void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      arm_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      arm_stackdump(ustackbase, ustackbase + ustacksize);
     }
-#endif
 
   /* Dump the state of all tasks (if available) */
 
diff --git a/arch/arm/src/armv7-a/arm_assert.c b/arch/arm/src/armv7-a/arm_assert.c
index 09005b4..c9a84ec 100644
--- a/arch/arm/src/armv7-a/arm_assert.c
+++ b/arch/arm/src/armv7-a/arm_assert.c
@@ -71,11 +71,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: arm_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void arm_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -91,16 +91,14 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
              ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-#  define up_stackdump(sp,stack_top)
 #endif
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: arm_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static inline void up_registerdump(FAR volatile uint32_t *regs)
+static inline void arm_registerdump(FAR volatile uint32_t *regs)
 {
   int reg;
 
@@ -127,7 +125,7 @@ static inline void up_registerdump(FAR volatile uint32_t *regs)
   _alert("CPSR: %08x\n", regs[REG_CPSR]);
 }
 #else
-# define up_registerdump(regs)
+# define arm_registerdump(regs)
 #endif
 
 /****************************************************************************
@@ -166,7 +164,7 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
 
   /* Dump the registers */
 
-  up_registerdump(tcb->xcp.regs);
+  arm_registerdump(tcb->xcp.regs);
 }
 
 /****************************************************************************
@@ -214,7 +212,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -234,7 +232,7 @@ static void up_dumpstate(void)
 
   /* Dump the CPU registers (if available) */
 
-  up_registerdump(CURRENT_REGS);
+  arm_registerdump(CURRENT_REGS);
 
   /* Get the limits on the user stack memory */
 
@@ -293,12 +291,12 @@ static void up_dumpstate(void)
       /* Yes.. dump the interrupt stack */
 
       _alert("Interrupt Stack\n", sp);
-      up_stackdump(sp, istackbase + istacksize);
+      arm_stackdump(sp, istackbase + istacksize);
     }
   else if (CURRENT_REGS)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      arm_stackdump(istackbase, istackbase + istacksize);
     }
 #endif
 
@@ -320,7 +318,7 @@ static void up_dumpstate(void)
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
       _alert("User Stack\n", sp);
-      up_stackdump(sp, ustackbase + ustacksize);
+      arm_stackdump(sp, ustackbase + ustacksize);
     }
 
 #ifdef CONFIG_ARCH_KERNEL_STACK
@@ -332,15 +330,15 @@ static void up_dumpstate(void)
            sp < kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE)
     {
       _alert("Kernel Stack\n", sp);
-      up_stackdump(sp, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
+      arm_stackdump(sp, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
     }
 #endif
   else
     {
       _alert("ERROR: Stack pointer is not within the allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      arm_stackdump(ustackbase, ustackbase + ustacksize);
 #ifdef CONFIG_ARCH_KERNEL_STACK
-      up_stackdump(kstackbase, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
+      arm_stackdump(kstackbase, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
 #endif
     }
 
diff --git a/arch/arm/src/armv7-m/arm_assert.c b/arch/arm/src/armv7-m/arm_assert.c
index 8ece021..5030bde 100644
--- a/arch/arm/src/armv7-m/arm_assert.c
+++ b/arch/arm/src/armv7-m/arm_assert.c
@@ -71,11 +71,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: arm_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void arm_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -91,16 +91,14 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
              ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-#  define up_stackdump(sp,stack_top)
 #endif
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: arm_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static inline void up_registerdump(FAR volatile uint32_t *regs)
+static inline void arm_registerdump(FAR volatile uint32_t *regs)
 {
   /* Are user registers available from interrupt processing? */
 
@@ -125,18 +123,16 @@ static inline void up_registerdump(FAR volatile uint32_t *regs)
 
 #ifdef CONFIG_ARMV7M_USEBASEPRI
   _alert("xPSR: %08x BASEPRI: %08x CONTROL: %08x\n",
-        regs[REG_XPSR], regs[REG_BASEPRI], getcontrol());
+         regs[REG_XPSR], regs[REG_BASEPRI], getcontrol());
 #else
   _alert("xPSR: %08x PRIMASK: %08x CONTROL: %08x\n",
-        regs[REG_XPSR], regs[REG_PRIMASK], getcontrol());
+         regs[REG_XPSR], regs[REG_PRIMASK], getcontrol());
 #endif
 
 #ifdef CONFIG_BUILD_PROTECTED
   _alert("EXC_RETURN: %08x\n", regs[REG_EXC_RETURN]);
 #endif
 }
-#else
-# define up_registerdump(regs)
 #endif
 
 /****************************************************************************
@@ -331,7 +327,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -348,7 +344,7 @@ static void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump(CURRENT_REGS);
+  arm_registerdump(CURRENT_REGS);
 
   /* Get the limits on the user stack memory */
 
@@ -380,12 +376,12 @@ static void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      arm_stackdump(sp, istackbase + istacksize);
     }
   else if (CURRENT_REGS)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      arm_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Extract the user stack pointer if we are in an interrupt handler.
@@ -402,28 +398,11 @@ static void up_dumpstate(void)
   _alert("User stack:\n");
   _alert("  base: %08x\n", ustackbase);
   _alert("  size: %08x\n", ustacksize);
-
-  /* Dump the user stack if the stack pointer lies within the allocated user
-   * stack memory.
-   */
-
-  if (sp >= ustackbase && sp < ustackbase + ustacksize)
-    {
-      up_stackdump(sp, ustackbase + ustacksize);
-    }
-  else
-    {
-      _alert("ERROR: Stack pointer is not within the allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
-    }
-
 #else
-
-  /* Show user stack info */
-
   _alert("sp:         %08x\n", sp);
   _alert("stack base: %08x\n", ustackbase);
   _alert("stack size: %08x\n", ustacksize);
+#endif
 
   /* Dump the user stack if the stack pointer lies within the allocated user
    * stack memory.
@@ -431,16 +410,14 @@ static void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      arm_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within the allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      arm_stackdump(ustackbase, ustackbase + ustacksize);
     }
 
-#endif
-
 #ifdef CONFIG_SMP
   /* Show the CPU number */
 
diff --git a/arch/arm/src/armv7-r/arm_assert.c b/arch/arm/src/armv7-r/arm_assert.c
index aa3668f..b4a7439 100644
--- a/arch/arm/src/armv7-r/arm_assert.c
+++ b/arch/arm/src/armv7-r/arm_assert.c
@@ -68,11 +68,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: arm_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void arm_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -88,16 +88,14 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
              ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-#  define up_stackdump(sp,stack_top)
 #endif
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: arm_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static inline void up_registerdump(FAR volatile uint32_t *regs)
+static inline void arm_registerdump(FAR volatile uint32_t *regs)
 {
   int reg;
 
@@ -124,7 +122,7 @@ static inline void up_registerdump(FAR volatile uint32_t *regs)
   _alert("CPSR: %08x\n", regs[REG_CPSR]);
 }
 #else
-# define up_registerdump(regs)
+# define arm_registerdump(regs)
 #endif
 
 /****************************************************************************
@@ -163,7 +161,7 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
 
   /* Dump the registers */
 
-  up_registerdump(tcb->xcp.regs);
+  arm_registerdump(tcb->xcp.regs);
 }
 
 /****************************************************************************
@@ -211,7 +209,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -231,7 +229,7 @@ static void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump(CURRENT_REGS);
+  arm_registerdump(CURRENT_REGS);
 
   /* Get the limits on the user stack memory */
 
@@ -286,12 +284,12 @@ static void up_dumpstate(void)
       /* Yes.. dump the interrupt stack */
 
       _alert("Interrupt Stack\n", sp);
-      up_stackdump(sp, istackbase + istacksize);
+      arm_stackdump(sp, istackbase + istacksize);
     }
   else if (CURRENT_REGS)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      arm_stackdump(istackbase, istackbase + istacksize);
     }
 #endif
 
@@ -313,7 +311,7 @@ static void up_dumpstate(void)
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
       _alert("User Stack\n", sp);
-      up_stackdump(sp, ustackbase + ustacksize);
+      arm_stackdump(sp, ustackbase + ustacksize);
     }
 
 #ifdef CONFIG_ARCH_KERNEL_STACK
@@ -325,15 +323,15 @@ static void up_dumpstate(void)
            sp < kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE)
     {
       _alert("Kernel Stack\n", sp);
-      up_stackdump(sp, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
+      arm_stackdump(sp, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
     }
 #endif
   else
     {
       _alert("ERROR: Stack pointer is not within the allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      arm_stackdump(ustackbase, ustackbase + ustacksize);
 #ifdef CONFIG_ARCH_KERNEL_STACK
-      up_stackdump(kstackbase, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
+      arm_stackdump(kstackbase, kstackbase + CONFIG_ARCH_KERNEL_STACKSIZE);
 #endif
     }
 
diff --git a/arch/arm/src/armv8-m/arm_assert.c b/arch/arm/src/armv8-m/arm_assert.c
index 726d94d..7f9b4a4 100644
--- a/arch/arm/src/armv8-m/arm_assert.c
+++ b/arch/arm/src/armv8-m/arm_assert.c
@@ -71,11 +71,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: arm_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void arm_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -91,16 +91,14 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
              ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-#  define up_stackdump(sp,stack_top)
 #endif
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: arm_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static inline void up_registerdump(FAR volatile uint32_t *regs)
+static inline void arm_registerdump(FAR volatile uint32_t *regs)
 {
   /* Are user registers available from interrupt processing? */
 
@@ -125,18 +123,16 @@ static inline void up_registerdump(FAR volatile uint32_t *regs)
 
 #ifdef CONFIG_ARMV8M_USEBASEPRI
   _alert("xPSR: %08x BASEPRI: %08x CONTROL: %08x\n",
-        regs[REG_XPSR], regs[REG_BASEPRI], getcontrol());
+         regs[REG_XPSR], regs[REG_BASEPRI], getcontrol());
 #else
   _alert("xPSR: %08x PRIMASK: %08x CONTROL: %08x\n",
-        regs[REG_XPSR], regs[REG_PRIMASK], getcontrol());
+         regs[REG_XPSR], regs[REG_PRIMASK], getcontrol());
 #endif
 
 #ifdef CONFIG_BUILD_PROTECTED
   _alert("EXC_RETURN: %08x\n", regs[REG_EXC_RETURN]);
 #endif
 }
-#else
-# define up_registerdump(regs)
 #endif
 
 /****************************************************************************
@@ -331,7 +327,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -348,7 +344,7 @@ static void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump(CURRENT_REGS);
+  arm_registerdump(CURRENT_REGS);
 
   /* Get the limits on the user stack memory */
 
@@ -380,12 +376,12 @@ static void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      arm_stackdump(sp, istackbase + istacksize);
     }
   else if (CURRENT_REGS)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      arm_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Extract the user stack pointer if we are in an interrupt handler.
@@ -402,28 +398,11 @@ static void up_dumpstate(void)
   _alert("User stack:\n");
   _alert("  base: %08x\n", ustackbase);
   _alert("  size: %08x\n", ustacksize);
-
-  /* Dump the user stack if the stack pointer lies within the allocated user
-   * stack memory.
-   */
-
-  if (sp >= ustackbase && sp < ustackbase + ustacksize)
-    {
-      up_stackdump(sp, ustackbase + ustacksize);
-    }
-  else
-    {
-      _alert("ERROR: Stack pointer is not within the allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
-    }
-
 #else
-
-  /* Show user stack info */
-
   _alert("sp:         %08x\n", sp);
   _alert("stack base: %08x\n", ustackbase);
   _alert("stack size: %08x\n", ustacksize);
+#endif
 
   /* Dump the user stack if the stack pointer lies within the allocated user
    * stack memory.
@@ -431,16 +410,14 @@ static void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      arm_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within the allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      arm_stackdump(ustackbase, ustackbase + ustacksize);
     }
 
-#endif
-
 #ifdef CONFIG_SMP
   /* Show the CPU number */
 
diff --git a/arch/avr/src/avr/up_dumpstate.c b/arch/avr/src/avr/up_dumpstate.c
index 69273fb..6688331 100644
--- a/arch/avr/src/avr/up_dumpstate.c
+++ b/arch/avr/src/avr/up_dumpstate.c
@@ -45,10 +45,10 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: avr_stackdump
  ****************************************************************************/
 
-static void up_stackdump(uint16_t sp, uint16_t stack_top)
+static void avr_stackdump(uint16_t sp, uint16_t stack_top)
 {
   uint16_t stack;
 
@@ -56,65 +56,63 @@ static void up_stackdump(uint16_t sp, uint16_t stack_top)
 
   syslog_flush();
 
-  for (stack = sp & ~0x3; stack < (stack_top & ~0x3); stack += 12)
+  for (stack = sp & ~0x7; stack < (stack_top & ~0x7); stack += 8)
     {
       uint8_t *ptr = (uint8_t *)stack;
-      _alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
-            " %02x %02x %02x %02x\n",
-             stack,
-             ptr[0], ptr[1], ptr[2], ptr[3], ptr[4], ptr[5], ptr[6], ptr[7],
-             ptr[8], ptr[9], ptr[10], ptr[11]);
+      _alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n",
+             stack, ptr[0], ptr[1], ptr[2], ptr[3],
+             ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: avr_registerdump
  ****************************************************************************/
 
-static inline void up_registerdump(void)
+static inline void avr_registerdump(void)
 {
   /* Are user registers available from interrupt processing? */
 
   if (g_current_regs)
     {
       _alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
-            0,
-            g_current_regs[REG_R0],  g_current_regs[REG_R1],
-            g_current_regs[REG_R2],  g_current_regs[REG_R3],
-            g_current_regs[REG_R4],  g_current_regs[REG_R5],
-            g_current_regs[REG_R6],  g_current_regs[REG_R7]);
+             0,
+             g_current_regs[REG_R0],  g_current_regs[REG_R1],
+             g_current_regs[REG_R2],  g_current_regs[REG_R3],
+             g_current_regs[REG_R4],  g_current_regs[REG_R5],
+             g_current_regs[REG_R6],  g_current_regs[REG_R7]);
 
       _alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
-            8,
-            g_current_regs[REG_R8],  g_current_regs[REG_R9],
-            g_current_regs[REG_R10], g_current_regs[REG_R11],
-            g_current_regs[REG_R12], g_current_regs[REG_R13],
-            g_current_regs[REG_R14], g_current_regs[REG_R15]);
+             8,
+             g_current_regs[REG_R8],  g_current_regs[REG_R9],
+             g_current_regs[REG_R10], g_current_regs[REG_R11],
+             g_current_regs[REG_R12], g_current_regs[REG_R13],
+             g_current_regs[REG_R14], g_current_regs[REG_R15]);
 
       _alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
-            16,
-            g_current_regs[REG_R16], g_current_regs[REG_R17],
-            g_current_regs[REG_R18], g_current_regs[REG_R19],
-            g_current_regs[REG_R20], g_current_regs[REG_R21],
-            g_current_regs[REG_R22], g_current_regs[REG_R23]);
+             16,
+             g_current_regs[REG_R16], g_current_regs[REG_R17],
+             g_current_regs[REG_R18], g_current_regs[REG_R19],
+             g_current_regs[REG_R20], g_current_regs[REG_R21],
+             g_current_regs[REG_R22], g_current_regs[REG_R23]);
 
       _alert("R%02d: %02x %02x %02x %02x %02x %02x %02x %02x\n",
-            24,
-            g_current_regs[REG_R24], g_current_regs[REG_R25],
-            g_current_regs[REG_R26], g_current_regs[REG_R27],
-            g_current_regs[REG_R28], g_current_regs[REG_R29],
-            g_current_regs[REG_R30], g_current_regs[REG_R31]);
+             24,
+             g_current_regs[REG_R24], g_current_regs[REG_R25],
+             g_current_regs[REG_R26], g_current_regs[REG_R27],
+             g_current_regs[REG_R28], g_current_regs[REG_R29],
+             g_current_regs[REG_R30], g_current_regs[REG_R31]);
 
 #if !defined(REG_PC2)
       _alert("PC:  %02x%02x  SP: %02x%02x SREG: %02x\n",
-            g_current_regs[REG_PC0], g_current_regs[REG_PC1],
-            g_current_regs[REG_SPH], g_current_regs[REG_SPL],
-            g_current_regs[REG_SREG]);
+             g_current_regs[REG_PC0], g_current_regs[REG_PC1],
+             g_current_regs[REG_SPH], g_current_regs[REG_SPL],
+             g_current_regs[REG_SREG]);
 #else
       _alert("PC:  %02x%02x%02x  SP: %02x%02x SREG: %02x\n",
-            g_current_regs[REG_PC0], g_current_regs[REG_PC1],
-            g_current_regs[REG_PC2], g_current_regs[REG_SPH],
-            g_current_regs[REG_SPL], g_current_regs[REG_SREG]);
+             g_current_regs[REG_PC0], g_current_regs[REG_PC1],
+             g_current_regs[REG_PC2], g_current_regs[REG_SPH],
+             g_current_regs[REG_SPL], g_current_regs[REG_SREG]);
 #endif
     }
 }
@@ -129,7 +127,7 @@ static inline void up_registerdump(void)
 
 void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint16_t sp = up_getsp();
   uint16_t ustackbase;
   uint16_t ustacksize;
@@ -140,7 +138,7 @@ void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump();
+  avr_registerdump();
 
   /* Get the limits on the user stack memory */
 
@@ -171,12 +169,12 @@ void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      avr_stackdump(sp, istackbase + istacksize);
     }
   else if (g_current_regs)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      avr_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Extract the user stack pointer if we are in an interrupt handler.
@@ -196,20 +194,6 @@ void up_dumpstate(void)
 #ifdef CONFIG_STACK_COLORATION
   _alert("  used: %08x\n", up_check_tcbstack(rtcb));
 #endif
-
-  /* Dump the user stack if the stack pointer lies within the allocated user
-   * stack memory.
-   */
-
-  if (sp >= ustackbase && sp < ustackbase + ustacksize)
-    {
-      up_stackdump(sp, ustackbase + ustacksize);
-    }
-  else
-    {
-      _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
-    }
 #else
   _alert("sp:         %04x\n", sp);
   _alert("stack base: %04x\n", ustackbase);
@@ -217,6 +201,7 @@ void up_dumpstate(void)
 #ifdef CONFIG_STACK_COLORATION
   _alert("stack used: %08x\n", up_check_tcbstack(rtcb));
 #endif
+#endif
 
   /* Dump the user stack if the stack pointer lies within the allocated user
    * stack memory.
@@ -224,14 +209,13 @@ void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      avr_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      avr_stackdump(ustackbase, ustackbase + ustacksize);
     }
-#endif
 }
 
 #endif /* CONFIG_ARCH_STACKDUMP */
diff --git a/arch/avr/src/avr32/up_dumpstate.c b/arch/avr/src/avr32/up_dumpstate.c
index ace3b8f..780933e 100644
--- a/arch/avr/src/avr32/up_dumpstate.c
+++ b/arch/avr/src/avr32/up_dumpstate.c
@@ -45,10 +45,10 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: avr_stackdump
  ****************************************************************************/
 
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void avr_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -66,28 +66,28 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 }
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: avr_registerdump
  ****************************************************************************/
 
-static inline void up_registerdump(void)
+static inline void avr_registerdump(void)
 {
   /* Are user registers available from interrupt processing? */
 
   if (g_current_regs)
     {
       _alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
-            0,
-            g_current_regs[REG_R0], g_current_regs[REG_R1],
-            g_current_regs[REG_R2], g_current_regs[REG_R3],
-            g_current_regs[REG_R4], g_current_regs[REG_R5],
-            g_current_regs[REG_R6], g_current_regs[REG_R7]);
+             0,
+             g_current_regs[REG_R0], g_current_regs[REG_R1],
+             g_current_regs[REG_R2], g_current_regs[REG_R3],
+             g_current_regs[REG_R4], g_current_regs[REG_R5],
+             g_current_regs[REG_R6], g_current_regs[REG_R7]);
 
       _alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
-            8,
-            g_current_regs[REG_R8],  g_current_regs[REG_R9],
-            g_current_regs[REG_R10], g_current_regs[REG_R11],
-            g_current_regs[REG_R12], g_current_regs[REG_R13],
-            g_current_regs[REG_R14], g_current_regs[REG_R15]);
+             8,
+             g_current_regs[REG_R8],  g_current_regs[REG_R9],
+             g_current_regs[REG_R10], g_current_regs[REG_R11],
+             g_current_regs[REG_R12], g_current_regs[REG_R13],
+             g_current_regs[REG_R14], g_current_regs[REG_R15]);
 
       _alert("SR: %08x\n", g_current_regs[REG_SR]);
     }
@@ -99,7 +99,7 @@ static inline void up_registerdump(void)
 
 void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -110,7 +110,7 @@ void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump();
+  avr_registerdump();
 
   /* Get the limits on the user stack memory */
 
@@ -141,12 +141,12 @@ void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      avr_stackdump(sp, istackbase + istacksize);
     }
   else if (g_current_regs)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      avr_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Extract the user stack pointer if we are in an interrupt handler.
@@ -166,20 +166,6 @@ void up_dumpstate(void)
 #ifdef CONFIG_STACK_COLORATION
   _alert("  used: %08x\n", up_check_tcbstack(rtcb));
 #endif
-
-  /* Dump the user stack if the stack pointer lies within the allocated user
-   * stack memory.
-   */
-
-  if (sp >= ustackbase && sp < ustackbase + ustacksize)
-    {
-      up_stackdump(sp, ustackbase + ustacksize);
-    }
-  else
-    {
-      _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
-    }
 #else
   _alert("sp:         %08x\n", sp);
   _alert("stack base: %08x\n", ustackbase);
@@ -187,6 +173,7 @@ void up_dumpstate(void)
 #ifdef CONFIG_STACK_COLORATION
   _alert("stack used: %08x\n", up_check_tcbstack(rtcb));
 #endif
+#endif
 
   /* Dump the user stack if the stack pointer lies within the allocated user
    * stack memory.
@@ -194,13 +181,12 @@ void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      avr_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      avr_stackdump(ustackbase, ustackbase + ustacksize);
     }
-#endif
 }
 #endif
diff --git a/arch/hc/src/m9s12/m9s12_assert.c b/arch/hc/src/m9s12/m9s12_assert.c
index 66829f2..484fac6 100644
--- a/arch/hc/src/m9s12/m9s12_assert.c
+++ b/arch/hc/src/m9s12/m9s12_assert.c
@@ -68,11 +68,11 @@ static uint8_t s_last_regs[XCPTCONTEXT_REGS];
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: hc_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint16_t sp, uint16_t stack_top)
+static void hc_stackdump(uint16_t sp, uint16_t stack_top)
 {
   uint16_t stack;
 
@@ -80,27 +80,22 @@ static void up_stackdump(uint16_t sp, uint16_t stack_top)
 
   syslog_flush();
 
-  for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 16)
+  for (stack = sp & ~0x7; stack < (stack_top & ~0x7); stack += 8)
     {
       uint8_t *ptr = (uint8_t *)stack;
-
-      _alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x"
-            "   %02x %02x %02x %02x %02x %02x %02x %02x\n",
-             stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4],
-             ptr[5], ptr[6], ptr[7], ptr[8], ptr[9], ptr[10],
-             ptr[11], ptr[12], ptr[13], ptr[14], ptr[15]);
+      _alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n",
+             stack, ptr[0], ptr[1], ptr[2], ptr[3],
+             ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-# define up_stackdump()
 #endif
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: hc_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static inline void up_registerdump(void)
+static inline void hc_registerdump(void)
 {
   volatile uint8_t *regs = g_current_regs;
 
@@ -127,19 +122,17 @@ static inline void up_registerdump(void)
 #  error "Need to save more registers"
 #elif CONFIG_HCS12_MSOFTREGS == 2
   _alert("SOFTREGS: %02x%02x :%02x%02x\n",
-        regs[REG_SOFTREG1], regs[REG_SOFTREG1 + 1],
-        regs[REG_SOFTREG2], regs[REG_SOFTREG2 + 1]);
+         regs[REG_SOFTREG1], regs[REG_SOFTREG1 + 1],
+         regs[REG_SOFTREG2], regs[REG_SOFTREG2 + 1]);
 #elif CONFIG_HCS12_MSOFTREGS == 1
   _alert("SOFTREGS: %02x%02x\n",
-        regs[REG_SOFTREG1], regs[REG_SOFTREG1 + 1]);
+         regs[REG_SOFTREG1], regs[REG_SOFTREG1 + 1]);
 #endif
 
 #ifndef CONFIG_HCS12_NONBANKED
   _alert("PPAGE: %02x\n", regs[REG_PPAGE]);
 #endif
 }
-#else
-# define up_registerdump()
 #endif
 
 /****************************************************************************
@@ -173,7 +166,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint16_t sp = up_getsp();
   uint16_t ustackbase;
   uint16_t ustacksize;
@@ -184,7 +177,7 @@ static void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump();
+  hc_registerdump();
 
   /* Get the limits on the user stack memory */
 
@@ -212,7 +205,7 @@ static void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      hc_stackdump(sp, istackbase + istacksize);
 
       /* Extract the user stack pointer which should lie
        * at the base of the interrupt stack.
@@ -224,7 +217,7 @@ static void up_dumpstate(void)
   else if (g_current_regs)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      hc_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Show user stack info */
@@ -244,12 +237,12 @@ static void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      hc_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      hc_stackdump(ustackbase, ustackbase + ustacksize);
     }
 
 #ifdef CONFIG_ARCH_USBDUMP
diff --git a/arch/mips/src/mips32/mips_dumpstate.c b/arch/mips/src/mips32/mips_dumpstate.c
index 2eab5ff..d148f8f 100644
--- a/arch/mips/src/mips32/mips_dumpstate.c
+++ b/arch/mips/src/mips32/mips_dumpstate.c
@@ -46,10 +46,10 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: mips_stackdump
  ****************************************************************************/
 
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void mips_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -69,10 +69,10 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 }
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: mips_registerdump
  ****************************************************************************/
 
-static inline void up_registerdump(void)
+static inline void mips_registerdump(void)
 {
   /* Are user registers available from interrupt processing? */
 
@@ -129,7 +129,7 @@ static inline void up_registerdump(void)
 
 void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -140,7 +140,7 @@ void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump();
+  mips_registerdump();
 
   /* Get the limits on the user stack memory */
 
@@ -168,7 +168,7 @@ void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      mips_stackdump(sp, istackbase + istacksize);
 
       /* Extract the user stack pointer which should lie
        * at the base of the interrupt stack.
@@ -180,7 +180,7 @@ void up_dumpstate(void)
   else if (CURRENT_REGS)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      mips_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Show user stack info */
@@ -200,12 +200,12 @@ void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      mips_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      mips_stackdump(ustackbase, ustackbase + ustacksize);
     }
 }
 
diff --git a/arch/mips/src/mips32/mips_swint0.c b/arch/mips/src/mips32/mips_swint0.c
index 38906b6..9cca35b 100644
--- a/arch/mips/src/mips32/mips_swint0.c
+++ b/arch/mips/src/mips32/mips_swint0.c
@@ -44,11 +44,11 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: mips_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_SYSCALL_INFO
-static void up_registerdump(const uint32_t *regs)
+static void mips_registerdump(const uint32_t *regs)
 {
   svcinfo("MFLO:%08x MFHI:%08x EPC:%08x STATUS:%08x\n",
           regs[REG_MFLO], regs[REG_MFHI], regs[REG_EPC], regs[REG_STATUS]);
@@ -73,8 +73,6 @@ static void up_registerdump(const uint32_t *regs)
           regs[REG_RA]);
 #endif
 }
-#else
-#  define up_registerdump(regs)
 #endif
 
 /****************************************************************************
@@ -143,7 +141,7 @@ int up_swint0(int irq, FAR void *context, FAR void *arg)
 
 #ifdef CONFIG_DEBUG_SYSCALL_INFO
   svcinfo("Entry: regs: %p cmd: %d\n", regs, regs[REG_R4]);
-  up_registerdump(regs);
+  mips_registerdump(regs);
 #endif
 
   /* Handle the SWInt according to the command in $4 */
@@ -289,7 +287,7 @@ int up_swint0(int irq, FAR void *context, FAR void *arg)
   if (regs != CURRENT_REGS)
     {
       svcinfo("SWInt Return: Context switch!\n");
-      up_registerdump((const uint32_t *)CURRENT_REGS);
+      mips_registerdump((const uint32_t *)CURRENT_REGS);
     }
   else
     {
diff --git a/arch/misoc/src/lm32/lm32_dumpstate.c b/arch/misoc/src/lm32/lm32_dumpstate.c
index de704c6..822cfdd 100644
--- a/arch/misoc/src/lm32/lm32_dumpstate.c
+++ b/arch/misoc/src/lm32/lm32_dumpstate.c
@@ -44,10 +44,10 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: lm32_stackdump
  ****************************************************************************/
 
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void lm32_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -65,43 +65,42 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 }
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: lm32_registerdump
  ****************************************************************************/
 
-static inline void up_registerdump(void)
+static inline void lm32_registerdump(void)
 {
   /* Are user registers available from interrupt processing? */
 
   if (g_current_regs)
     {
       _alert("EPC:%08x \n",
-            g_current_regs[REG_EPC]);
+             g_current_regs[REG_EPC]);
       _alert(" X0:%08x  A0:%08x  A1:%08x  A2:%08x "
              " A3:%08x  A4:%08x  A5:%08x  A6:%08x\n",
-            g_current_regs[REG_X0_NDX], g_current_regs[REG_X1_NDX],
-            g_current_regs[REG_X2_NDX], g_current_regs[REG_X3_NDX],
-            g_current_regs[REG_X4_NDX], g_current_regs[REG_X5_NDX],
-            g_current_regs[REG_X6_NDX], g_current_regs[REG_X7_NDX]);
+             g_current_regs[REG_X0_NDX], g_current_regs[REG_X1_NDX],
+             g_current_regs[REG_X2_NDX], g_current_regs[REG_X3_NDX],
+             g_current_regs[REG_X4_NDX], g_current_regs[REG_X5_NDX],
+             g_current_regs[REG_X6_NDX], g_current_regs[REG_X7_NDX]);
       _alert(" A7:%08x  X9:%08x X10:%08x X11:%08x "
              "X12:%08x X13:%08x X14:%08x X15:%08x\n",
-            g_current_regs[REG_X8_NDX], g_current_regs[REG_X9_NDX],
-            g_current_regs[REG_X10_NDX], g_current_regs[REG_X11_NDX],
-            g_current_regs[REG_X12_NDX], g_current_regs[REG_X13_NDX],
-            g_current_regs[REG_X14_NDX], g_current_regs[REG_X15_NDX]);
+             g_current_regs[REG_X8_NDX], g_current_regs[REG_X9_NDX],
+             g_current_regs[REG_X10_NDX], g_current_regs[REG_X11_NDX],
+             g_current_regs[REG_X12_NDX], g_current_regs[REG_X13_NDX],
+             g_current_regs[REG_X14_NDX], g_current_regs[REG_X15_NDX]);
       _alert("X16:%08x X17:%08x X18:%08x X19:%08x "
              "X20:%08x X21:%08x X22:%08x X23:%08x\n",
-            g_current_regs[REG_X16_NDX], g_current_regs[REG_X17_NDX],
-            g_current_regs[REG_X18_NDX], g_current_regs[REG_X19_NDX],
-            g_current_regs[REG_X20_NDX], g_current_regs[REG_X21_NDX],
-            g_current_regs[REG_X22_NDX], g_current_regs[REG_X23_NDX]);
+             g_current_regs[REG_X16_NDX], g_current_regs[REG_X17_NDX],
+             g_current_regs[REG_X18_NDX], g_current_regs[REG_X19_NDX],
+             g_current_regs[REG_X20_NDX], g_current_regs[REG_X21_NDX],
+             g_current_regs[REG_X22_NDX], g_current_regs[REG_X23_NDX]);
       _alert("X24:%08x X25:%08x  GP:%08x  FP:%08x "
              " SP:%08x  RA:%08x  EA:%08x  BA:%08x\n",
-            g_current_regs[REG_X24_NDX], g_current_regs[REG_X25_NDX],
-            g_current_regs[REG_X26_NDX], g_current_regs[REG_X27_NDX],
-            g_current_regs[REG_X28_NDX], g_current_regs[REG_X29_NDX],
-            g_current_regs[REG_X30_NDX], g_current_regs[REG_X31_NDX]);
-      _alert(" IE:%08x\n",
-            g_current_regs[REG_X32_NDX]);
+             g_current_regs[REG_X24_NDX], g_current_regs[REG_X25_NDX],
+             g_current_regs[REG_X26_NDX], g_current_regs[REG_X27_NDX],
+             g_current_regs[REG_X28_NDX], g_current_regs[REG_X29_NDX],
+             g_current_regs[REG_X30_NDX], g_current_regs[REG_X31_NDX]);
+      _alert(" IE:%08x\n", g_current_regs[REG_X32_NDX]);
     }
 }
 
@@ -115,7 +114,7 @@ static inline void up_registerdump(void)
 
 void lm32_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -126,7 +125,7 @@ void lm32_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump();
+  lm32_registerdump();
 
   /* Get the limits on the user stack memory */
 
@@ -154,7 +153,7 @@ void lm32_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      lm32_stackdump(sp, istackbase + istacksize);
 
       /* Extract the user stack pointer which should lie
        * at the base of the interrupt stack.
@@ -166,7 +165,7 @@ void lm32_dumpstate(void)
   else if (g_current_regs)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      lm32_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Show user stack info */
@@ -186,12 +185,12 @@ void lm32_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      lm32_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      lm32_stackdump(ustackbase, ustackbase + ustacksize);
     }
 }
 
diff --git a/arch/misoc/src/lm32/lm32_swint.c b/arch/misoc/src/lm32/lm32_swint.c
index cff92be..1d7454c 100644
--- a/arch/misoc/src/lm32/lm32_swint.c
+++ b/arch/misoc/src/lm32/lm32_swint.c
@@ -41,11 +41,11 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: lm32_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_SYSCALL_INFO
-static void up_registerdump(const uint32_t *regs)
+static void lm32_registerdump(const uint32_t *regs)
 {
 #if 0
   svcinfo("EPC:%08x\n",
@@ -73,8 +73,6 @@ static void up_registerdump(const uint32_t *regs)
 #endif
 #endif
 }
-#else
-#  define up_registerdump(regs)
 #endif
 
 /****************************************************************************
@@ -143,7 +141,7 @@ int lm32_swint(int irq, FAR void *context, FAR void *arg)
 
 #ifdef CONFIG_DEBUG_SYSCALL_INFO
   svcinfo("Entry: regs: %p cmd: %d\n", regs, regs[REG_A0]);
-  up_registerdump(regs);
+  lm32_registerdump(regs);
 #endif
 
   /* Handle the SWInt according to the command in $a0 */
@@ -290,7 +288,7 @@ int lm32_swint(int irq, FAR void *context, FAR void *arg)
   if (regs != g_current_regs)
     {
       svcinfo("SWInt Return: Context switch!\n");
-      up_registerdump((const uint32_t *)g_current_regs);
+      lm32_registerdump((const uint32_t *)g_current_regs);
     }
   else
     {
diff --git a/arch/misoc/src/minerva/minerva_dumpstate.c b/arch/misoc/src/minerva/minerva_dumpstate.c
index 7be48d3..3b488a1 100644
--- a/arch/misoc/src/minerva/minerva_dumpstate.c
+++ b/arch/misoc/src/minerva/minerva_dumpstate.c
@@ -44,10 +44,10 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: mineva_stackdump
  ****************************************************************************/
 
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void mineva_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -57,7 +57,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 
   for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32)
     {
-      uint32_t *ptr = (uint32_t *) stack;
+      uint32_t *ptr = (uint32_t *)stack;
       _alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
              stack, ptr[0], ptr[1], ptr[2], ptr[3],
              ptr[4], ptr[5], ptr[6], ptr[7]);
@@ -65,44 +65,40 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
 }
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: mineva_registerdump
  ****************************************************************************/
 
-static inline void up_registerdump(void)
+static inline void mineva_registerdump(void)
 {
   /* Are user registers available from interrupt processing? */
 
   if (g_current_regs)
     {
       _alert("EPC:%08x \n", g_current_regs[REG_CSR_MEPC]);
-      _alert
-        (" X0:%08x  A0:%08x  A1:%08x  A2:%08x "
-         " A3:%08x  A4:%08x  A5:%08x  A6:%08x\n",
-         g_current_regs[REG_X0_NDX], g_current_regs[REG_X1_NDX],
-         g_current_regs[REG_X2_NDX], g_current_regs[REG_X3_NDX],
-         g_current_regs[REG_X4_NDX], g_current_regs[REG_X5_NDX],
-         g_current_regs[REG_X6_NDX], g_current_regs[REG_X7_NDX]);
-      _alert
-        (" A7:%08x  X9:%08x X10:%08x X11:%08x "
-         "X12:%08x X13:%08x X14:%08x X15:%08x\n",
-         g_current_regs[REG_X8_NDX], g_current_regs[REG_X9_NDX],
-         g_current_regs[REG_X10_NDX], g_current_regs[REG_X11_NDX],
-         g_current_regs[REG_X12_NDX], g_current_regs[REG_X13_NDX],
-         g_current_regs[REG_X14_NDX], g_current_regs[REG_X15_NDX]);
-      _alert
-        ("X16:%08x X17:%08x X18:%08x X19:%08x "
-         "X20:%08x X21:%08x X22:%08x X23:%08x\n",
-         g_current_regs[REG_X16_NDX], g_current_regs[REG_X17_NDX],
-         g_current_regs[REG_X18_NDX], g_current_regs[REG_X19_NDX],
-         g_current_regs[REG_X20_NDX], g_current_regs[REG_X21_NDX],
-         g_current_regs[REG_X22_NDX], g_current_regs[REG_X23_NDX]);
-      _alert
-        ("X24:%08x X25:%08x  GP:%08x  FP:%08x "
-         " SP:%08x  RA:%08x  EA:%08x  BA:%08x\n",
-         g_current_regs[REG_X24_NDX], g_current_regs[REG_X25_NDX],
-         g_current_regs[REG_X26_NDX], g_current_regs[REG_X27_NDX],
-         g_current_regs[REG_X28_NDX], g_current_regs[REG_X29_NDX],
-         g_current_regs[REG_X30_NDX], g_current_regs[REG_X31_NDX]);
+      _alert(" X0:%08x  A0:%08x  A1:%08x  A2:%08x "
+             " A3:%08x  A4:%08x  A5:%08x  A6:%08x\n",
+             g_current_regs[REG_X0_NDX], g_current_regs[REG_X1_NDX],
+             g_current_regs[REG_X2_NDX], g_current_regs[REG_X3_NDX],
+             g_current_regs[REG_X4_NDX], g_current_regs[REG_X5_NDX],
+             g_current_regs[REG_X6_NDX], g_current_regs[REG_X7_NDX]);
+      _alert(" A7:%08x  X9:%08x X10:%08x X11:%08x "
+             "X12:%08x X13:%08x X14:%08x X15:%08x\n",
+             g_current_regs[REG_X8_NDX], g_current_regs[REG_X9_NDX],
+             g_current_regs[REG_X10_NDX], g_current_regs[REG_X11_NDX],
+             g_current_regs[REG_X12_NDX], g_current_regs[REG_X13_NDX],
+             g_current_regs[REG_X14_NDX], g_current_regs[REG_X15_NDX]);
+      _alert("X16:%08x X17:%08x X18:%08x X19:%08x"
+             "X20:%08x X21:%08x X22:%08x X23:%08x\n",
+             g_current_regs[REG_X16_NDX], g_current_regs[REG_X17_NDX],
+             g_current_regs[REG_X18_NDX], g_current_regs[REG_X19_NDX],
+             g_current_regs[REG_X20_NDX], g_current_regs[REG_X21_NDX],
+             g_current_regs[REG_X22_NDX], g_current_regs[REG_X23_NDX]);
+      _alert("X24:%08x X25:%08x  GP:%08x  FP:%08x "
+             " SP:%08x  RA:%08x  EA:%08x  BA:%08x\n",
+             g_current_regs[REG_X24_NDX], g_current_regs[REG_X25_NDX],
+             g_current_regs[REG_X26_NDX], g_current_regs[REG_X27_NDX],
+             g_current_regs[REG_X28_NDX], g_current_regs[REG_X29_NDX],
+             g_current_regs[REG_X30_NDX], g_current_regs[REG_X31_NDX]);
       _alert(" IE:%08x\n", g_current_regs[REG_CSR_MSTATUS]);
     }
 }
@@ -117,7 +113,7 @@ static inline void up_registerdump(void)
 
 void minerva_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -128,7 +124,7 @@ void minerva_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump();
+  mineva_registerdump();
 
   /* Get the limits on the user stack memory NOTE: You cannot use the PID to
    * determine if this is an IDLE task.  In the SMP case, there may be
@@ -159,7 +155,7 @@ void minerva_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      mineva_stackdump(sp, istackbase + istacksize);
 
       /* Extract the user stack pointer which should lie at the base of the
        * interrupt stack.
@@ -171,7 +167,7 @@ void minerva_dumpstate(void)
   else if (g_current_regs)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      mineva_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Show user stack info */
@@ -191,12 +187,12 @@ void minerva_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      mineva_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      mineva_stackdump(ustackbase, ustackbase + ustacksize);
     }
 }
 
diff --git a/arch/misoc/src/minerva/minerva_swint.c b/arch/misoc/src/minerva/minerva_swint.c
index 2ec3d4b..d6c5b19 100644
--- a/arch/misoc/src/minerva/minerva_swint.c
+++ b/arch/misoc/src/minerva/minerva_swint.c
@@ -41,11 +41,11 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: minerva_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_SYSCALL_INFO
-static void up_registerdump(const uint32_t * regs)
+static void minerva_registerdump(const uint32_t * regs)
 {
 #if 0
   svcinfo("EPC:%08x\n", regs[REG_CSR_MEPC]);
@@ -73,8 +73,6 @@ static void up_registerdump(const uint32_t * regs)
 #endif
 #endif
 }
-#else
-#  define up_registerdump(regs)
 #endif
 
 /****************************************************************************
@@ -139,7 +137,7 @@ int minerva_swint(int irq, FAR void *context, FAR void *arg)
 
 #ifdef CONFIG_DEBUG_SYSCALL_INFO
   svcinfo("Entry: regs: %p cmd: %d\n", regs, regs[REG_A0]);
-  up_registerdump(regs);
+  minerva_registerdump(regs);
 #endif
 
   /* Handle the SWInt according to the command in $a0 */
@@ -267,7 +265,7 @@ int minerva_swint(int irq, FAR void *context, FAR void *arg)
   if (regs != g_current_regs)
     {
       svcinfo("SWInt Return: Context switch!\n");
-      up_registerdump((const uint32_t *)g_current_regs);
+      minerva_registerdump((const uint32_t *)g_current_regs);
     }
   else
     {
diff --git a/arch/or1k/src/common/up_assert.c b/arch/or1k/src/common/up_assert.c
index 6f0e4f1..c9bd200 100644
--- a/arch/or1k/src/common/up_assert.c
+++ b/arch/or1k/src/common/up_assert.c
@@ -68,11 +68,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: or1k_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void or1k_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -88,8 +88,6 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
              ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-#  define up_stackdump(sp,stack_top)
 #endif
 
 /****************************************************************************
@@ -103,12 +101,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
 
 #if CONFIG_TASK_NAME_SIZE > 0
   _alert("%s: PID=%d Stack Used=%lu of %lu\n",
-        tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
-        (unsigned long)tcb->adj_stack_size);
+         tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
+         (unsigned long)tcb->adj_stack_size);
 #else
   _alert("PID: %d Stack Used=%lu of %lu\n",
-        tcb->pid, (unsigned long)up_check_tcbstack(tcb),
-        (unsigned long)tcb->adj_stack_size);
+         tcb->pid, (unsigned long)up_check_tcbstack(tcb),
+         (unsigned long)tcb->adj_stack_size);
 #endif
 }
 #endif
@@ -129,11 +127,11 @@ static inline void up_showtasks(void)
 #endif
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: or1k_registerdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static inline void up_registerdump(void)
+static inline void or1k_registerdump(void)
 {
   volatile uint32_t *regs = CURRENT_REGS;
 
@@ -150,21 +148,19 @@ static inline void up_registerdump(void)
   /* Dump the interrupt registers */
 
   _alert("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
-        regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
-        regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
+         regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
+         regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
   _alert("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
-        regs[REG_R8],  regs[REG_R9],  regs[REG_R10], regs[REG_R11],
-        regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
+         regs[REG_R8],  regs[REG_R9],  regs[REG_R10], regs[REG_R11],
+         regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
 #ifdef CONFIG_BUILD_PROTECTED
   _alert("xPSR: %08x PRIMASK: %08x EXEC_RETURN: %08x\n",
-        regs[REG_XPSR], regs[REG_PRIMASK], regs[REG_EXC_RETURN]);
+         regs[REG_XPSR], regs[REG_PRIMASK], regs[REG_EXC_RETURN]);
 #else
   _alert("xPSR: %08x PRIMASK: %08x\n",
-        regs[REG_XPSR], regs[REG_PRIMASK]);
+         regs[REG_XPSR], regs[REG_PRIMASK]);
 #endif
 }
-#else
-# define up_registerdump()
 #endif
 
 /****************************************************************************
@@ -199,7 +195,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -210,7 +206,7 @@ static void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump();
+  or1k_registerdump();
 
   /* Get the limits on the user stack memory */
 
@@ -241,12 +237,12 @@ static void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      or1k_stackdump(sp, istackbase + istacksize);
     }
   else if (CURRENT_REGS)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      or1k_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Extract the user stack pointer if we are in an interrupt handler.
@@ -266,21 +262,6 @@ static void up_dumpstate(void)
 #ifdef CONFIG_STACK_COLORATION
   _alert("  used: %08x\n", up_check_tcbstack(rtcb));
 #endif
-
-  /* Dump the user stack if the stack pointer lies within the allocated user
-   * stack memory.
-   */
-
-  if (sp >= ustackbase && sp < ustackbase + ustacksize)
-    {
-      up_stackdump(sp, ustackbase + ustacksize);
-    }
-  else
-    {
-      _alert("ERROR: Stack pointer is not within the allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
-    }
-
 #else
   _alert("sp:         %08x\n", sp);
   _alert("stack base: %08x\n", ustackbase);
@@ -288,6 +269,7 @@ static void up_dumpstate(void)
 #ifdef CONFIG_STACK_COLORATION
   _alert("stack used: %08x\n", up_check_tcbstack(rtcb));
 #endif
+#endif
 
   /* Dump the user stack if the stack pointer lies within the allocated user
    * stack memory.
@@ -295,14 +277,13 @@ static void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      or1k_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      or1k_stackdump(ustackbase, ustackbase + ustacksize);
     }
-#endif
 
   /* Dump the state of all tasks (if available) */
 
diff --git a/arch/renesas/src/m16c/m16c_dumpstate.c b/arch/renesas/src/m16c/m16c_dumpstate.c
index 1a873ab..fc8220b 100644
--- a/arch/renesas/src/m16c/m16c_dumpstate.c
+++ b/arch/renesas/src/m16c/m16c_dumpstate.c
@@ -72,12 +72,12 @@ static void m16c_stackdump(uint16_t sp, uint16_t stack_top)
 
   syslog_flush();
 
-  for (stack = sp & ~7; stack < (stack_top & ~7); stack += 8)
+  for (stack = sp & ~0x7; stack < (stack_top & ~0x7); stack += 8)
     {
       uint8_t *ptr = (uint8_t *)stack;
       _alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n",
-             stack, ptr[0], ptr[1], ptr[2], ptr[3], ptr[4],
-             ptr[5], ptr[6], ptr[7]);
+             stack, ptr[0], ptr[1], ptr[2], ptr[3],
+             ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
 
@@ -87,7 +87,7 @@ static void m16c_stackdump(uint16_t sp, uint16_t stack_top)
 
 static inline void m16c_registerdump(void)
 {
-  uint8_t *ptr = (uint8_t *) g_current_regs;
+  volatile uint8_t *ptr = (uint8_t *)g_current_regs;
 
   /* Are user registers available from interrupt processing? */
 
@@ -96,24 +96,24 @@ static inline void m16c_registerdump(void)
       /* No.. capture user registers by hand */
 
       up_saveusercontext((uint32_t *)s_last_regs);
-      regs = s_last_regs;
+      ptr = s_last_regs;
     }
 
   /* Dump the interrupt registers */
 
   _alert("PC: %02x%02x%02x FLG: %02x00%02x FB: %02x%02x SB: %02x%02x "
          "SP: %02x%02x\n",
-        ptr[REG_FLGPCHI] & 0xff, ptr[REG_PC], ptr[REG_PC + 1],
-        ptr[REG_FLGPCHI] >> 8, ptr[REG_FLG],
-        ptr[REG_FB], ptr[REG_FB + 1],
-        ptr[REG_SB], ptr[REG_SB + 1],
-        ptr[REG_SP], ptr[REG_SP + 1]);
+         ptr[REG_FLGPCHI] & 0xff, ptr[REG_PC], ptr[REG_PC + 1],
+         ptr[REG_FLGPCHI] >> 8, ptr[REG_FLG],
+         ptr[REG_FB], ptr[REG_FB + 1],
+         ptr[REG_SB], ptr[REG_SB + 1],
+         ptr[REG_SP], ptr[REG_SP + 1]);
 
   _alert("R0: %02x%02x R1: %02x%02x R2: %02x%02x A0: %02x%02x "
          "A1: %02x%02x\n",
-        ptr[REG_R0], ptr[REG_R0 + 1], ptr[REG_R1], ptr[REG_R1 + 1],
-        ptr[REG_R2], ptr[REG_R2 + 1], ptr[REG_R3], ptr[REG_R3 + 1],
-        ptr[REG_A0], ptr[REG_A0 + 1], ptr[REG_A1], ptr[REG_A1 + 1]);
+         ptr[REG_R0], ptr[REG_R0 + 1], ptr[REG_R1], ptr[REG_R1 + 1],
+         ptr[REG_R2], ptr[REG_R2 + 1], ptr[REG_R3], ptr[REG_R3 + 1],
+         ptr[REG_A0], ptr[REG_A0 + 1], ptr[REG_A1], ptr[REG_A1 + 1]);
 }
 
 /****************************************************************************
@@ -126,7 +126,7 @@ static inline void m16c_registerdump(void)
 
 void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint16_t sp = up_getsp();
   uint16_t ustackbase;
   uint16_t ustacksize;
diff --git a/arch/renesas/src/rx65n/rx65n_dumpstate.c b/arch/renesas/src/rx65n/rx65n_dumpstate.c
index 9b838e9..fdb8cd1 100644
--- a/arch/renesas/src/rx65n/rx65n_dumpstate.c
+++ b/arch/renesas/src/rx65n/rx65n_dumpstate.c
@@ -66,19 +66,20 @@ static inline uint16_t rx65n_getusersp(void)
  * Name: rx65n_stackdump
  ****************************************************************************/
 
-static void rx65n_stackdump(uint16_t sp, uint16_t stack_top)
+static void rx65n_stackdump(uint32_t sp, uint32_t stack_top)
 {
-  uint16_t stack;
+  uint32_t stack;
 
   /* Flush any buffered SYSLOG data to avoid overwrite */
 
   syslog_flush();
 
-  for (stack = sp & ~7; stack < (stack_top & ~7); stack += 8) /* check */
-
+  for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32)
     {
-      uint8_t *ptr = (uint8_t *)&stack;
-      _alert("%04x: %02x %02x %02x %02x %02x %02x %02x %02x\n",
+      uint32_t *ptr = (uint32_t *)stack;
+      _alert("%08" PRIxPTR ": %08" PRIx32 " %08" PRIx32 " %08" PRIx32
+             " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
+             " %08" PRIx32 "\n",
              stack, ptr[0], ptr[1], ptr[2], ptr[3],
              ptr[4], ptr[5], ptr[6], ptr[7]);
     }
@@ -90,8 +91,7 @@ static void rx65n_stackdump(uint16_t sp, uint16_t stack_top)
 
 static inline void rx65n_registerdump(void)
 {
-  uint8_t *ptr = (uint8_t *) g_current_regs;
-  uint32_t regs[XCPTCONTEXT_SIZE];
+  volatile uint32_t *ptr = g_current_regs;
 
   /* Are user registers available from interrupt processing? */
 
@@ -99,28 +99,31 @@ static inline void rx65n_registerdump(void)
     {
       /* No.. capture user registers by hand */
 
-      up_saveusercontext((uint32_t *)s_last_regs);
-       *regs = *s_last_regs;
+      up_saveusercontext(s_last_regs);
+      ptr = s_last_regs;
     }
 
   /* Dump the interrupt registers */
 
-  _alert("PC: %08x PSW=%08x\n",
-        ptr[REG_PC], ptr[REG_PSW]);
+  _alert("PC: %08" PRIx32 " PSW=%08" PRIx32 "\n",
+         ptr[REG_PC], ptr[REG_PSW]);
 
-  _alert("FPSW: %08x ACC0LO: %08x ACC0HI: %08x ACC0GU: %08x"
-         "ACC1LO: %08x ACC1HI: %08x ACC1GU: %08x\n",
+  _alert("FPSW: %08" PRIx32 " ACC0LO: %08" PRIx32 " ACC0HI: %08" PRIx32
+         " ACC0GU: %08" PRIx32 "ACC1LO: %08" PRIx32 " ACC1HI: %08" PRIx32
+         " ACC1GU: %08" PRIx32 "\n",
          ptr[REG_FPSW], ptr[REG_ACC0LO], ptr[REG_ACC0HI],
          ptr[REG_ACC0GU], ptr[REG_ACC1LO],
          ptr[REG_ACC1HI], ptr[REG_ACC1GU]);
 
-  _alert("R%d:%08x %08x %08x %08x %08x %08x %08x\n", 0,
-        ptr[REG_R1], ptr[REG_R2], ptr[REG_R3],
-        ptr[REG_R4], ptr[REG_R5], ptr[REG_R6], ptr[REG_R7]);
+  _alert("R%d:%08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
+         " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n", 0,
+         ptr[REG_R1], ptr[REG_R2], ptr[REG_R3],
+         ptr[REG_R4], ptr[REG_R5], ptr[REG_R6], ptr[REG_R7]);
 
-  _alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 8,
-        ptr[REG_R8], ptr[REG_R9], ptr[REG_R10], ptr[REG_R11],
-        ptr[REG_R12], ptr[REG_R13], ptr[REG_R14], ptr[REG_R15]);
+  _alert("R%d: %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
+         " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 "\n", 8,
+         ptr[REG_R8], ptr[REG_R9], ptr[REG_R10], ptr[REG_R11],
+         ptr[REG_R12], ptr[REG_R13], ptr[REG_R14], ptr[REG_R15]);
 }
 
 /****************************************************************************
@@ -133,7 +136,7 @@ static inline void rx65n_registerdump(void)
 
 void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -149,7 +152,7 @@ void up_dumpstate(void)
   /* Get the limits on the user stack memory */
 
   ustackbase = (uint32_t)rtcb->stack_base_ptr;
-  ustacksize = (uint16_t)rtcb->adj_stack_size;
+  ustacksize = (uint32_t)rtcb->adj_stack_size;
 
 #if CONFIG_ARCH_INTERRUPTSTACK > 3
   istackbase = ebss; /* check how to declare ebss, as of now declared in chip.h */
@@ -158,10 +161,10 @@ void up_dumpstate(void)
 
   /* Show interrupt stack info */
 
-  _alert("sp:     %04" PRIx32 "\n", sp);
+  _alert("sp:     %08" PRIx32 "\n", sp);
   _alert("IRQ stack:\n");
-  _alert("  base: %04" PRIx32 "\n", istackbase);
-  _alert("  size: %04" PRIx32 "\n", istacksize);
+  _alert("  base: %08" PRIx32 "\n", istackbase);
+  _alert("  size: %08" PRIx32 "\n", istacksize);
 
   /* Does the current stack pointer lie within the interrupt
    * stack?
@@ -176,7 +179,7 @@ void up_dumpstate(void)
       /* Extract the user stack pointer from the register area */
 
       sp = rx65n_getusersp();
-      _alert("sp:     %04" PRIx32 "\n", sp);
+      _alert("sp:     %08" PRIx32 "\n", sp);
     }
   else if (g_current_regs)
     {
@@ -187,12 +190,12 @@ void up_dumpstate(void)
   /* Show user stack info */
 
   _alert("User stack:\n");
-  _alert("  base: %04" PRIx32 "\n", ustackbase);
-  _alert("  size: %04" PRIx32 "\n", ustacksize);
+  _alert("  base: %08" PRIx32 "\n", ustackbase);
+  _alert("  size: %08" PRIx32 "\n", ustacksize);
 #else
-  _alert("sp:         %04" PRIx32 "\n", sp);
-  _alert("stack base: %04" PRIx32 "\n", ustackbase);
-  _alert("stack size: %04" PRIx32 "\n", ustacksize);
+  _alert("sp:         %08" PRIx32 "\n", sp);
+  _alert("stack base: %08" PRIx32 "\n", ustackbase);
+  _alert("stack size: %08" PRIx32 "\n", ustacksize);
 #endif
 
   /* Dump the user stack if the stack pointer lies within the allocated user
diff --git a/arch/renesas/src/sh1/sh1_dumpstate.c b/arch/renesas/src/sh1/sh1_dumpstate.c
index 26259af..fa11e9e 100644
--- a/arch/renesas/src/sh1/sh1_dumpstate.c
+++ b/arch/renesas/src/sh1/sh1_dumpstate.c
@@ -74,7 +74,7 @@ static void sh1_stackdump(uint32_t sp, uint32_t stack_top)
 
 static inline void sh1_registerdump(void)
 {
-  uint32_t *ptr = (uint32_t *)g_current_regs;
+  volatile uint32_t *ptr = g_current_regs;
 
   /* Are user registers available from interrupt processing? */
 
@@ -89,18 +89,18 @@ static inline void sh1_registerdump(void)
   /* Dump the interrupt registers */
 
   _alert("PC: %08x SR=%08x\n",
-        ptr[REG_PC], ptr[REG_SR]);
+         ptr[REG_PC], ptr[REG_SR]);
 
   _alert("PR: %08x GBR: %08x MACH: %08x MACL: %08x\n",
-        ptr[REG_PR], ptr[REG_GBR], ptr[REG_MACH], ptr[REG_MACL]);
+         ptr[REG_PR], ptr[REG_GBR], ptr[REG_MACH], ptr[REG_MACL]);
 
   _alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 0,
-        ptr[REG_R0], ptr[REG_R1], ptr[REG_R2], ptr[REG_R3],
-        ptr[REG_R4], ptr[REG_R5], ptr[REG_R6], ptr[REG_R7]);
+         ptr[REG_R0], ptr[REG_R1], ptr[REG_R2], ptr[REG_R3],
+         ptr[REG_R4], ptr[REG_R5], ptr[REG_R6], ptr[REG_R7]);
 
   _alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n", 8,
-        ptr[REG_R8], ptr[REG_R9], ptr[REG_R10], ptr[REG_R11],
-        ptr[REG_R12], ptr[REG_R13], ptr[REG_R14], ptr[REG_R15]);
+         ptr[REG_R8], ptr[REG_R9], ptr[REG_R10], ptr[REG_R11],
+         ptr[REG_R12], ptr[REG_R13], ptr[REG_R14], ptr[REG_R15]);
 }
 
 /****************************************************************************
@@ -113,7 +113,7 @@ static inline void sh1_registerdump(void)
 
 void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
diff --git a/arch/risc-v/src/common/riscv_tls.c b/arch/risc-v/src/common/riscv_tls.c
index d04440b..40cff6e 100644
--- a/arch/risc-v/src/common/riscv_tls.c
+++ b/arch/risc-v/src/common/riscv_tls.c
@@ -60,9 +60,9 @@ int up_tls_size(void)
  *
  ****************************************************************************/
 
-void up_tls_initialize(FAR struct tls_info_s *info)
+void up_tls_initialize(struct tls_info_s *info)
 {
-  FAR uint8_t *tls_data = (FAR uint8_t *)(info + 1);
+  uint8_t *tls_data = (uint8_t *)(info + 1);
 
   uint32_t tdata_len = sizeof(uint32_t) * (_END_TDATA - _START_TDATA);
   uint32_t tbss_len = sizeof(uint32_t) * (_END_TBSS - _START_TBSS);
diff --git a/arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c b/arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c
index 8e62065..dba1b98 100644
--- a/arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c
+++ b/arch/risc-v/src/esp32c3/esp32c3_ble_adapter.c
@@ -612,7 +612,7 @@ static void IRAM_ATTR interrupt_clear_wrapper(int intr_source, int intr_num)
  *
  ****************************************************************************/
 
-static int IRAM_ATTR esp_int_adpt_cb(int irq, void *context, FAR void *arg)
+static int IRAM_ATTR esp_int_adpt_cb(int irq, void *context, void *arg)
 {
   struct irq_adpt_s *adapter = (struct irq_adpt_s *)arg;
 
diff --git a/arch/risc-v/src/esp32c3/esp32c3_wireless.c b/arch/risc-v/src/esp32c3/esp32c3_wireless.c
index 6e9060f..85385c9 100644
--- a/arch/risc-v/src/esp32c3/esp32c3_wireless.c
+++ b/arch/risc-v/src/esp32c3/esp32c3_wireless.c
@@ -230,7 +230,7 @@ static void esp32c3_phy_disable_clock(void)
  *
  ****************************************************************************/
 
-static int esp32c3_wl_swi_irq(int irq, void *context, FAR void *arg)
+static int esp32c3_wl_swi_irq(int irq, void *context, void *arg)
 {
   int i;
   int ret;
diff --git a/arch/risc-v/src/mpfs/mpfs_spi.c b/arch/risc-v/src/mpfs/mpfs_spi.c
index ec63072..2601b09 100644
--- a/arch/risc-v/src/mpfs/mpfs_spi.c
+++ b/arch/risc-v/src/mpfs/mpfs_spi.c
@@ -425,8 +425,8 @@ static void mpfs_spi_select(struct spi_dev_s *dev, uint32_t devid,
  ****************************************************************************/
 
 #ifdef CONFIG_MPFS_SPI0
-void weak_function mpfs_spi0_select(FAR struct spi_dev_s *dev,
-                        uint32_t devid, bool selected)
+void weak_function mpfs_spi0_select(struct spi_dev_s *dev,
+                                    uint32_t devid, bool selected)
 {
 #ifdef CONFIG_SPI_CS_CONTROL
   mpfs_spi_select(dev, devid, selected);
@@ -437,8 +437,8 @@ void weak_function mpfs_spi0_select(FAR struct spi_dev_s *dev,
 #endif /* CONFIG_MPFS_SPI0 */
 
 #ifdef CONFIG_MPFS_SPI1
-void weak_function mpfs_spi1_select(FAR struct spi_dev_s *dev,
-                        uint32_t devid, bool selected)
+void weak_function mpfs_spi1_select(struct spi_dev_s *dev,
+                                    uint32_t devid, bool selected)
 {
 #ifdef CONFIG_SPI_CS_CONTROL
   mpfs_spi_select(dev, devid, selected);
diff --git a/arch/risc-v/src/mpfs/mpfs_spi.h b/arch/risc-v/src/mpfs/mpfs_spi.h
index ded78a4..70f34b8 100644
--- a/arch/risc-v/src/mpfs/mpfs_spi.h
+++ b/arch/risc-v/src/mpfs/mpfs_spi.h
@@ -92,13 +92,13 @@ int mpfs_spibus_uninitialize(struct spi_dev_s *dev);
  ****************************************************************************/
 
 #ifdef CONFIG_MPFS_SPI0
-void weak_function mpfs_spi0_select(FAR struct spi_dev_s *dev,
-                        uint32_t devid, bool selected);
+void weak_function mpfs_spi0_select(struct spi_dev_s *dev,
+                                    uint32_t devid, bool selected);
 #endif
 
 #ifdef CONFIG_MPFS_SPI1
-void weak_function mpfs_spi1_select(FAR struct spi_dev_s *dev,
-                        uint32_t devid, bool selected);
+void weak_function mpfs_spi1_select(struct spi_dev_s *dev,
+                                    uint32_t devid, bool selected);
 #endif
 
 #ifdef __cplusplus
diff --git a/arch/risc-v/src/rv32im/riscv_assert.c b/arch/risc-v/src/rv32im/riscv_assert.c
index 4261f09..6b8248a 100644
--- a/arch/risc-v/src/rv32im/riscv_assert.c
+++ b/arch/risc-v/src/rv32im/riscv_assert.c
@@ -84,8 +84,6 @@ static void riscv_stackdump(uint32_t sp, uint32_t stack_top)
              ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-#  define riscv_stackdump(sp, stack_top)
 #endif
 
 /****************************************************************************
@@ -100,24 +98,24 @@ static inline void riscv_registerdump(volatile uint32_t *regs)
   _alert("EPC:%08x \n", regs[REG_EPC]);
   _alert("A0:%08x A1:%08x A2:%08x A3:%08x A4:%08x A5:%08x "
          "A6:%08x A7:%08x\n",
-        regs[REG_A0], regs[REG_A1], regs[REG_A2], regs[REG_A3],
-        regs[REG_A4], regs[REG_A5], regs[REG_A6], regs[REG_A7]);
+         regs[REG_A0], regs[REG_A1], regs[REG_A2], regs[REG_A3],
+         regs[REG_A4], regs[REG_A5], regs[REG_A6], regs[REG_A7]);
   _alert("T0:%08x T1:%08x T2:%08x T3:%08x T4:%08x T5:%08x T6:%08x\n",
-        regs[REG_T0], regs[REG_T1], regs[REG_T2], regs[REG_T3],
-        regs[REG_T4], regs[REG_T5], regs[REG_T6]);
+         regs[REG_T0], regs[REG_T1], regs[REG_T2], regs[REG_T3],
+         regs[REG_T4], regs[REG_T5], regs[REG_T6]);
   _alert("S0:%08x S1:%08x S2:%08x S3:%08x S4:%08x S5:%08x "
          "S6:%08x S7:%08x\n",
-        regs[REG_S0], regs[REG_S1], regs[REG_S2], regs[REG_S3],
-        regs[REG_S4], regs[REG_S5], regs[REG_S6], regs[REG_S7]);
+         regs[REG_S0], regs[REG_S1], regs[REG_S2], regs[REG_S3],
+         regs[REG_S4], regs[REG_S5], regs[REG_S6], regs[REG_S7]);
   _alert("S8:%08x S9:%08x S10:%08x S11:%08x\n",
-        regs[REG_S8], regs[REG_S9], regs[REG_S10], regs[REG_S11]);
+         regs[REG_S8], regs[REG_S9], regs[REG_S10], regs[REG_S11]);
 #ifdef RISCV_SAVE_GP
   _alert("GP:%08x SP:%08x FP:%08x TP:%08x RA:%08x\n",
-        regs[REG_GP], regs[REG_SP], regs[REG_FP], regs[REG_TP],
-        regs[REG_RA]);
+         regs[REG_GP], regs[REG_SP], regs[REG_FP], regs[REG_TP],
+         regs[REG_RA]);
 #else
   _alert("SP:%08x FP:%08x TP:%08x RA:%08x\n",
-        regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]);
+         regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]);
 #endif
 }
 #else
diff --git a/arch/risc-v/src/rv32im/riscv_swint.c b/arch/risc-v/src/rv32im/riscv_swint.c
index 87e83ae..60e93c5 100644
--- a/arch/risc-v/src/rv32im/riscv_swint.c
+++ b/arch/risc-v/src/rv32im/riscv_swint.c
@@ -73,8 +73,6 @@ static void riscv_registerdump(const uint32_t *regs)
           regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]);
 #endif
 }
-#else
-#  define riscv_registerdump(regs)
 #endif
 
 /****************************************************************************
diff --git a/arch/risc-v/src/rv64gc/riscv_assert.c b/arch/risc-v/src/rv64gc/riscv_assert.c
index fffab71..bb1dc3b 100644
--- a/arch/risc-v/src/rv64gc/riscv_assert.c
+++ b/arch/risc-v/src/rv64gc/riscv_assert.c
@@ -68,12 +68,12 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: riscv_stackdump
  ****************************************************************************/
 
-static void up_stackdump(uint64_t sp, uintptr_t stack_top)
+static void riscv_stackdump(uint64_t sp, uintptr_t stack_top)
 {
-  uintptr_t stack;
+  uint64_t stack;
 
   /* Flush any buffered SYSLOG data to avoid overwrite */
 
@@ -82,7 +82,7 @@ static void up_stackdump(uint64_t sp, uintptr_t stack_top)
   for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32)
     {
       uint32_t *ptr = (uint32_t *)stack;
-      _alert("%08" PRIxPTR ": %08" PRIx32 " %08" PRIx32 " %08" PRIx32
+      _alert("%016" PRIx64 ": %08" PRIx32 " %08" PRIx32 " %08" PRIx32
              " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
              " %08" PRIx32 "\n",
              stack, ptr[0], ptr[1], ptr[2], ptr[3],
@@ -91,10 +91,10 @@ static void up_stackdump(uint64_t sp, uintptr_t stack_top)
 }
 
 /****************************************************************************
- * Name: up_registerdump
+ * Name: riscv_registerdump
  ****************************************************************************/
 
-static inline void up_registerdump(volatile uintptr_t *regs)
+static inline void riscv_registerdump(volatile uintptr_t *regs)
 {
   /* Are user registers available from interrupt processing? */
 
@@ -167,7 +167,7 @@ static void up_taskdump(struct tcb_s *tcb, void *arg)
 
   /* Dump the registers */
 
-  up_registerdump(tcb->xcp.regs);
+  riscv_registerdump(tcb->xcp.regs);
 }
 
 /****************************************************************************
@@ -207,7 +207,7 @@ static void up_dumpstate(void)
 
   /* Dump the registers (if available) */
 
-  up_registerdump(CURRENT_REGS);
+  riscv_registerdump(CURRENT_REGS);
 
   /* Get the limits on the user stack memory */
 
@@ -235,7 +235,7 @@ static void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      riscv_stackdump(sp, istackbase + istacksize);
 
       /* Extract the user stack pointer */
 
@@ -245,7 +245,7 @@ static void up_dumpstate(void)
   else if (CURRENT_REGS)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      riscv_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Show user stack info */
@@ -266,11 +266,11 @@ static void up_dumpstate(void)
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      riscv_stackdump(ustackbase, ustackbase + ustacksize);
     }
   else
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      riscv_stackdump(sp, ustackbase + ustacksize);
     }
 }
 
diff --git a/arch/risc-v/src/rv64gc/riscv_swint.c b/arch/risc-v/src/rv64gc/riscv_swint.c
index de0f259..c62d328 100644
--- a/arch/risc-v/src/rv64gc/riscv_swint.c
+++ b/arch/risc-v/src/rv64gc/riscv_swint.c
@@ -77,8 +77,6 @@ static void riscv_registerdump(const uint64_t *regs)
           regs[REG_SP], regs[REG_FP], regs[REG_TP], regs[REG_RA]);
 #endif
 }
-#else
-#  define riscv_registerdump(regs)
 #endif
 
 /****************************************************************************
diff --git a/arch/x86/include/i486/arch.h b/arch/x86/include/i486/arch.h
index 0e84f31..b0539d9 100644
--- a/arch/x86/include/i486/arch.h
+++ b/arch/x86/include/i486/arch.h
@@ -357,7 +357,7 @@ begin_packed_struct struct idt_ptr_s
 
 /* Return stack pointer */
 
-static inline uint32_t up_getsp()
+static inline uint32_t up_getsp(void)
 {
   uint32_t regval;
 
@@ -371,7 +371,7 @@ static inline uint32_t up_getsp()
 
 /* Get segment registers */
 
-static inline uint32_t up_getds()
+static inline uint32_t up_getds(void)
 {
   uint32_t regval;
 
@@ -383,7 +383,7 @@ static inline uint32_t up_getds()
   return regval;
 }
 
-static inline uint32_t up_getcs()
+static inline uint32_t up_getcs(void)
 {
   uint32_t regval;
 
@@ -395,7 +395,7 @@ static inline uint32_t up_getcs()
   return regval;
 }
 
-static inline uint32_t up_getss()
+static inline uint32_t up_getss(void)
 {
   uint32_t regval;
 
diff --git a/arch/x86/src/common/up_assert.c b/arch/x86/src/common/up_assert.c
index 5f73f52..1c69e5a 100644
--- a/arch/x86/src/common/up_assert.c
+++ b/arch/x86/src/common/up_assert.c
@@ -69,11 +69,11 @@ static uint32_t s_last_regs[XCPTCONTEXT_REGS];
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: x86_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint32_t sp, uint32_t stack_top)
+static void x86_stackdump(uint32_t sp, uint32_t stack_top)
 {
   uint32_t stack;
 
@@ -85,12 +85,10 @@ static void up_stackdump(uint32_t sp, uint32_t stack_top)
     {
       uint32_t *ptr = (uint32_t *)stack;
       _alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
-            stack, ptr[0], ptr[1], ptr[2], ptr[3],
-            ptr[4], ptr[5], ptr[6], ptr[7]);
+             stack, ptr[0], ptr[1], ptr[2], ptr[3],
+             ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-# define up_stackdump()
 #endif
 
 /****************************************************************************
@@ -124,7 +122,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = running_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint32_t sp = up_getsp();
   uint32_t ustackbase;
   uint32_t ustacksize;
@@ -173,7 +171,7 @@ static void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      x86_stackdump(sp, istackbase + istacksize);
 
       /* Extract the user stack pointer which should lie
        * at the base of the interrupt stack.
@@ -185,7 +183,7 @@ static void up_dumpstate(void)
   else if (g_current_regs)
     {
       _alert("ERROR: Stack pointer is not within the interrupt stack\n");
-      up_stackdump(istackbase, istackbase + istacksize);
+      x86_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Show user stack info */
@@ -205,12 +203,12 @@ static void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      x86_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      x86_stackdump(ustackbase, ustackbase + ustacksize);
     }
 
 #ifdef CONFIG_ARCH_USBDUMP
diff --git a/arch/x86/src/i486/up_regdump.c b/arch/x86/src/i486/up_regdump.c
index 9c262e6..25423c3 100644
--- a/arch/x86/src/i486/up_regdump.c
+++ b/arch/x86/src/i486/up_regdump.c
@@ -40,12 +40,12 @@
 void up_registerdump(uint32_t *regs)
 {
   _alert(" ds:%08x irq:%08x err:%08x\n",
-        regs[REG_DS], regs[REG_IRQNO], regs[REG_ERRCODE]);
+         regs[REG_DS], regs[REG_IRQNO], regs[REG_ERRCODE]);
   _alert("edi:%08x esi:%08x ebp:%08x esp:%08x\n",
-        regs[REG_EDI], regs[REG_ESI], regs[REG_EBP], regs[REG_ESP]);
+         regs[REG_EDI], regs[REG_ESI], regs[REG_EBP], regs[REG_ESP]);
   _alert("ebx:%08x edx:%08x ecx:%08x eax:%08x\n",
-        regs[REG_EBX], regs[REG_EDX], regs[REG_ECX], regs[REG_EAX]);
+         regs[REG_EBX], regs[REG_EDX], regs[REG_ECX], regs[REG_EAX]);
   _alert("eip:%08x  cs:%08x flg:%08x  sp:%08x ss:%08x\n",
-        regs[REG_EIP], regs[REG_CS], regs[REG_EFLAGS], regs[REG_SP],
-        regs[REG_SS]);
+         regs[REG_EIP], regs[REG_CS], regs[REG_EFLAGS], regs[REG_SP],
+         regs[REG_SS]);
 }
diff --git a/arch/x86_64/include/intel64/arch.h b/arch/x86_64/include/intel64/arch.h
index e8f2438..4b1f804 100644
--- a/arch/x86_64/include/intel64/arch.h
+++ b/arch/x86_64/include/intel64/arch.h
@@ -414,7 +414,7 @@ static inline void write_msr(unsigned int msr, unsigned long val)
     : "memory");
 }
 
-static inline uint64_t read_fsbase()
+static inline uint64_t read_fsbase(void)
 {
     uint64_t val;
   asm volatile("rdfsbase %0"
@@ -433,7 +433,7 @@ static inline void write_fsbase(unsigned long val)
     : "memory");
 }
 
-static inline uint64_t read_gsbase()
+static inline uint64_t read_gsbase(void)
 {
     uint64_t val;
   asm volatile("rdgsbase %0"
@@ -454,7 +454,7 @@ static inline void write_gsbase(unsigned long val)
 
 /* Return stack pointer */
 
-static inline uint64_t up_getsp()
+static inline uint64_t up_getsp(void)
 {
   uint64_t regval;
 
@@ -468,7 +468,7 @@ static inline uint64_t up_getsp()
 
 /* Get segment registers */
 
-static inline uint32_t up_getds()
+static inline uint32_t up_getds(void)
 {
   uint32_t regval;
 
@@ -480,7 +480,7 @@ static inline uint32_t up_getds()
   return regval;
 }
 
-static inline uint32_t up_getcs()
+static inline uint32_t up_getcs(void)
 {
   uint32_t regval;
 
@@ -492,7 +492,7 @@ static inline uint32_t up_getcs()
   return regval;
 }
 
-static inline uint32_t up_getss()
+static inline uint32_t up_getss(void)
 {
   uint32_t regval;
 
@@ -504,7 +504,7 @@ static inline uint32_t up_getss()
   return regval;
 }
 
-static inline uint32_t up_getes()
+static inline uint32_t up_getes(void)
 {
   uint32_t regval;
 
@@ -516,7 +516,7 @@ static inline uint32_t up_getes()
   return regval;
 }
 
-static inline uint32_t up_getfs()
+static inline uint32_t up_getfs(void)
 {
   uint32_t regval;
 
@@ -528,7 +528,7 @@ static inline uint32_t up_getfs()
   return regval;
 }
 
-static inline uint32_t up_getgs()
+static inline uint32_t up_getgs(void)
 {
   uint32_t regval;
 
diff --git a/arch/x86_64/src/common/up_assert.c b/arch/x86_64/src/common/up_assert.c
index 0114cd6..8b6f37d 100644
--- a/arch/x86_64/src/common/up_assert.c
+++ b/arch/x86_64/src/common/up_assert.c
@@ -61,11 +61,11 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: x86_64_stackdump
  ****************************************************************************/
 
 #ifdef CONFIG_ARCH_STACKDUMP
-static void up_stackdump(uint64_t sp, uint64_t stack_top)
+static void x86_64_stackdump(uint64_t sp, uint64_t stack_top)
 {
   uint64_t stack;
 
@@ -76,13 +76,13 @@ static void up_stackdump(uint64_t sp, uint64_t stack_top)
   for (stack = sp & ~0x1f; stack < (stack_top & ~0x1f); stack += 32)
     {
       uint32_t *ptr = (uint32_t *)stack;
-      _alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
-            stack, ptr[0], ptr[1], ptr[2], ptr[3],
-            ptr[4], ptr[5], ptr[6], ptr[7]);
+      _alert("%016" PRIx64 ": %08" PRIx32 " %08" PRIx32 " %08" PRIx32
+             " %08" PRIx32 " %08" PRIx32 " %08" PRIx32 " %08" PRIx32
+             " %08" PRIx32 "\n",
+             stack, ptr[0], ptr[1], ptr[2], ptr[3],
+             ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
-#else
-# define up_stackdump()
 #endif
 
 /****************************************************************************
@@ -116,7 +116,7 @@ static int assert_tracecallback(FAR struct usbtrace_s *trace, FAR void *arg)
 #ifdef CONFIG_ARCH_STACKDUMP
 static void up_dumpstate(void)
 {
-  struct tcb_s *rtcb = this_task();
+  FAR struct tcb_s *rtcb = running_task();
   uint64_t sp = up_getsp();
   uint64_t ustackbase;
   uint64_t ustacksize;
@@ -138,10 +138,10 @@ static void up_dumpstate(void)
 
   /* Show interrupt stack info */
 
-  _alert("sp:     %016x\n", sp);
+  _alert("sp:     %016" PRIx64 "\n", sp);
   _alert("IRQ stack:\n");
-  _alert("  base: %016x\n", istackbase);
-  _alert("  size: %016x\n", istacksize);
+  _alert("  base: %016" PRIx64 "\n", istackbase);
+  _alert("  size: %016" PRIx64 "\n", istacksize);
 
   /* Does the current stack pointer lie within the interrupt
    * stack?
@@ -151,25 +151,30 @@ static void up_dumpstate(void)
     {
       /* Yes.. dump the interrupt stack */
 
-      up_stackdump(sp, istackbase + istacksize);
+      x86_64_stackdump(sp, istackbase + istacksize);
 
       /* Extract the user stack pointer which should lie
        * at the base of the interrupt stack.
        */
 
       sp = g_intstacktop;
-      _alert("sp:     %016x\n", sp);
+      _alert("sp:     %016" PRIx64 "\n", sp);
+    }
+  else if (g_current_regs)
+    {
+      _alert("ERROR: Stack pointer is not within the interrupt stack\n");
+      x86_64_stackdump(istackbase, istackbase + istacksize);
     }
 
   /* Show user stack info */
 
   _alert("User stack:\n");
-  _alert("  base: %016x\n", ustackbase);
-  _alert("  size: %016x\n", ustacksize);
+  _alert("  base: %016" PRIx64 "\n", ustackbase);
+  _alert("  size: %016" PRIx64 "\n", ustacksize);
 #else
-  _alert("sp:         %016x\n", sp);
-  _alert("stack base: %016x\n", ustackbase);
-  _alert("stack size: %016x\n", ustacksize);
+  _alert("sp:         %016" PRIx64 "\n", sp);
+  _alert("stack base: %016" PRIx64 "\n", ustackbase);
+  _alert("stack size: %016" PRIx64 "\n", ustacksize);
 #endif
 
   /* Dump the user stack if the stack pointer lies within the allocated user
@@ -178,12 +183,12 @@ static void up_dumpstate(void)
 
   if (sp >= ustackbase && sp < ustackbase + ustacksize)
     {
-      up_stackdump(sp, ustackbase + ustacksize);
+      x86_64_stackdump(sp, ustackbase + ustacksize);
     }
   else
     {
       _alert("ERROR: Stack pointer is not within allocated stack\n");
-      up_stackdump(ustackbase, ustackbase + ustacksize);
+      x86_64_stackdump(ustackbase, ustackbase + ustacksize);
     }
 
   /* Then dump the registers (if available) */
diff --git a/arch/xtensa/src/common/xtensa_dumpstate.c b/arch/xtensa/src/common/xtensa_dumpstate.c
index 52aad07..cc560f8 100644
--- a/arch/xtensa/src/common/xtensa_dumpstate.c
+++ b/arch/xtensa/src/common/xtensa_dumpstate.c
@@ -63,12 +63,12 @@ static void up_taskdump(struct tcb_s *tcb, void *arg)
 
 #if CONFIG_TASK_NAME_SIZE > 0
   _alert("%s: PID=%d Stack Used=%lu of %lu\n",
-        tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
-        (unsigned long)tcb->adj_stack_size);
+         tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
+         (unsigned long)tcb->adj_stack_size);
 #else
   _alert("PID: %d Stack Used=%lu of %lu\n",
-        tcb->pid, (unsigned long)up_check_tcbstack(tcb),
-        (unsigned long)tcb->adj_stack_size);
+         tcb->pid, (unsigned long)up_check_tcbstack(tcb),
+         (unsigned long)tcb->adj_stack_size);
 #endif
 
   /* Dump the backtrace */
diff --git a/arch/z16/src/common/z16_registerdump.c b/arch/z16/src/common/z16_registerdump.c
index 2eab1fb..0e905f6 100644
--- a/arch/z16/src/common/z16_registerdump.c
+++ b/arch/z16/src/common/z16_registerdump.c
@@ -48,27 +48,27 @@ static chipreg_t s_last_regs[XCPTCONTEXT_REGS];
  * Name: z16_registerdump
  ****************************************************************************/
 
-static void z16_registerdump(void)
+void z16_registerdump(void)
 {
 #ifdef CONFIG_DEBUG_INFO
-  FAR uint32_t *regs32 = (FAR uint32_t *)g_current_regs;
+  FAR volatile uint32_t *regs32 = (FAR volatile uint32_t *)g_current_regs;
 
   if (regs32 == NULL)
     {
       z16_saveusercontext(s_last_regs);
-      regs32 = (FAR uint32_t *)s_last_regs;
+      regs32 = (FAR volatile uint32_t *)s_last_regs;
     }
 
   _alert("R0 :%08x R1 :%08x R2 :%08x R3 :%08x "
-        "R4 :%08x R5 :%08x R6 :%08x R7 :%08x\n"
-        regs32[REG_R0 / 2],  regs32[REG_R1 / 2],  regs32[REG_R2 / 2],
-        regs32[REG_R3 / 2],  regs32[REG_R4 / 2],  regs32[REG_R5 / 2],
-        regs32[REG_R6 / 2],  regs32[REG_R7 / 2]);
+         "R4 :%08x R5 :%08x R6 :%08x R7 :%08x\n"
+         regs32[REG_R0 / 2],  regs32[REG_R1 / 2],  regs32[REG_R2 / 2],
+         regs32[REG_R3 / 2],  regs32[REG_R4 / 2],  regs32[REG_R5 / 2],
+         regs32[REG_R6 / 2],  regs32[REG_R7 / 2]);
   _alert("R8 :%08x R9 :%08x R10:%08x R11:%08x R12:%08x R13:%08x\n"
-        regs32[REG_R8 / 2],  regs32[REG_R9 / 2],  regs32[REG_R10 / 2],
-        regs3[REG_R11 / 2],  regs32[REG_R12 / 2], regs32[REG_R13 / 2]);
+         regs32[REG_R8 / 2],  regs32[REG_R9 / 2],  regs32[REG_R10 / 2],
+         regs3[REG_R11 / 2],  regs32[REG_R12 / 2], regs32[REG_R13 / 2]);
   _alert("FP :%08x SP :%08x FLG:%04x\n"
-        regs32[REG_R14 / 2], regs32[REG_R15 / 2], regs32[REG_FLAGS]);
+         regs32[REG_R14 / 2], regs32[REG_R15 / 2], regs32[REG_FLAGS]);
 #endif
 }
 
diff --git a/arch/z16/src/common/z16_stackdump.c b/arch/z16/src/common/z16_stackdump.c
index 5c0d6d6..49431ca 100644
--- a/arch/z16/src/common/z16_stackdump.c
+++ b/arch/z16/src/common/z16_stackdump.c
@@ -47,13 +47,14 @@
  * Name: z16_stackdump
  ****************************************************************************/
 
-static void z16_stackdump(void)
+void z16_stackdump(void)
 {
-  struct tcb_s *rtcb = this_task();
+  FAR struct tcb_s *rtcb = running_task();
   chipreg_t sp = up_getsp();
   chipreg_t stack_base = (chipreg_t)rtcb->stack_base_ptr;
   chipreg_t stack_size = (chipreg_t)rtcb->adj_stack_size;
   chipreg_t stack;
+  chipreg_t stack_top;
 
   _alert("stack_base: %08x\n", stack_base);
   _alert("stack_size: %08x\n", stack_size);
@@ -69,18 +70,20 @@ static void z16_stackdump(void)
       stack = stack_base;
     }
 
+  stack_top = stack_base + stack_size;
+
   /* Flush any buffered SYSLOG data to avoid overwrite */
 
   syslog_flush();
 
-  for (stack = stack & ~0x0f;
-       stack < ((stack_base + stack_size) & ~0x0f);
+  for (stack = stack & ~(8 * sizeof(chipreg_t) - 1);
+       stack < (stack_top & ~(8 * sizeof(chipreg_t) - 1));
        stack += 8 * sizeof(chipreg_t))
     {
       chipreg_t *ptr = (chipreg_t *)stack;
       _alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
-            stack, ptr[0], ptr[1], ptr[2], ptr[3],
-            ptr[4], ptr[5], ptr[6], ptr[7]);
+             stack, ptr[0], ptr[1], ptr[2], ptr[3],
+             ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
 
diff --git a/arch/z80/src/common/z80_assert.c b/arch/z80/src/common/z80_assert.c
index 815de94..c9bc1ac 100644
--- a/arch/z80/src/common/z80_assert.c
+++ b/arch/z80/src/common/z80_assert.c
@@ -142,8 +142,8 @@ void up_assert(const char *filename, int lineno)
          filename, lineno);
 #endif
 
-  REGISTER_DUMP();
-  up_stackdump();
+  Z80_REGISTER_DUMP();
+  z80_stackdump();
 
 #ifdef CONFIG_ARCH_USBDUMP
   /* Dump USB trace data */
diff --git a/arch/z80/src/common/z80_internal.h b/arch/z80/src/common/z80_internal.h
index 4fa5aa8..d323e51 100644
--- a/arch/z80/src/common/z80_internal.h
+++ b/arch/z80/src/common/z80_internal.h
@@ -133,11 +133,11 @@ uintptr_t up_getsp(void);
 /* Dump stack and registers */
 
 #ifdef CONFIG_ARCH_STACKDUMP
-void up_stackdump(void);
-# define REGISTER_DUMP() _REGISTER_DUMP()
+void z80_stackdump(void);
+# define Z80_REGISTER_DUMP() _REGISTER_DUMP()
 #else
-# define up_stackdump()
-# define REGISTER_DUMP()
+# define z80_stackdump()
+# define Z80_REGISTER_DUMP()
 #endif
 
 #ifdef __cplusplus
diff --git a/arch/z80/src/common/z80_stackdump.c b/arch/z80/src/common/z80_stackdump.c
index 871cd68..2e8bd3c 100644
--- a/arch/z80/src/common/z80_stackdump.c
+++ b/arch/z80/src/common/z80_stackdump.c
@@ -38,16 +38,17 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: up_stackdump
+ * Name: z80_stackdump
  ****************************************************************************/
 
-void up_stackdump(void)
+void z80_stackdump(void)
 {
-  FAR struct tcb_s *rtcb = this_task();
+  FAR struct tcb_s *rtcb = running_task();
   uintptr_t sp = up_getsp();
   uintptr_t stack_base = (uintptr_t)rtcb->stack_base_ptr;
   uintptr_t stack_size = (uintptr_t)rtcb->adj_stack_size;
   uintptr_t stack;
+  uintptr_t stack_top;
 
   _alert("stack_base: %06x\n", stack_base);
   _alert("stack_size: %06x\n", stack_size);
@@ -63,17 +64,20 @@ void up_stackdump(void)
       stack = stack_base;
     }
 
-  for (stack = stack & ~0x0f; stack < stack_base + stack_size; stack += 16)
-    {
-      FAR uint8_t *ptr = (FAR uint8_t *)stack;
+  stack_top = stack_base + stack_size;
+
+  /* Flush any buffered SYSLOG data to avoid overwrite */
 
-      _alert("%06x: %02x %02x %02x %02x %02x %02x %02x %02x  ",
-             "%02x %02x %02x %02x %02x %02x %02x %02x\n",
-             stack,
-             ptr[0],  ptr[1],  ptr[2],  ptr[3],
-             ptr[4],  ptr[5],  ptr[6],  ptr[7],
-             ptr[8],  ptr[9],  ptr[10], ptr[11],
-             ptr[12], ptr[13], ptr[14], ptr[15]);
+  syslog_flush();
+
+  for (stack = stack & ~(8 * sizeof(chipreg_t) - 1);
+       stack < (stack_top & ~(8 * sizeof(chipreg_t) - 1));
+       stack += 8 * sizeof(chipreg_t))
+    {
+      FAR chipreg_t *ptr = (FAR chipreg_t *)stack;
+      _alert("%06x: %06x %06x %06x %06x %06x %06x %06x %06x\n",
+             stack, ptr[0], ptr[1], ptr[2], ptr[3],
+             ptr[4], ptr[5], ptr[6], ptr[7]);
     }
 }
 
diff --git a/arch/z80/src/ez80/ez80_registerdump.c b/arch/z80/src/ez80/ez80_registerdump.c
index 9433fdf..313dcbf 100644
--- a/arch/z80/src/ez80/ez80_registerdump.c
+++ b/arch/z80/src/ez80/ez80_registerdump.c
@@ -60,22 +60,22 @@ void ez80_registerdump(void)
 
 #ifdef CONFIG_EZ80_Z80MODE
   _alert("AF: %04x  I: %04x\n",
-        regs[XCPT_AF], regs[XCPT_I]);
+         regs[XCPT_AF], regs[XCPT_I]);
   _alert("BC: %04x DE: %04x HL: %04x\n",
-        regs[XCPT_BC], regs[XCPT_DE], regs[XCPT_HL]);
+         regs[XCPT_BC], regs[XCPT_DE], regs[XCPT_HL]);
   _alert("IX: %04x IY: %04x\n",
-        regs[XCPT_IX], regs[XCPT_IY]);
+         regs[XCPT_IX], regs[XCPT_IY]);
   _alert("SP: %04x PC: %04x\n"
-        regs[XCPT_SP], regs[XCPT_PC]);
+         regs[XCPT_SP], regs[XCPT_PC]);
 #else
   _alert("AF: %06x  I: %06x\n",
-        regs[XCPT_AF], regs[XCPT_I]);
+         regs[XCPT_AF], regs[XCPT_I]);
   _alert("BC: %06x DE: %06x HL: %06x\n",
-        regs[XCPT_BC], regs[XCPT_DE], regs[XCPT_HL]);
+         regs[XCPT_BC], regs[XCPT_DE], regs[XCPT_HL]);
   _alert("IX: %06x IY: %06x\n",
-        regs[XCPT_IX], regs[XCPT_IY]);
+         regs[XCPT_IX], regs[XCPT_IY]);
   _alert("SP: %06x PC: %06x\n",
-        regs[XCPT_SP], regs[XCPT_PC]);
+         regs[XCPT_SP], regs[XCPT_PC]);
 #endif
 }
 
diff --git a/arch/z80/src/z180/z180_registerdump.c b/arch/z80/src/z180/z180_registerdump.c
index 586fbb3..b361964 100644
--- a/arch/z80/src/z180/z180_registerdump.c
+++ b/arch/z80/src/z180/z180_registerdump.c
@@ -48,7 +48,7 @@ static chipreg_t s_last_regs[XCPTCONTEXT_REGS];
  * Name: z180_registerdump
  ****************************************************************************/
 
-static void z180_registerdump(void)
+void z180_registerdump(void)
 {
   volatile chipreg_t *regs = g_current_regs;
 
@@ -59,15 +59,15 @@ static void z180_registerdump(void)
     }
 
   _alert("AF: %04x  I: %04x\n",
-        regs[XCPT_AF], regs[XCPT_I]);
+         regs[XCPT_AF], regs[XCPT_I]);
   _alert("BC: %04x DE: %04x HL: %04x\n",
-        regs[XCPT_BC], regs[XCPT_DE], regs[XCPT_HL]);
+         regs[XCPT_BC], regs[XCPT_DE], regs[XCPT_HL]);
   _alert("IX: %04x IY: %04x\n",
-        regs[XCPT_IX], regs[XCPT_IY]);
+         regs[XCPT_IX], regs[XCPT_IY]);
   _alert("SP: %04x PC: %04x\n"
-        regs[XCPT_SP], regs[XCPT_PC]);
+         regs[XCPT_SP], regs[XCPT_PC]);
   _alert("CBAR: %02x BBR: %02x CBR: %02x\n"
-        inp(Z180_MMU_CBAR), inp(Z180_MMU_BBR), inp(Z180_MMU_CBR));
+         inp(Z180_MMU_CBAR), inp(Z180_MMU_BBR), inp(Z180_MMU_CBR));
 }
 
 #endif /* CONFIG_ARCH_STACKDUMP */
diff --git a/arch/z80/src/z8/z8_registerdump.c b/arch/z80/src/z8/z8_registerdump.c
index 81bd611..0c08156 100644
--- a/arch/z80/src/z8/z8_registerdump.c
+++ b/arch/z80/src/z8/z8_registerdump.c
@@ -48,15 +48,15 @@ static chipreg_t s_last_regs[XCPTCONTEXT_REGS];
 static inline void z8_dumpregs(FAR chipret_t *regs)
 {
   _alert("REGS: %04x %04x %04x %04x %04x %04x %04x %04x\n",
-        regs[XCPT_RR0], regs[XCPT_RR2], regs[XCPT_RR4], regs[XCPT_RR6],
-        regs[XCPT_RR8], regs[XCPT_RR10], regs[XCPT_RR12], regs[XCPT_RR14]);
+         regs[XCPT_RR0], regs[XCPT_RR2], regs[XCPT_RR4], regs[XCPT_RR6],
+         regs[XCPT_RR8], regs[XCPT_RR10], regs[XCPT_RR12], regs[XCPT_RR14]);
 }
 
 static inline void z8_dumpstate(chipreg_t sp, chipreg_t pc, uint8_t irqctl,
                                 chipreg_t rpflags)
 {
   _alert("SP: %04x PC: %04x IRQCTL: %02x RP: %02x FLAGS: %02x\n",
-        sp, pc, irqctl & 0xff, rpflags >> 8, rpflags & 0xff);
+         sp, pc, irqctl & 0xff, rpflags >> 8, rpflags & 0xff);
 }
 
 /****************************************************************************
diff --git a/arch/z80/src/z80/z80_registerdump.c b/arch/z80/src/z80/z80_registerdump.c
index 218d3e5..d77e87d 100644
--- a/arch/z80/src/z80/z80_registerdump.c
+++ b/arch/z80/src/z80/z80_registerdump.c
@@ -48,7 +48,7 @@ static chipreg_t s_last_regs[XCPTCONTEXT_REGS];
  * Name: z80_registerdump
  ****************************************************************************/
 
-static void z80_registerdump(void)
+void z80_registerdump(void)
 {
   volatile chipreg_t *regs = g_current_regs;
 
@@ -59,13 +59,13 @@ static void z80_registerdump(void)
     }
 
   _alert("AF: %04x  I: %04x\n",
-        regs[XCPT_AF], regs[XCPT_I]);
+         regs[XCPT_AF], regs[XCPT_I]);
   _alert("BC: %04x DE: %04x HL: %04x\n",
-        regs[XCPT_BC], regs[XCPT_DE], regs[XCPT_HL]);
+         regs[XCPT_BC], regs[XCPT_DE], regs[XCPT_HL]);
   _alert("IX: %04x IY: %04x\n",
-        regs[XCPT_IX], regs[XCPT_IY]);
+         regs[XCPT_IX], regs[XCPT_IY]);
   _alert("SP: %04x PC: %04x\n"
-        regs[XCPT_SP], regs[XCPT_PC]);
+         regs[XCPT_SP], regs[XCPT_PC]);
 }
 
 #endif /* CONFIG_ARCH_STACKDUMP */