You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/19 11:11:14 UTC

[GitHub] [incubator-nuttx] pussuw commented on a diff in pull request #6101: arch/risc-v: Merge status/fpu context save/load to save_ctx/load_ctx

pussuw commented on code in PR #6101:
URL: https://github.com/apache/incubator-nuttx/pull/6101#discussion_r852915587


##########
arch/risc-v/src/common/riscv_exception_common.S:
##########
@@ -83,20 +83,6 @@ exception_common:
   addi       sp, sp, -XCPTCONTEXT_SIZE
   save_ctx   sp
 
-  csrr       s0, CSR_STATUS
-  REGSTORE   s0, REG_INT_CTX(sp)  /* status */
-
-  addi       s0, sp, XCPTCONTEXT_SIZE
-  REGSTORE   s0, REG_X2(sp)       /* original SP */
-
-  csrr       s0, CSR_EPC
-  REGSTORE   s0, REG_EPC(sp)      /* exception PC */
-
-#ifdef CONFIG_ARCH_FPU
-  mv         a0, sp
-  jal        x1, riscv_savefpu    /* save FPU context */

Review Comment:
   Another option would be to define riscv_savefpu as a macro.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org