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


The following commit(s) were added to refs/heads/master by this push:
     new cb73e9a67d arch: qemu-rv: Refactor the entry point name for 
BUILD_KERNEL
cb73e9a67d is described below

commit cb73e9a67dcded63252b0ee7ac421495e0b4c609
Author: Masayuki Ishikawa <masayuki.ishik...@gmail.com>
AuthorDate: Sun Oct 9 11:40:37 2022 +0900

    arch: qemu-rv: Refactor the entry point name for BUILD_KERNEL
    
    Summary:
    - This commit refactors the entry point name for BUILD_KERNEL
      to avoid misunderstanding the name
    
    Impact:
    - None
    
    Testing:
    - Tested with rv-virt:ksmp64
    
    Signed-off-by: Masayuki Ishikawa <masayuki.ishik...@jp.sony.com>
---
 arch/risc-v/src/qemu-rv/qemu_rv_head.S  |  4 ----
 arch/risc-v/src/qemu-rv/qemu_rv_start.c | 10 +++++++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/risc-v/src/qemu-rv/qemu_rv_head.S 
b/arch/risc-v/src/qemu-rv/qemu_rv_head.S
index f55ec9a30b..aad807fee1 100644
--- a/arch/risc-v/src/qemu-rv/qemu_rv_head.S
+++ b/arch/risc-v/src/qemu-rv/qemu_rv_head.S
@@ -105,11 +105,7 @@ __start:
 
   /* Jump to qemu_rv_start */
 
-#ifdef CONFIG_ARCH_USE_S_MODE
-  jal  x1, qemu_rv_start_s
-#else
   jal  x1, qemu_rv_start
-#endif
 
   /* We shouldn't return from _start */
 
diff --git a/arch/risc-v/src/qemu-rv/qemu_rv_start.c 
b/arch/risc-v/src/qemu-rv/qemu_rv_start.c
index 34158c80cc..04424d7cb1 100644
--- a/arch/risc-v/src/qemu-rv/qemu_rv_start.c
+++ b/arch/risc-v/src/qemu-rv/qemu_rv_start.c
@@ -95,7 +95,11 @@ uintptr_t g_idle_topstack = QEMU_RV_IDLESTACK_TOP;
  * Name: qemu_rv_start
  ****************************************************************************/
 
+#ifdef CONFIG_BUILD_KERNEL
+void qemu_rv_start_s(int mhartid)
+#else
 void qemu_rv_start(int mhartid)
+#endif
 {
   /* Configure FPU */
 
@@ -147,10 +151,10 @@ cpux:
 #ifdef CONFIG_BUILD_KERNEL
 
 /****************************************************************************
- * Name: qemu_rv_start_s
+ * Name: qemu_rv_start
  ****************************************************************************/
 
-void qemu_rv_start_s(int mhartid)
+void qemu_rv_start(int mhartid)
 {
   /* NOTE: still in M-mode */
 
@@ -202,7 +206,7 @@ void qemu_rv_start_s(int mhartid)
 
   /* Set mepc to the entry */
 
-  WRITE_CSR(mepc, (uintptr_t)qemu_rv_start);
+  WRITE_CSR(mepc, (uintptr_t)qemu_rv_start_s);
 
   /* Set a0 to mhartid explicitly and enter to S-mode */
 

Reply via email to