xiaoxiang781216 commented on a change in pull request #5645:
URL: https://github.com/apache/incubator-nuttx/pull/5645#discussion_r818479461



##########
File path: arch/arm/src/armv7-m/arm_svcall.c
##########
@@ -176,7 +176,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
         {
           DEBUGASSERT(regs[REG_R1] != 0);
           memcpy((uint32_t *)regs[REG_R1], regs, XCPTCONTEXT_SIZE);
-#if defined(CONFIG_ARCH_FPU) && defined(CONFIG_ARMV7M_LAZYFPU)
+#if defined(CONFIG_ARMV7M_LAZYFPU)
           arm_savefpu((uint32_t *)regs[REG_R1]);
 #endif

Review comment:
       change to:
   ```
   #if defined(CONFIG_ARMV7M_LAZYFPU)
    arm_savefpu(regs);
   #endif
    memcpy((uint32_t *)regs[REG_R1], regs, XCPTCONTEXT_SIZE);
   ```

##########
File path: arch/arm/src/common/arm_internal.h
##########
@@ -103,10 +103,10 @@
    * applies if "lazy" floating point register save/restore is used
    */
 
-#  if defined(CONFIG_ARCH_FPU) && defined(CONFIG_ARMV7M_LAZYFPU)
-#    define arm_savestate(regs)  arm_copyarmstate(regs, 
(uint32_t*)CURRENT_REGS)
+#  if defined(CONFIG_ARMV7M_LAZYFPU) || defined(CONFIG_ARMV8M_LAZYFPU)
+#    define arm_savestate(regs)  (regs = (FAR uint32_t *)CURRENT_REGS, 
arm_savefpu(regs))
 #  else
-#    define arm_savestate(regs)  arm_copyfullstate(regs, 
(uint32_t*)CURRENT_REGS)
+#    define arm_savestate(regs)  (regs = (FAR uint32_t *)CURRENT_REGS)

Review comment:
       remove all FAR

##########
File path: arch/arm/src/armv8-m/arm_svcall.c
##########
@@ -175,7 +175,7 @@ int arm_svcall(int irq, FAR void *context, FAR void *arg)
         {
           DEBUGASSERT(regs[REG_R1] != 0);
           memcpy((uint32_t *)regs[REG_R1], regs, XCPTCONTEXT_SIZE);
-#if defined(CONFIG_ARCH_FPU) && defined(CONFIG_ARMV8M_LAZYFPU)
+#if defined(CONFIG_ARMV8M_LAZYFPU)
           arm_savefpu((uint32_t *)regs[REG_R1]);
 #endif

Review comment:
       change to:
   ```
   #if defined(CONFIG_ARMV8M_LAZYFPU)
             arm_savefpu(regs);
   #endif 
            memcpy((uint32_t *)regs[REG_R1], regs, XCPTCONTEXT_SIZE);
   ```




-- 
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-unsubscr...@nuttx.apache.org

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


Reply via email to