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/05/12 20:33:15 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6222: xtensa: move fpu register to XCPTCONTEXT_REGS

pkarashchenko commented on code in PR #6222:
URL: https://github.com/apache/incubator-nuttx/pull/6222#discussion_r871785422


##########
arch/xtensa/src/common/xtensa_coproc.S:
##########
@@ -112,77 +113,87 @@ _xtensa_coproc_savestate:
 
 	/* Move the address of the thread state save area to R15 */
 
-	mov		a15, a2							/* A15 is now the address of the save area */
+	mov	a3, a2						/* A3 is now the address of the save area */
+
+	/* The stack when interrupt happened (the register a2)
+	* ----------------------------------------------------
+	* | Reserve area (0x20)                              |
+	* ----------------------------------------------------
+	* | Coproc context                                   |
+	* ----------------------------------------------------
+	* | Xtensa common regs                               |
+	* ---------------------------------------------------| <- SP
+	*/
+
+	addi	a3, a3, (4 * XCPTCONTEXT_REGS)
 
 	/* CPENABLE should show which CPs are enabled. */
 
-	rsr		a2, CPENABLE					/* a2 = which CPs are enabled */
-	beqz	a2, .Ldone1						/* Quick exit if none */
+	rsr	a2, CPENABLE					/* a2 = which CPs are enabled */
+	beqz	a2, .Ldone1					/* Quick exit if none */
 
-	s16i	a2, a15, XTENSA_CPSTORED		/* Save mask of CPs being stored */
-	movi	a13, _xtensa_coproc_saoffsets	/* Array of CP save offsets */
-	addi	a15, a15, XTENSA_CPASA			/* a15 = base of aligned save area */
+	movi	a13, _xtensa_coproc_saoffsets			/* Array of CP save offsets */
 
 #if XCHAL_CP0_SA_SIZE > 0
-	bbci.l	a2, 0, 2f						/* CP 0 not enabled */
-	l32i	a14, a13, 0						/* a14 = _xtensa_coproc_saoffsets[0] */
-	add		a3, a14, a15					/* a3 = save area for CP 0 */
+	bbci.l	a2, 0, 2f					/* CP 0 not enabled */
+	l32i	a14, a13, 0					/* a14 = _xtensa_coproc_saoffsets[0] */
+	add	a3, a14, a3					/* a3 = save area for CP 0 */

Review Comment:
   Can you please align code with TABs? Here and other similar places



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