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/29 00:14:33 UTC

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

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



##########
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:
       @zhuyanlinzyl @xiaoxiang781216 
   I agree to remove r4 and reuse some register (perhaps r1?).
   By the way, I think ```add r4, r3, r0, lsr #3``` means ```r4 = r3 + (r0 >> 3)```.
   I thought it would be ```and r4, r3, r0, lsr #3  (i.e. r4 = r3 & (r0 >> 3)```
   




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