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/28 10:07:41 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a change in pull request #5367: armv7-r/a: bugfix: save and restore a4 register in xxx_dcache_all.S

xiaoxiang781216 commented on a change in pull request #5367:
URL: https://github.com/apache/incubator-nuttx/pull/5367#discussion_r794364612



##########
File path: arch/arm/src/armv7-a/cp15_clean_dcache_all.S
##########
@@ -91,12 +91,16 @@
 
 cp15_flush_dcache_all:
 
+	push		{r4}
+
 	mrc		CP15_CCSIDR(r0)			/* Read the Cache Size Identification Register */
+	mov		r4, r0
+
 	ldr		r3, =0x7fff			/* Isolate the NumSets field (bits 13-27) */
 	and		r0, r3, r0, lsr #13		/* r0=NumSets (number of sets - 1) */
 
 	ldr		r3, =0x3ff			/* Isolate the way field (bits 3-12) */
-	add		r4, r3, r0, lsr #3		/* r4=(number of ways - 1) */
+	add		r4, r3, r4, lsr #3		/* r4=(number of ways - 1) */

Review comment:
       let's reuse r3 to avoid push/pop r4?




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