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/01/10 08:35:03 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5198: xtensa: fix lack of float register save & resotre

pkarashchenko commented on a change in pull request #5198:
URL: https://github.com/apache/incubator-nuttx/pull/5198#discussion_r780976470



##########
File path: arch/xtensa/include/xtensa/xtensa_coproc.h
##########
@@ -131,19 +131,20 @@
 
 #define XTENSA_CPENABLE   0  /* (2 bytes) coprocessors active for this thread */
 #define XTENSA_CPSTORED   2  /* (2 bytes) coprocessors saved for this thread */
-#define XTENSA_CPASA      4  /* (4 bytes) ptr to aligned save area */
+#define XTENSA_CPASA      8  /* (8 bytes) ptr to aligned save area */
 
 /****************************************************************************
  * Public Types
  ****************************************************************************/
 
 #ifndef __ASSEMBLY__
 
-struct xtensa_cpstate_s
+struct aligned_data(8) xtensa_cpstate_s
 {
-  uint16_t cpenable;  /* (2 bytes) Co-processors active for this thread */
-  uint16_t cpstored;  /* (2 bytes) Co-processors saved for this thread */
-  uint32_t *cpasa;    /* (4 bytes) Pointer to aligned save area */
+  uint16_t cpenable;                 /* (2 bytes) Co-processors active for this thread */
+  uint16_t cpstored;                 /* (2 bytes) Co-processors saved for this thread */
+  uint16_t reserved[2];              /* keep cpasa aligned 8 */

Review comment:
       Minor: using `uint16_t reserved[2]` is fine, but I would recommend.
   ```suggestion
     uint8_t  reserved[4];              /* keep cpasa aligned 8 */
   ```
   
   Also a question can we do `uint8_t cpasa[XTENSA_CP_SA_SIZE] aligned_data(8); /* cp save area */` will work with `reserved` removed?




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