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/09/09 02:14:19 UTC

[GitHub] [incubator-nuttx] zyfeier opened a new pull request, #7045: arch/arm: use SRS and RFE for exception handler

zyfeier opened a new pull request, #7045:
URL: https://github.com/apache/incubator-nuttx/pull/7045

   ## Summary
   
   ## Impact
   
   ## Testing
   
   


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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7045: arch/arm: use SRS and RFE for exception handler

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7045:
URL: https://github.com/apache/incubator-nuttx/pull/7045#discussion_r967087931


##########
arch/arm/src/armv7-a/arm_vectors.S:
##########
@@ -395,18 +386,16 @@ arm_vectorsvc:
 	 * context switch is required.
 	 */
 
-	/* Restore the CPSR, SYS mode registers and return */
-
-	ldr		r1, [r0, #(4*REG_CPSR)]		/* Fetch the return SPSR */
-	msr		spsr_cxsf, r1			/* Set the return mode SPSR */
-
 	/* Life is simple when everything is SVC mode */
 
 	mov		r14, r0				/* (SVC) r14=Register storage area */
 	ldmia		r14!, {r0-r12}			/* Restore common r0-r12 */
 	ldmia		r14, {r13, r14}^		/* Restore user mode r13/r14 */
-	add		r14, r14, #(4*2)		/* (SVC) r14=address of r15 storage */
-	ldmia		r14, {r15}^			/* Return */
+
+	/* Restore the CPSR, SYS mode registers and return. */
+
+	add		r14, r14, #(4*(REG_R15-REG_SP))

Review Comment:
   ```suggestion
   	add		r14, r14, #(4*(REG_R15-REG_R13))
   ```



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


[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #7045: arch/arm: use SRS and RFE for exception handler

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #7045:
URL: https://github.com/apache/incubator-nuttx/pull/7045#issuecomment-1242517220

   > `arch/arm: use SRS and RFE for exception handler`
   
   @zyfeier 
   I think we should replace `arch/arm` with `armv7-a/r` in the commit log.
   
   


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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #7045: arch/arm: use SRS and RFE for exception handler

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #7045:
URL: https://github.com/apache/incubator-nuttx/pull/7045#discussion_r967012185


##########
arch/arm/include/armv7-r/irq.h:
##########
@@ -66,8 +66,8 @@
 #define REG_R12             (12)
 #define REG_R13             (13)
 #define REG_R14             (14)
-#define REG_R15             (15)
-#define REG_CPSR            (16)
+#define REG_R15             (XCPTCONTEXT_REGS - 2)
+#define REG_CPSR            (XCPTCONTEXT_REGS - 1)

Review Comment:
   ditto



##########
arch/arm/include/armv7-a/irq.h:
##########
@@ -66,8 +66,8 @@
 #define REG_R12             (12)
 #define REG_R13             (13)
 #define REG_R14             (14)
-#define REG_R15             (15)
-#define REG_CPSR            (16)
+#define REG_R15             (XCPTCONTEXT_REGS - 2)

Review Comment:
   move REG_R15 and REG_CPSR after line 165 and change ARM_CONTEXT_REGS to 15



##########
arch/arm/src/armv7-a/arm_vectors.S:
##########
@@ -265,18 +262,16 @@ arm_vectorirq:
 	 * context switch is required.
 	 */
 
-	/* Restore the CPSR, IRQ mode registers and return */
-
-	ldr		r1, [r0, #(4*REG_CPSR)]		/* Fetch the return SPSR */
-	msr		spsr_cxsf, r1			/* Set the return mode SPSR */
-
 	/* Life is simple when everything is IRQ mode */
 
 	mov		r14, r0				/* (IRQ) r14=Register storage area */
 	ldmia		r14!, {r0-r12}			/* Restore common r0-r12 */
 	ldmia		r14, {r13, r14}^		/* Restore user mode r13/r14 */
-	add		r14, r14, #(4*2)		/* (IRQ) r14=address of r15 storage */
-	ldmia		r14, {r15}^			/* Return */
+
+	/* Restore the CPSR, SYS mode registers and return. */
+
+	add		r14, r14, #(4*(REG_R15-REG_SP))

Review Comment:
   ```suggestion
   	add		r14, r14, #(4*(REG_R15-REG_R13))
   ```



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


[GitHub] [incubator-nuttx] masayuki2009 merged pull request #7045: armv7-a/r: use SRS and RFE for exception handler

Posted by GitBox <gi...@apache.org>.
masayuki2009 merged PR #7045:
URL: https://github.com/apache/incubator-nuttx/pull/7045


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