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 83a5e9958f363aeca17518117707ce99edfc717a
Author: Huang Qi <huang...@xiaomi.com>
AuthorDate: Mon Mar 28 10:50:56 2022 +0800

    arch/risc-v: Correct comments for current implementations
    
    Signed-off-by: Huang Qi <huang...@xiaomi.com>
---
 arch/risc-v/include/irq.h               |  2 +-
 arch/risc-v/src/common/riscv_internal.h |  4 ++--
 arch/risc-v/src/common/riscv_swint.c    | 20 ++++++++++----------
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/risc-v/include/irq.h b/arch/risc-v/include/irq.h
index 20651c9..5abe734 100644
--- a/arch/risc-v/include/irq.h
+++ b/arch/risc-v/include/irq.h
@@ -492,7 +492,7 @@ struct xcptcontext
   /* These additional register save locations are used to implement the
    * signal delivery trampoline.
    *
-   * REVISIT:  Because there is only one copy of these save areas,
+   * REVISIT:  Because there is only a reference of these save areas,
    * only a single signal handler can be active.  This precludes
    * queuing of signal actions.  As a result, signals received while
    * another signal handler is executing will be ignored!
diff --git a/arch/risc-v/src/common/riscv_internal.h 
b/arch/risc-v/src/common/riscv_internal.h
index 5e1dacc..be7967e 100644
--- a/arch/risc-v/src/common/riscv_internal.h
+++ b/arch/risc-v/src/common/riscv_internal.h
@@ -64,8 +64,8 @@
 #  define PRIxREG "016" PRIxPTR
 #endif
 
-/* In the RISC_V model, the state is copied from the stack to the TCB, but
- * only a referenced is passed to get the state from the TCB.
+/* In the RISC-V model, the state is saved in stack,
+ * only a reference stored in TCB.
  */
 
 #ifdef CONFIG_ARCH_FPU
diff --git a/arch/risc-v/src/common/riscv_swint.c 
b/arch/risc-v/src/common/riscv_swint.c
index 16f05af..7d14148 100644
--- a/arch/risc-v/src/common/riscv_swint.c
+++ b/arch/risc-v/src/common/riscv_swint.c
@@ -214,8 +214,8 @@ int riscv_swint(int irq, void *context, void *arg)
        *   A1 = restoreregs
        *
        * In this case, we simply need to set CURRENT_REGS to restore register
-       * area referenced in the saved R1. context == CURRENT_REGS is the
-       * normal exception return.  By setting CURRENT_REGS = context[R1], we
+       * area referenced in the saved A1. context == CURRENT_REGS is the
+       * normal exception return.  By setting CURRENT_REGS = context[A1], we
        * force the return to the saved context referenced in $a1.
        */
 
@@ -364,9 +364,9 @@ int riscv_swint(int irq, void *context, void *arg)
        *
        * At this point, the following values are saved in context:
        *
-       *   R0 = SYS_pthread_start
-       *   R1 = entrypt
-       *   R2 = arg
+       *   A0 = SYS_pthread_start
+       *   A1 = entrypt
+       *   A2 = arg
        */
 
 #if !defined(CONFIG_BUILD_FLAT) && !defined(CONFIG_DISABLE_PTHREAD)
@@ -396,11 +396,11 @@ int riscv_swint(int irq, void *context, void *arg)
        *
        * At this point, the following values are saved in context:
        *
-       *   R0 = SYS_signal_handler
-       *   R1 = sighand
-       *   R2 = signo
-       *   R3 = info
-       *   R4 = ucontext
+       *   A0 = SYS_signal_handler
+       *   A1 = sighand
+       *   A2 = signo
+       *   A3 = info
+       *   A4 = ucontext
        */
 
 #ifndef CONFIG_BUILD_FLAT

Reply via email to