pkarashchenko commented on a change in pull request #5734: URL: https://github.com/apache/incubator-nuttx/pull/5734#discussion_r825643859
########## File path: arch/arm/src/arm/arm_vectors.S ########## @@ -207,55 +147,34 @@ arm_vectorirq: .type arm_vectorsvc, %function arm_vectorsvc: + /* On entry, we are in SVC mode. We are free to use the IRQ mode r13 Review comment: ```suggestion /* On entry, we are in SVC mode. We are free to use the SVC mode r13 ``` ########## File path: arch/arm/src/arm/arm_vectors.S ########## @@ -207,55 +147,34 @@ arm_vectorirq: .type arm_vectorsvc, %function arm_vectorsvc: + /* On entry, we are in SVC mode. We are free to use the IRQ mode r13 + * and r14. + */ + + mov r13, #(PSR_MODE_SYS | PSR_I_BIT) + msr cpsr_c, r13 /* Switch to SYS mode */ /* Create a context structure. First set aside a stack frame * and store r0-r12 into the frame. */ sub sp, sp, #XCPTCONTEXT_SIZE - stmia sp, {r0-r12} /* Save the SVC mode regs */ + stmia sp, {r0-r12} /* Save the SYS mode regs */ + + mov r0, #(PSR_MODE_SVC | PSR_I_BIT) + msr cpsr_c, r0 /* Switch back IRQ mode */ Review comment: ```suggestion msr cpsr_c, r0 /* Switch back SVC mode */ ``` -- 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