You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/04/18 14:22:22 UTC

[incubator-nuttx] 01/03: arch/arm: export arm_saveusercontext()

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

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

commit 5bdfae66ce04b9ac9cab3c85926d8fc346819bf7
Author: chao.an <an...@xiaomi.com>
AuthorDate: Fri Apr 15 22:21:38 2022 +0800

    arch/arm: export arm_saveusercontext()
    
    rename arm_saveusercontext() -> up_arm_saveusercontext()
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 arch/arm/include/syscall.h                         |  2 +-
 arch/arm/src/arm/arm_saveusercontext.S             | 12 +++++-----
 arch/arm/src/armv6-m/arm_saveusercontext.S         | 12 +++++-----
 arch/arm/src/armv6-m/arm_svcall.c                  |  2 +-
 arch/arm/src/armv7-a/arm_saveusercontext.S         | 12 +++++-----
 arch/arm/src/armv7-m/arm_svcall.c                  |  2 +-
 arch/arm/src/armv7-m/gnu/arm_saveusercontext.S     | 12 +++++-----
 arch/arm/src/armv7-m/iar/arm_saveusercontext.S     | 10 ++++----
 arch/arm/src/armv7-r/arm_saveusercontext.S         | 12 +++++-----
 arch/arm/src/armv8-m/arm_saveusercontext.S         | 12 +++++-----
 arch/arm/src/armv8-m/arm_svcall.c                  |  2 +-
 arch/arm/src/common/arm_assert.c                   |  2 +-
 arch/arm/src/common/arm_internal.h                 |  1 -
 arch/ceva/include/syscall.h                        |  2 +-
 arch/ceva/src/common/up_internal.h                 |  1 -
 arch/ceva/src/common/up_saveusercontext.c          |  4 ++--
 arch/ceva/src/common/up_svcall.c                   |  2 +-
 arch/hc/src/common/up_internal.h                   |  1 -
 arch/or1k/src/common/up_internal.h                 |  1 -
 arch/renesas/src/common/up_internal.h              |  1 -
 arch/renesas/src/m16c/m16c_vectors.S               |  2 +-
 arch/renesas/src/rx65n/rx65n_vector.S              |  2 +-
 arch/risc-v/src/bl602/Make.defs                    |  1 +
 arch/risc-v/src/c906/Make.defs                     |  1 +
 arch/risc-v/src/common/riscv_assert.c              |  2 +-
 arch/risc-v/src/common/riscv_internal.h            | 12 ----------
 .../src/common/riscv_saveusercontext.c}            | 28 ++++------------------
 arch/risc-v/src/common/riscv_swint.c               |  2 +-
 arch/risc-v/src/esp32c3/Make.defs                  |  1 +
 arch/risc-v/src/fe310/Make.defs                    |  1 +
 arch/risc-v/src/k210/Make.defs                     |  2 +-
 arch/risc-v/src/litex/Make.defs                    |  1 +
 arch/risc-v/src/mpfs/Make.defs                     |  1 +
 arch/risc-v/src/qemu-rv/Make.defs                  |  1 +
 arch/risc-v/src/rv32m1/Make.defs                   |  1 +
 arch/x86/src/common/up_internal.h                  |  1 -
 arch/x86/src/qemu/qemu_saveusercontext.S           |  2 +-
 arch/x86_64/src/common/up_internal.h               |  1 -
 arch/x86_64/src/intel64/intel64_saveusercontext.S  |  2 +-
 boards/arm/cxd56xx/spresense/src/cxd56_ostest.c    |  2 +-
 boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c |  2 +-
 .../arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c |  2 +-
 boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c  |  2 +-
 .../arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c   |  2 +-
 boards/arm/sama5/giant-board/src/sam_ostest.c      |  2 +-
 boards/arm/sama5/sama5d2-xult/src/sam_ostest.c     |  2 +-
 boards/arm/sama5/sama5d3-xplained/src/sam_ostest.c |  2 +-
 boards/arm/sama5/sama5d3x-ek/src/sam_ostest.c      |  2 +-
 boards/arm/sama5/sama5d4-ek/src/sam_ostest.c       |  2 +-
 boards/arm/stm32/omnibusf4/src/stm32_ostest.c      |  2 +-
 boards/arm/stm32/stm3240g-eval/src/stm32_ostest.c  |  2 +-
 .../arm/stm32/stm32f429i-disco/src/stm32_ostest.c  |  2 +-
 .../arm/stm32/stm32f4discovery/src/stm32_ostest.c  |  2 +-
 .../stm32f7/stm32f746g-disco/src/stm32_ostest.c    |  2 +-
 .../stm32f7/stm32f769i-disco/src/stm32_ostest.c    |  2 +-
 .../arm/stm32h7/nucleo-h743zi2/src/stm32_ostest.c  |  2 +-
 boards/arm/xmc4/xmc4500-relax/src/xmc4_ostest.c    |  2 +-
 boards/arm/xmc4/xmc4700-relax/src/xmc4_ostest.c    |  2 +-
 boards/risc-v/bl602/bl602evb/src/bl602_ostest.c    |  2 +-
 boards/risc-v/c906/smartl-c906/src/c906_ostest.c   |  2 +-
 boards/risc-v/mpfs/common/src/mpfs_ostest.c        |  2 +-
 boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_ostest.c |  2 +-
 include/nuttx/arch.h                               | 10 ++++++++
 63 files changed, 103 insertions(+), 122 deletions(-)

diff --git a/arch/arm/include/syscall.h b/arch/arm/include/syscall.h
index 1b1289a0a9..ec9a5f0e8d 100644
--- a/arch/arm/include/syscall.h
+++ b/arch/arm/include/syscall.h
@@ -66,7 +66,7 @@
 
 /* SYS call 0:
  *
- * int arm_saveusercontext(uint32_t *saveregs);
+ * int up_saveusercontext(void *saveregs);
  */
 
 #define SYS_save_context          (0)
diff --git a/arch/arm/src/arm/arm_saveusercontext.S b/arch/arm/src/arm/arm_saveusercontext.S
index fe16a3a4b6..c50cf7d439 100644
--- a/arch/arm/src/arm/arm_saveusercontext.S
+++ b/arch/arm/src/arm/arm_saveusercontext.S
@@ -44,12 +44,12 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: arm_saveusercontext
+ * Name: up_saveusercontext
  *
  * Description:
  *   Save the current thread context.  Full prototype is:
  *
- *   int  arm_saveusercontext(uint32_t *saveregs);
+ *   int  up_saveusercontext(void *saveregs);
  *
  * Returned Value:
  *   0: Normal return
@@ -57,9 +57,9 @@
  *
  ****************************************************************************/
 
-	.globl	arm_saveusercontext
-	.type	arm_saveusercontext, function
-arm_saveusercontext:
+	.globl	up_saveusercontext
+	.type	up_saveusercontext, function
+up_saveusercontext:
 
 	/* On entry, a1 (r0) holds address of struct xcptcontext */
 
@@ -96,5 +96,5 @@ arm_saveusercontext:
 
 	mov	r0, #0		/* Return value == 0 */
 	bx	lr		/* Return */
-	.size	arm_saveusercontext, .-arm_saveusercontext
+	.size	up_saveusercontext, .-up_saveusercontext
 	.end
diff --git a/arch/arm/src/armv6-m/arm_saveusercontext.S b/arch/arm/src/armv6-m/arm_saveusercontext.S
index 284a3f7ecd..f1dbcb067b 100644
--- a/arch/arm/src/armv6-m/arm_saveusercontext.S
+++ b/arch/arm/src/armv6-m/arm_saveusercontext.S
@@ -47,12 +47,12 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: arm_saveusercontext
+ * Name: up_saveusercontext
  *
  * Description:
  *   Save the current thread context.  Full prototype is:
  *
- *   int  arm_saveusercontext(uint32_t *saveregs);
+ *   int  up_saveusercontext(void *saveregs);
  *
  * Returned Value:
  *   0: Normal return
@@ -64,9 +64,9 @@
 	.align	2
 	.code	16
 	.thumb_func
-	.globl	arm_saveusercontext
-	.type	arm_saveusercontext, function
-arm_saveusercontext:
+	.globl	up_saveusercontext
+	.type	up_saveusercontext, function
+up_saveusercontext:
 
 	/* Perform the System call with R0=0 and R1=regs */
 
@@ -85,5 +85,5 @@ arm_saveusercontext:
 	str		r3, [r2, #0]		/* Save return value */
 	bx		lr			/* "normal" return with r0=0 or
 						 * context switch with r0=1 */
-	.size	arm_saveusercontext, .-arm_saveusercontext
+	.size	up_saveusercontext, .-up_saveusercontext
 	.end
diff --git a/arch/arm/src/armv6-m/arm_svcall.c b/arch/arm/src/armv6-m/arm_svcall.c
index 00b3ba486a..353db23ac1 100644
--- a/arch/arm/src/armv6-m/arm_svcall.c
+++ b/arch/arm/src/armv6-m/arm_svcall.c
@@ -154,7 +154,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
     {
       /* R0=SYS_save_context:  This is a save context command:
        *
-       *   int arm_saveusercontext(uint32_t *saveregs);
+       *   int up_saveusercontext(void *saveregs);
        *
        * At this point, the following values are saved in context:
        *
diff --git a/arch/arm/src/armv7-a/arm_saveusercontext.S b/arch/arm/src/armv7-a/arm_saveusercontext.S
index 174d3bfc05..71d42cb07e 100644
--- a/arch/arm/src/armv7-a/arm_saveusercontext.S
+++ b/arch/arm/src/armv7-a/arm_saveusercontext.S
@@ -44,12 +44,12 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: arm_saveusercontext
+ * Name: up_saveusercontext
  *
  * Description:
  *   Save the current thread context.  Full prototype is:
  *
- *   int  arm_saveusercontext(uint32_t *saveregs);
+ *   int  up_saveusercontext(void *saveregs);
  *
  * Returned Value:
  *   0: Normal return
@@ -57,9 +57,9 @@
  *
  ****************************************************************************/
 
-	.globl	arm_saveusercontext
-	.type	arm_saveusercontext, function
-arm_saveusercontext:
+	.globl	up_saveusercontext
+	.type	up_saveusercontext, function
+up_saveusercontext:
 
 	/* On entry, a1 (r0) holds address of struct xcptcontext */
 
@@ -134,5 +134,5 @@ arm_saveusercontext:
 	mov		r0, #1			/* Return value == 1 */
 	bx		lr			/* Return */
 
-	.size	arm_saveusercontext, .-arm_saveusercontext
+	.size	up_saveusercontext, .-up_saveusercontext
 	.end
diff --git a/arch/arm/src/armv7-m/arm_svcall.c b/arch/arm/src/armv7-m/arm_svcall.c
index 1021d128e0..805fd92ef7 100644
--- a/arch/arm/src/armv7-m/arm_svcall.c
+++ b/arch/arm/src/armv7-m/arm_svcall.c
@@ -161,7 +161,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
     {
       /* R0=SYS_save_context:  This is a save context command:
        *
-       *   int arm_saveusercontext(uint32_t *saveregs);
+       *   int up_saveusercontext(void *saveregs);
        *
        * At this point, the following values are saved in context:
        *
diff --git a/arch/arm/src/armv7-m/gnu/arm_saveusercontext.S b/arch/arm/src/armv7-m/gnu/arm_saveusercontext.S
index c5b12a3461..7fabb33838 100644
--- a/arch/arm/src/armv7-m/gnu/arm_saveusercontext.S
+++ b/arch/arm/src/armv7-m/gnu/arm_saveusercontext.S
@@ -49,12 +49,12 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: arm_saveusercontext
+ * Name: up_saveusercontext
  *
  * Description:
  *   Save the current thread context.  Full prototype is:
  *
- *   int  arm_saveusercontext(uint32_t *saveregs);
+ *   int  up_saveusercontext(void *saveregs);
  *
  * Returned Value:
  *   0: Normal return
@@ -64,9 +64,9 @@
 
 	.text
 	.thumb_func
-	.globl	arm_saveusercontext
-	.type	arm_saveusercontext, function
-arm_saveusercontext:
+	.globl	up_saveusercontext
+	.type	up_saveusercontext, function
+up_saveusercontext:
 
 	/* Perform the System call with R0=0 and R1=regs */
 
@@ -84,5 +84,5 @@ arm_saveusercontext:
 	str		r3, [r2, #0]
 	bx		lr			/* "normal" return with r0=0 or
 						 * context switch with r0=1 */
-	.size	arm_saveusercontext, .-arm_saveusercontext
+	.size	up_saveusercontext, .-up_saveusercontext
 	.end
diff --git a/arch/arm/src/armv7-m/iar/arm_saveusercontext.S b/arch/arm/src/armv7-m/iar/arm_saveusercontext.S
index 1806865d6a..b864da4eff 100644
--- a/arch/arm/src/armv7-m/iar/arm_saveusercontext.S
+++ b/arch/arm/src/armv7-m/iar/arm_saveusercontext.S
@@ -28,7 +28,7 @@
 
 #include "nvic.h"
 
-	MODULE arm_saveusercontext
+	MODULE up_saveusercontext
 	SECTION .text:CODE:NOROOT(2)
 
 /****************************************************************************
@@ -39,7 +39,7 @@
  * Public Symbols
  ****************************************************************************/
 
-	PUBLIC arm_saveusercontext
+	PUBLIC up_saveusercontext
 
 /****************************************************************************
  * Macros
@@ -50,12 +50,12 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: arm_saveusercontext
+ * Name: up_saveusercontext
  *
  * Description:
  *   Save the current thread context.  Full prototype is:
  *
- *   int  arm_saveusercontext(uint32_t *saveregs);
+ *   int  up_saveusercontext(void *saveregs);
  *
  * Returned Value:
  *   0: Normal return
@@ -65,7 +65,7 @@
 
 	THUMB
 
-arm_saveusercontext:
+up_saveusercontext:
 
 	/* Perform the System call with R0=0 and R1=regs */
 
diff --git a/arch/arm/src/armv7-r/arm_saveusercontext.S b/arch/arm/src/armv7-r/arm_saveusercontext.S
index e1a4686162..edbebfc75e 100644
--- a/arch/arm/src/armv7-r/arm_saveusercontext.S
+++ b/arch/arm/src/armv7-r/arm_saveusercontext.S
@@ -44,12 +44,12 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: arm_saveusercontext
+ * Name: up_saveusercontext
  *
  * Description:
  *   Save the current thread context.  Full prototype is:
  *
- *   int  arm_saveusercontext(uint32_t *saveregs);
+ *   int  up_saveusercontext(void *saveregs);
  *
  * Returned Value:
  *   0: Normal return
@@ -57,9 +57,9 @@
  *
  ****************************************************************************/
 
-	.globl	arm_saveusercontext
-	.type	arm_saveusercontext, function
-arm_saveusercontext:
+	.globl	up_saveusercontext
+	.type	up_saveusercontext, function
+up_saveusercontext:
 
 	/* On entry, a1 (r0) holds address of struct xcptcontext */
 
@@ -125,5 +125,5 @@ arm_saveusercontext:
 
 	mov		r0, #0			/* Return value == 0 */
 	bx		lr			/* Return */
-	.size	arm_saveusercontext, .-arm_saveusercontext
+	.size	up_saveusercontext, .-up_saveusercontext
 	.end
diff --git a/arch/arm/src/armv8-m/arm_saveusercontext.S b/arch/arm/src/armv8-m/arm_saveusercontext.S
index 0de40f3e81..604b4a4a74 100644
--- a/arch/arm/src/armv8-m/arm_saveusercontext.S
+++ b/arch/arm/src/armv8-m/arm_saveusercontext.S
@@ -49,12 +49,12 @@
  ****************************************************************************/
 
 /****************************************************************************
- * Name: arm_saveusercontext
+ * Name: up_saveusercontext
  *
  * Description:
  *   Save the current thread context.  Full prototype is:
  *
- *   int  arm_saveusercontext(uint32_t *saveregs);
+ *   int  up_saveusercontext(void *saveregs);
  *
  * Returned Value:
  *   0: Normal return
@@ -64,9 +64,9 @@
 
 	.text
 	.thumb_func
-	.globl	arm_saveusercontext
-	.type	arm_saveusercontext, function
-arm_saveusercontext:
+	.globl	up_saveusercontext
+	.type	up_saveusercontext, function
+up_saveusercontext:
 
 	/* Perform the System call with R0=0 and R1=regs */
 
@@ -84,5 +84,5 @@ arm_saveusercontext:
 	str		r3, [r2, #0]
 	bx		lr			/* "normal" return with r0=0 or
 						 * context switch with r0=1 */
-	.size	arm_saveusercontext, .-arm_saveusercontext
+	.size	up_saveusercontext, .-up_saveusercontext
 	.end
diff --git a/arch/arm/src/armv8-m/arm_svcall.c b/arch/arm/src/armv8-m/arm_svcall.c
index 74c40cd644..6c8631e72f 100644
--- a/arch/arm/src/armv8-m/arm_svcall.c
+++ b/arch/arm/src/armv8-m/arm_svcall.c
@@ -160,7 +160,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
     {
       /* R0=SYS_save_context:  This is a save context command:
        *
-       *   int arm_saveusercontext(uint32_t *saveregs);
+       *   int up_saveusercontext(void *saveregs);
        *
        * At this point, the following values are saved in context:
        *
diff --git a/arch/arm/src/common/arm_assert.c b/arch/arm/src/common/arm_assert.c
index ee6306170d..1246d2804a 100644
--- a/arch/arm/src/common/arm_assert.c
+++ b/arch/arm/src/common/arm_assert.c
@@ -371,7 +371,7 @@ static void arm_dumpstate(void)
     }
   else
     {
-      arm_saveusercontext(rtcb->xcp.regs);
+      up_saveusercontext(rtcb->xcp.regs);
     }
 
   /* Dump the registers */
diff --git a/arch/arm/src/common/arm_internal.h b/arch/arm/src/common/arm_internal.h
index f0e867a677..e51f1c2417 100644
--- a/arch/arm/src/common/arm_internal.h
+++ b/arch/arm/src/common/arm_internal.h
@@ -328,7 +328,6 @@ void arm_boot(void);
 /* Context switching */
 
 uint32_t *arm_decodeirq(uint32_t *regs);
-int  arm_saveusercontext(uint32_t *saveregs);
 void arm_fullcontextrestore(uint32_t *restoreregs) noreturn_function;
 void arm_switchcontext(uint32_t **saveregs, uint32_t *restoreregs);
 
diff --git a/arch/ceva/include/syscall.h b/arch/ceva/include/syscall.h
index 876d349e2d..f22102fd40 100644
--- a/arch/ceva/include/syscall.h
+++ b/arch/ceva/include/syscall.h
@@ -58,7 +58,7 @@
 
 /* SYS call 0:
  *
- * int up_saveusercontext(uint32_t *saveregs);
+ * int up_saveusercontext(void *saveregs);
  */
 
 #define SYS_save_context          0x00
diff --git a/arch/ceva/src/common/up_internal.h b/arch/ceva/src/common/up_internal.h
index dceb52b1c3..c00e580294 100644
--- a/arch/ceva/src/common/up_internal.h
+++ b/arch/ceva/src/common/up_internal.h
@@ -228,7 +228,6 @@ void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits);
 
 /* Context switching */
 
-int  up_saveusercontext(uint32_t *saveregs);
 void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function;
 void up_switchcontext(uint32_t **saveregs, uint32_t *restoreregs);
 
diff --git a/arch/ceva/src/common/up_saveusercontext.c b/arch/ceva/src/common/up_saveusercontext.c
index 0d101e872a..a1d0bffca1 100644
--- a/arch/ceva/src/common/up_saveusercontext.c
+++ b/arch/ceva/src/common/up_saveusercontext.c
@@ -39,7 +39,7 @@
  * Description:
  *   Save the current thread context.  Full prototype is:
  *
- *   int  up_saveusercontext(uint32_t *saveregs);
+ *   int  up_saveusercontext(void *saveregs);
  *
  * Return:
  *   0: Normal return
@@ -47,7 +47,7 @@
  *
  ****************************************************************************/
 
-int up_saveusercontext(uint32_t *saveregs)
+int up_saveusercontext(void *saveregs)
 {
   int ret;
 
diff --git a/arch/ceva/src/common/up_svcall.c b/arch/ceva/src/common/up_svcall.c
index ad4e8a6d0d..2b2115275a 100644
--- a/arch/ceva/src/common/up_svcall.c
+++ b/arch/ceva/src/common/up_svcall.c
@@ -85,7 +85,7 @@ int up_svcall(int irq, void *context, void *arg)
     {
       /* A0=SYS_save_context:  This is a save context command:
        *
-       *   int up_saveusercontext(uint32_t *saveregs);
+       *   int up_saveusercontext(void *saveregs);
        *
        * At this point, the following values are saved in context:
        *
diff --git a/arch/hc/src/common/up_internal.h b/arch/hc/src/common/up_internal.h
index 8daeda9775..4d55d3b872 100644
--- a/arch/hc/src/common/up_internal.h
+++ b/arch/hc/src/common/up_internal.h
@@ -148,7 +148,6 @@ void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits);
 
 void up_copystate(uint8_t *dest, uint8_t *src);
 void up_decodeirq(uint8_t *regs);
-int  up_saveusercontext(uint8_t *saveregs);
 void up_fullcontextrestore(uint8_t *restoreregs) noreturn_function;
 void up_switchcontext(uint8_t *saveregs, uint8_t *restoreregs);
 
diff --git a/arch/or1k/src/common/up_internal.h b/arch/or1k/src/common/up_internal.h
index 79f2532525..9ccf6376e0 100644
--- a/arch/or1k/src/common/up_internal.h
+++ b/arch/or1k/src/common/up_internal.h
@@ -240,7 +240,6 @@ int  or1k_print_cpuinfo(void);
 
 void up_copyfullstate(uint32_t *dest, uint32_t *src);
 void up_decodeirq(uint32_t *regs);
-int  up_saveusercontext(uint32_t *saveregs);
 void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function;
 void up_switchcontext(uint32_t *saveregs, uint32_t *restoreregs);
 
diff --git a/arch/renesas/src/common/up_internal.h b/arch/renesas/src/common/up_internal.h
index d18741a642..91e6c63a4e 100644
--- a/arch/renesas/src/common/up_internal.h
+++ b/arch/renesas/src/common/up_internal.h
@@ -143,7 +143,6 @@ void up_decodeirq(uint32_t *regs);
 uint32_t *up_doirq(int irq, uint32_t *regs);
 void up_fullcontextrestore(uint32_t *regs) noreturn_function;
 void up_prefetchabort(uint32_t *regs);
-int  up_saveusercontext(uint32_t *regs);
 void up_sigdeliver(void);
 void up_syscall(uint32_t *regs);
 void up_undefinedinsn(uint32_t *regs);
diff --git a/arch/renesas/src/m16c/m16c_vectors.S b/arch/renesas/src/m16c/m16c_vectors.S
index 72546c6073..d1f3f926a4 100644
--- a/arch/renesas/src/m16c/m16c_vectors.S
+++ b/arch/renesas/src/m16c/m16c_vectors.S
@@ -374,7 +374,7 @@ _m16c_commonvector:
 	reit					/* Return from interrupt */
 
 /************************************************************************************
- * Name: int up_saveusercontext(uint32_t *regs)
+ * Name: int up_saveusercontext(void *regs)
  *
  * Description:
  *   Save the context of the calling function at the point of the return from the
diff --git a/arch/renesas/src/rx65n/rx65n_vector.S b/arch/renesas/src/rx65n/rx65n_vector.S
index 0eff9d9fc4..5f7d7e9e7f 100644
--- a/arch/renesas/src/rx65n/rx65n_vector.S
+++ b/arch/renesas/src/rx65n/rx65n_vector.S
@@ -218,7 +218,7 @@ _up_vector:
   .size   _up_vector, . - _up_vector
 
 /****************************************************************************
- * Name: int up_saveusercontext(uint32_t *regs)
+ * Name: int up_saveusercontext(void *regs)
  *
  * Description:
  *   Save the context of the calling function at the point of the return from
diff --git a/arch/risc-v/src/bl602/Make.defs b/arch/risc-v/src/bl602/Make.defs
index 37203055fd..a88690ecdf 100644
--- a/arch/risc-v/src/bl602/Make.defs
+++ b/arch/risc-v/src/bl602/Make.defs
@@ -35,6 +35,7 @@ CMN_CSRCS += riscv_releasestack.c riscv_stackframe.c riscv_schedulesigaction.c
 CMN_CSRCS += riscv_sigdeliver.c riscv_udelay.c riscv_unblocktask.c riscv_usestack.c
 CMN_CSRCS += riscv_idle.c riscv_tcbinfo.c riscv_getnewintctx.c riscv_doirq.c
 CMN_CSRCS += riscv_exception.c riscv_mtimer.c riscv_misaligned.c
+CMN_CSRCS += riscv_saveusercontext.c
 
 ifeq ($(CONFIG_SCHED_BACKTRACE),y)
 CMN_CSRCS += riscv_backtrace.c
diff --git a/arch/risc-v/src/c906/Make.defs b/arch/risc-v/src/c906/Make.defs
index 4bdf6b9826..6a1a84503e 100644
--- a/arch/risc-v/src/c906/Make.defs
+++ b/arch/risc-v/src/c906/Make.defs
@@ -35,6 +35,7 @@ CMN_CSRCS += riscv_releasestack.c riscv_stackframe.c riscv_schedulesigaction.c
 CMN_CSRCS += riscv_sigdeliver.c riscv_unblocktask.c riscv_usestack.c
 CMN_CSRCS += riscv_mdelay.c riscv_idle.c riscv_doirq.c riscv_mtimer.c
 CMN_CSRCS += riscv_tcbinfo.c riscv_getnewintctx.c
+CMN_CSRCS += riscv_saveusercontext.c
 
 ifeq ($(CONFIG_SCHED_BACKTRACE),y)
 CMN_CSRCS += riscv_backtrace.c
diff --git a/arch/risc-v/src/common/riscv_assert.c b/arch/risc-v/src/common/riscv_assert.c
index 39b6a2b493..4fcaf7b2c0 100644
--- a/arch/risc-v/src/common/riscv_assert.c
+++ b/arch/risc-v/src/common/riscv_assert.c
@@ -337,7 +337,7 @@ static void riscv_dumpstate(void)
     }
   else
     {
-      riscv_saveusercontext(rtcb->xcp.regs);
+      up_saveusercontext(rtcb->xcp.regs);
     }
 
   /* Dump the registers (if available) */
diff --git a/arch/risc-v/src/common/riscv_internal.h b/arch/risc-v/src/common/riscv_internal.h
index a56be9416d..a719d859fb 100644
--- a/arch/risc-v/src/common/riscv_internal.h
+++ b/arch/risc-v/src/common/riscv_internal.h
@@ -330,18 +330,6 @@ void *riscv_perform_syscall(uintptr_t *regs);
 
 /* Context switching via system calls ***************************************/
 
-/* SYS call 0:
- *
- * int riscv_saveusercontext(uintptr_t *saveregs);
- *
- * Return:
- * 0: Normal Return
- * 1: Context Switch Return
- */
-
-#define riscv_saveusercontext(saveregs) \
-  sys_call1(SYS_save_context, (uintptr_t)saveregs)
-
 /* SYS call 1:
  *
  * void riscv_fullcontextrestore(uintptr_t *restoreregs) noreturn_function;
diff --git a/arch/ceva/src/common/up_saveusercontext.c b/arch/risc-v/src/common/riscv_saveusercontext.c
similarity index 75%
copy from arch/ceva/src/common/up_saveusercontext.c
copy to arch/risc-v/src/common/riscv_saveusercontext.c
index 0d101e872a..ef3d42da93 100644
--- a/arch/ceva/src/common/up_saveusercontext.c
+++ b/arch/risc-v/src/common/riscv_saveusercontext.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/ceva/src/common/up_saveusercontext.c
+ * arch/risc-v/src/common/riscv_saveusercontext.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -23,12 +23,9 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
-#include <nuttx/irq.h>
 
 #include <arch/syscall.h>
 
-#include "up_internal.h"
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
@@ -39,30 +36,15 @@
  * Description:
  *   Save the current thread context.  Full prototype is:
  *
- *   int  up_saveusercontext(uint32_t *saveregs);
+ *   int  up_saveusercontext(void *saveregs);
  *
- * Return:
+ * Returned Value:
  *   0: Normal return
  *   1: Context switch return
  *
  ****************************************************************************/
 
-int up_saveusercontext(uint32_t *saveregs)
+int up_saveusercontext(FAR void *saveregs)
 {
-  int ret;
-
-  /* Let sys_call1() do all of the work */
-
-  ret = sys_call1(SYS_save_context, (uintptr_t)saveregs);
-  if (ret == 0)
-    {
-      /* There are two return conditions.  On the first return, A0 (the
-       * return value will be zero.  On the second return we need to
-       * force A0 to be 1.
-       */
-
-      saveregs[REG_A0] = 1;
-    }
-
-  return ret;
+  return sys_call1(SYS_save_context, (uintptr_t)saveregs);
 }
diff --git a/arch/risc-v/src/common/riscv_swint.c b/arch/risc-v/src/common/riscv_swint.c
index 30f67a5438..53f4e1db7f 100644
--- a/arch/risc-v/src/common/riscv_swint.c
+++ b/arch/risc-v/src/common/riscv_swint.c
@@ -172,7 +172,7 @@ int riscv_swint(int irq, void *context, void *arg)
     {
       /* A0=SYS_save_context:  This is a save context command:
        *
-       *   int riscv_saveusercontext(uintptr saveregs);
+       *   int up_saveusercontext(void *saveregs);
        *
        * At this point, the following values are saved in context:
        *
diff --git a/arch/risc-v/src/esp32c3/Make.defs b/arch/risc-v/src/esp32c3/Make.defs
index c9d611a818..a72ac8b69b 100644
--- a/arch/risc-v/src/esp32c3/Make.defs
+++ b/arch/risc-v/src/esp32c3/Make.defs
@@ -41,6 +41,7 @@ CMN_CSRCS += riscv_releasepending.c riscv_reprioritizertr.c
 CMN_CSRCS += riscv_releasestack.c riscv_stackframe.c riscv_schedulesigaction.c
 CMN_CSRCS += riscv_sigdeliver.c riscv_udelay.c riscv_unblocktask.c riscv_usestack.c
 CMN_CSRCS += riscv_tcbinfo.c riscv_getnewintctx.c riscv_doirq.c
+CMN_CSRCS += riscv_saveusercontext.c
 
 ifeq ($(CONFIG_SCHED_BACKTRACE),y)
 CMN_CSRCS += riscv_backtrace.c
diff --git a/arch/risc-v/src/fe310/Make.defs b/arch/risc-v/src/fe310/Make.defs
index 51510122f7..4b09e739cc 100644
--- a/arch/risc-v/src/fe310/Make.defs
+++ b/arch/risc-v/src/fe310/Make.defs
@@ -34,6 +34,7 @@ CMN_CSRCS += riscv_releasepending.c riscv_reprioritizertr.c
 CMN_CSRCS += riscv_releasestack.c riscv_stackframe.c riscv_schedulesigaction.c
 CMN_CSRCS += riscv_sigdeliver.c riscv_udelay.c riscv_unblocktask.c riscv_usestack.c
 CMN_CSRCS += riscv_idle.c riscv_tcbinfo.c riscv_getnewintctx.c riscv_doirq.c
+CMN_CSRCS += riscv_saveusercontext.c
 
 ifeq ($(CONFIG_SCHED_BACKTRACE),y)
 CMN_CSRCS += riscv_backtrace.c
diff --git a/arch/risc-v/src/k210/Make.defs b/arch/risc-v/src/k210/Make.defs
index 39413b80db..ede2b143a2 100644
--- a/arch/risc-v/src/k210/Make.defs
+++ b/arch/risc-v/src/k210/Make.defs
@@ -35,7 +35,7 @@ CMN_CSRCS += riscv_releasestack.c riscv_stackframe.c riscv_schedulesigaction.c
 CMN_CSRCS += riscv_sigdeliver.c riscv_unblocktask.c riscv_usestack.c
 CMN_CSRCS += riscv_mdelay.c riscv_idle.c riscv_doirq.c
 CMN_CSRCS += riscv_tcbinfo.c riscv_cpuidlestack.c riscv_getnewintctx.c
-CMN_CSRCS += riscv_misaligned.c
+CMN_CSRCS += riscv_misaligned.c riscv_saveusercontext.c
 
 ifeq ($(CONFIG_SMP), y)
 CMN_CSRCS += riscv_cpuindex.c riscv_cpupause.c riscv_cpustart.c
diff --git a/arch/risc-v/src/litex/Make.defs b/arch/risc-v/src/litex/Make.defs
index 6af0cc8a8e..768d5269ad 100644
--- a/arch/risc-v/src/litex/Make.defs
+++ b/arch/risc-v/src/litex/Make.defs
@@ -34,6 +34,7 @@ CMN_CSRCS += riscv_releasepending.c riscv_reprioritizertr.c
 CMN_CSRCS += riscv_releasestack.c riscv_stackframe.c riscv_schedulesigaction.c
 CMN_CSRCS += riscv_sigdeliver.c riscv_udelay.c riscv_unblocktask.c riscv_usestack.c
 CMN_CSRCS += riscv_idle.c riscv_tcbinfo.c riscv_getnewintctx.c
+CMN_CSRCS += riscv_saveusercontext.c
 
 ifeq ($(CONFIG_SCHED_BACKTRACE),y)
 CMN_CSRCS += riscv_backtrace.c
diff --git a/arch/risc-v/src/mpfs/Make.defs b/arch/risc-v/src/mpfs/Make.defs
index 66654a03e4..c95c8a6d1d 100755
--- a/arch/risc-v/src/mpfs/Make.defs
+++ b/arch/risc-v/src/mpfs/Make.defs
@@ -33,6 +33,7 @@ CMN_CSRCS += riscv_sigdeliver.c riscv_unblocktask.c riscv_usestack.c
 CMN_CSRCS += riscv_mdelay.c riscv_udelay.c
 CMN_CSRCS += riscv_idle.c riscv_tcbinfo.c riscv_getnewintctx.c
 CMN_CSRCS += riscv_doirq.c riscv_mtimer.c
+CMN_CSRCS += riscv_saveusercontext.c
 
 # Specify ASM code within the common directory to be included
 CMN_ASRCS += riscv_mhartid.S
diff --git a/arch/risc-v/src/qemu-rv/Make.defs b/arch/risc-v/src/qemu-rv/Make.defs
index 11a8cf93f4..89c251ae2b 100644
--- a/arch/risc-v/src/qemu-rv/Make.defs
+++ b/arch/risc-v/src/qemu-rv/Make.defs
@@ -35,6 +35,7 @@ CMN_CSRCS += riscv_releasestack.c riscv_stackframe.c riscv_schedulesigaction.c
 CMN_CSRCS += riscv_sigdeliver.c riscv_unblocktask.c riscv_usestack.c
 CMN_CSRCS += riscv_idle.c riscv_tcbinfo.c riscv_cpuidlestack.c
 CMN_CSRCS += riscv_exception.c riscv_getnewintctx.c riscv_doirq.c
+CMN_CSRCS += riscv_saveusercontext.c
 
 ifeq ($(CONFIG_SMP), y)
 CMN_CSRCS += riscv_cpuindex.c riscv_cpupause.c riscv_cpustart.c
diff --git a/arch/risc-v/src/rv32m1/Make.defs b/arch/risc-v/src/rv32m1/Make.defs
index b009fb7284..f1dc2d0dea 100644
--- a/arch/risc-v/src/rv32m1/Make.defs
+++ b/arch/risc-v/src/rv32m1/Make.defs
@@ -34,6 +34,7 @@ CMN_CSRCS += riscv_releasepending.c riscv_reprioritizertr.c
 CMN_CSRCS += riscv_releasestack.c riscv_stackframe.c riscv_schedulesigaction.c
 CMN_CSRCS += riscv_sigdeliver.c riscv_unblocktask.c riscv_usestack.c
 CMN_CSRCS += riscv_idle.c riscv_tcbinfo.c riscv_getnewintctx.c
+CMN_CSRCS += riscv_saveusercontext.c
 
 ifeq ($(CONFIG_SCHED_BACKTRACE),y)
 CMN_CSRCS += riscv_backtrace.c
diff --git a/arch/x86/src/common/up_internal.h b/arch/x86/src/common/up_internal.h
index f7c6c01028..00647d3362 100644
--- a/arch/x86/src/common/up_internal.h
+++ b/arch/x86/src/common/up_internal.h
@@ -186,7 +186,6 @@ void up_decodeirq(uint32_t *regs);
 #ifdef CONFIG_ARCH_DMA
 void weak_function up_dma_initialize(void);
 #endif
-int  up_saveusercontext(uint32_t *saveregs);
 void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function;
 void up_switchcontext(uint32_t *saveregs, uint32_t *restoreregs);
 void up_sigdeliver(void);
diff --git a/arch/x86/src/qemu/qemu_saveusercontext.S b/arch/x86/src/qemu/qemu_saveusercontext.S
index 0f7a931101..d3c9ab437b 100644
--- a/arch/x86/src/qemu/qemu_saveusercontext.S
+++ b/arch/x86/src/qemu/qemu_saveusercontext.S
@@ -66,7 +66,7 @@
  * Name: up_saveusercontext
  *
  * Full C prototype:
- *  int up_saveusercontext(uint32_t *regs);
+ *  int up_saveusercontext(void *regs);
  *
  * Description:
  *  Save the "user" context.  It is not necessary to save all of the
diff --git a/arch/x86_64/src/common/up_internal.h b/arch/x86_64/src/common/up_internal.h
index 324b6eaf0e..9552b6d29b 100644
--- a/arch/x86_64/src/common/up_internal.h
+++ b/arch/x86_64/src/common/up_internal.h
@@ -205,7 +205,6 @@ void up_decodeirq(uint64_t *regs);
 #ifdef CONFIG_ARCH_DMA
 void weak_function up_dmainitialize(void);
 #endif
-int  up_saveusercontext(uint64_t *saveregs);
 void up_fullcontextrestore(uint64_t *restoreregs) noreturn_function;
 void up_switchcontext(uint64_t *saveregs, uint64_t *restoreregs);
 void up_sigdeliver(void);
diff --git a/arch/x86_64/src/intel64/intel64_saveusercontext.S b/arch/x86_64/src/intel64/intel64_saveusercontext.S
index fd51be0833..4c8479e25f 100644
--- a/arch/x86_64/src/intel64/intel64_saveusercontext.S
+++ b/arch/x86_64/src/intel64/intel64_saveusercontext.S
@@ -66,7 +66,7 @@
  * Name: up_saveusercontext
  *
  * Full C prototype:
- *  int up_saveusercontext(uint32_t *regs);
+ *  int up_saveusercontext(void *regs);
  *
  * Description:
  *  Save the "user" context.  It is not necessary to save all of the
diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_ostest.c b/boards/arm/cxd56xx/spresense/src/cxd56_ostest.c
index a0c7934498..1175382fc3 100644
--- a/boards/arm/cxd56xx/spresense/src/cxd56_ostest.c
+++ b/boards/arm/cxd56xx/spresense/src/cxd56_ostest.c
@@ -77,7 +77,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c b/boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c
index c0ef9b05a2..8492c28abb 100644
--- a/boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c
+++ b/boards/arm/lpc43xx/bambino-200e/src/lpc43_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c
index 9210a0a8da..4a40ae092a 100644
--- a/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c
+++ b/boards/arm/lpc43xx/lpc4330-xplorer/src/lpc43_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c
index a45ba6f2fd..7881b3467e 100644
--- a/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c
+++ b/boards/arm/lpc43xx/lpc4357-evb/src/lpc43_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c
index ac1b6973aa..f416e346dd 100644
--- a/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c
+++ b/boards/arm/lpc43xx/lpc4370-link2/src/lpc43_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/sama5/giant-board/src/sam_ostest.c b/boards/arm/sama5/giant-board/src/sam_ostest.c
index 1c20304755..40b8952f88 100644
--- a/boards/arm/sama5/giant-board/src/sam_ostest.c
+++ b/boards/arm/sama5/giant-board/src/sam_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/sama5/sama5d2-xult/src/sam_ostest.c b/boards/arm/sama5/sama5d2-xult/src/sam_ostest.c
index caa668b54c..b6f9993d34 100644
--- a/boards/arm/sama5/sama5d2-xult/src/sam_ostest.c
+++ b/boards/arm/sama5/sama5d2-xult/src/sam_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/sama5/sama5d3-xplained/src/sam_ostest.c b/boards/arm/sama5/sama5d3-xplained/src/sam_ostest.c
index c603b3918e..543347ba4f 100644
--- a/boards/arm/sama5/sama5d3-xplained/src/sam_ostest.c
+++ b/boards/arm/sama5/sama5d3-xplained/src/sam_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/sama5/sama5d3x-ek/src/sam_ostest.c b/boards/arm/sama5/sama5d3x-ek/src/sam_ostest.c
index c664cd21e7..4f7efeecc6 100644
--- a/boards/arm/sama5/sama5d3x-ek/src/sam_ostest.c
+++ b/boards/arm/sama5/sama5d3x-ek/src/sam_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/sama5/sama5d4-ek/src/sam_ostest.c b/boards/arm/sama5/sama5d4-ek/src/sam_ostest.c
index b0f9f3c1c2..03bd727574 100644
--- a/boards/arm/sama5/sama5d4-ek/src/sam_ostest.c
+++ b/boards/arm/sama5/sama5d4-ek/src/sam_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/stm32/omnibusf4/src/stm32_ostest.c b/boards/arm/stm32/omnibusf4/src/stm32_ostest.c
index d568837151..45a854417e 100644
--- a/boards/arm/stm32/omnibusf4/src/stm32_ostest.c
+++ b/boards/arm/stm32/omnibusf4/src/stm32_ostest.c
@@ -76,7 +76,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/stm32/stm3240g-eval/src/stm32_ostest.c b/boards/arm/stm32/stm3240g-eval/src/stm32_ostest.c
index 6a7a06c9b2..db0f92fa22 100644
--- a/boards/arm/stm32/stm3240g-eval/src/stm32_ostest.c
+++ b/boards/arm/stm32/stm3240g-eval/src/stm32_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/stm32/stm32f429i-disco/src/stm32_ostest.c b/boards/arm/stm32/stm32f429i-disco/src/stm32_ostest.c
index 12c6f91e9a..6c79bd6bee 100644
--- a/boards/arm/stm32/stm32f429i-disco/src/stm32_ostest.c
+++ b/boards/arm/stm32/stm32f429i-disco/src/stm32_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/stm32/stm32f4discovery/src/stm32_ostest.c b/boards/arm/stm32/stm32f4discovery/src/stm32_ostest.c
index 5a24458fc5..44af8111d9 100644
--- a/boards/arm/stm32/stm32f4discovery/src/stm32_ostest.c
+++ b/boards/arm/stm32/stm32f4discovery/src/stm32_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_ostest.c b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_ostest.c
index 46d1762d66..976450cd2b 100644
--- a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_ostest.c
+++ b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/stm32f7/stm32f769i-disco/src/stm32_ostest.c b/boards/arm/stm32f7/stm32f769i-disco/src/stm32_ostest.c
index 92b490faad..71cc535dbf 100644
--- a/boards/arm/stm32f7/stm32f769i-disco/src/stm32_ostest.c
+++ b/boards/arm/stm32f7/stm32f769i-disco/src/stm32_ostest.c
@@ -78,7 +78,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_ostest.c b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_ostest.c
index e058a38514..29e38ef2e0 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_ostest.c
+++ b/boards/arm/stm32h7/nucleo-h743zi2/src/stm32_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/xmc4/xmc4500-relax/src/xmc4_ostest.c b/boards/arm/xmc4/xmc4500-relax/src/xmc4_ostest.c
index f3e566c9b9..a7a9a7d72f 100644
--- a/boards/arm/xmc4/xmc4500-relax/src/xmc4_ostest.c
+++ b/boards/arm/xmc4/xmc4500-relax/src/xmc4_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/arm/xmc4/xmc4700-relax/src/xmc4_ostest.c b/boards/arm/xmc4/xmc4700-relax/src/xmc4_ostest.c
index ef3f59bc4e..bb860e0e13 100644
--- a/boards/arm/xmc4/xmc4700-relax/src/xmc4_ostest.c
+++ b/boards/arm/xmc4/xmc4700-relax/src/xmc4_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  arm_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/risc-v/bl602/bl602evb/src/bl602_ostest.c b/boards/risc-v/bl602/bl602evb/src/bl602_ostest.c
index bd11c4e3b6..64805b5dec 100644
--- a/boards/risc-v/bl602/bl602evb/src/bl602_ostest.c
+++ b/boards/risc-v/bl602/bl602evb/src/bl602_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  riscv_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/risc-v/c906/smartl-c906/src/c906_ostest.c b/boards/risc-v/c906/smartl-c906/src/c906_ostest.c
index dd6bc11fe8..ea670d5bca 100644
--- a/boards/risc-v/c906/smartl-c906/src/c906_ostest.c
+++ b/boards/risc-v/c906/smartl-c906/src/c906_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  riscv_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/risc-v/mpfs/common/src/mpfs_ostest.c b/boards/risc-v/mpfs/common/src/mpfs_ostest.c
index 6b4e3dbfec..d85bc811ea 100755
--- a/boards/risc-v/mpfs/common/src/mpfs_ostest.c
+++ b/boards/risc-v/mpfs/common/src/mpfs_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  riscv_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_ostest.c b/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_ostest.c
index 4fefb06a08..e2dd2165a0 100644
--- a/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_ostest.c
+++ b/boards/risc-v/qemu-rv/rv-virt/src/qemu_rv_ostest.c
@@ -74,7 +74,7 @@ void arch_getfpu(FAR uint32_t *fpusave)
   /* Take a snapshot of the thread context right now */
 
   flags = enter_critical_section();
-  riscv_saveusercontext(g_saveregs);
+  up_saveusercontext(g_saveregs);
 
   /* Return only the floating register values */
 
diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h
index 1d0d8b8688..deb1ce5233 100644
--- a/include/nuttx/arch.h
+++ b/include/nuttx/arch.h
@@ -2563,6 +2563,16 @@ uint32_t up_perf_gettime(void);
 uint32_t up_perf_getfreq(void);
 void up_perf_convert(uint32_t elapsed, FAR struct timespec *ts);
 
+/****************************************************************************
+ * Name: up_saveusercontext
+ *
+ * Description:
+ *   Save the current thread context
+ *
+ ****************************************************************************/
+
+int up_saveusercontext(FAR void *saveregs);
+
 #undef EXTERN
 #if defined(__cplusplus)
 }