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/08/26 01:36:59 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6924: xtensa: Fix allocation of FPU registers in exception context

xiaoxiang781216 commented on code in PR #6924:
URL: https://github.com/apache/incubator-nuttx/pull/6924#discussion_r955566236


##########
arch/xtensa/src/common/xtensa_fpucmp.c:
##########
@@ -59,8 +72,23 @@ bool up_fpucmp(const void *saveregs1, const void *saveregs2)
 {
   const uint32_t *regs1 = saveregs1;
   const uint32_t *regs2 = saveregs2;
+  uint32_t cpenable = xtensa_get_cpenable();
+  int ndx = 0;
+  bool ret = true;
+  int i;
+
+  while (ret && (i = __builtin_ffs(cpenable)))

Review Comment:
   call ffs instead?



##########
arch/xtensa/src/common/xtensa_fpucmp.c:
##########
@@ -30,11 +30,23 @@
 
 #include "xtensa.h"
 
+#ifdef CONFIG_ARCH_FPU
+
 /****************************************************************************
- * Pre-processor Definitions
+ * Private Data
  ****************************************************************************/
 
-#ifdef CONFIG_ARCH_FPU
+static uint32_t coproc_sa_offsets[] =

Review Comment:
   add g_ prefix



##########
arch/xtensa/src/common/xtensa_fpucmp.c:
##########
@@ -30,11 +30,23 @@
 
 #include "xtensa.h"
 
+#ifdef CONFIG_ARCH_FPU
+
 /****************************************************************************
- * Pre-processor Definitions
+ * Private Data
  ****************************************************************************/
 
-#ifdef CONFIG_ARCH_FPU
+static uint32_t coproc_sa_offsets[] =
+{
+  XTENSA_CP0_SA, XTENSA_CP1_SA, XTENSA_CP2_SA, XTENSA_CP3_SA,
+  XTENSA_CP4_SA, XTENSA_CP5_SA, XTENSA_CP6_SA, XTENSA_CP7_SA
+};
+
+static uint32_t coproc_sa_sizes[] =

Review Comment:
   ditto



-- 
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