This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 81dc3394158 arch/arm: fix infinite loop in test and clean cache 
operations
81dc3394158 is described below

commit 81dc33941586c348f29128a4c501d756a9c88ddc
Author: Lwazi Dube <[email protected]>
AuthorDate: Mon May 18 23:53:12 2026 -0400

    arch/arm: fix infinite loop in test and clean cache operations
    
    Update the destination register to r15 (PC) for test and clean
    operations, as specified by the ARM926EJ-S Technical Reference
    Manual (TRM). Using the wrong destination register prevented the
    loop condition from updating correctly, resulting in an infinite
    loop.
    
    Signed-off-by: Lwazi Dube <[email protected]>
---
 arch/arm/src/arm/arm_cache.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/src/arm/arm_cache.S b/arch/arm/src/arm/arm_cache.S
index a186f94354c..a5d9dc64811 100644
--- a/arch/arm/src/arm/arm_cache.S
+++ b/arch/arm/src/arm/arm_cache.S
@@ -199,7 +199,7 @@ up_clean_dcache:
        .type   up_clean_dcache_all, function
 
 up_clean_dcache_all:
-       mrc             p15, 0, r0, c7, c10, 3
+       mrc             p15, 0, r15, c7, c10, 3
        bne             up_clean_dcache_all
        bx              lr
        .size   up_clean_dcache_all, . - up_clean_dcache_all
@@ -227,7 +227,7 @@ up_flush_dcache:
        .type   up_flush_dcache_all, function
 
 up_flush_dcache_all:
-       mrc             p15, 0, r0, c7, c14, 3
+       mrc             p15, 0, r15, c7, c14, 3
        bne             up_flush_dcache_all
        bx              lr
        .size   up_flush_dcache_all, . - up_flush_dcache_all

Reply via email to