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

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 3464f41fc boot/startup: Fix .bss and .data initialization
3464f41fc is described below

commit 3464f41fc5fabd263366cb988e6091624a2cc037
Author: Jerzy Kasenberg <jerzy.kasenb...@codecoup.pl>
AuthorDate: Tue Mar 5 11:30:24 2024 +0100

    boot/startup: Fix .bss and .data initialization
    
    Wrong condition was used for bss clearing loop and
    for .data copying loop.
    
    First 4 bytes of each region was not copied/zeroed.
    
    Now condition is >= instead of >
    
    Signed-off-by: Jerzy Kasenberg <jerzy.kasenb...@codecoup.pl>
---
 boot/startup/src/arch/cortex_m33/cortex_m33_startup.s | 14 +++++++-------
 boot/startup/src/arch/cortex_m4/cortex_m4_startup.s   | 14 +++++++-------
 boot/startup/src/arch/cortex_m7/cortex_m7_startup.s   | 14 +++++++-------
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/boot/startup/src/arch/cortex_m33/cortex_m33_startup.s 
b/boot/startup/src/arch/cortex_m33/cortex_m33_startup.s
index 122dcb91e..471927f42 100644
--- a/boot/startup/src/arch/cortex_m33/cortex_m33_startup.s
+++ b/boot/startup/src/arch/cortex_m33/cortex_m33_startup.s
@@ -43,10 +43,10 @@ Reset_Handler:
 
 .L_copy_loop:
     subs    r2, #4
-    ittt    gt
-    ldrgt   r0, [r1, r2]
-    strgt   r0, [r3, r2]
-    bgt        .L_copy_loop
+    ittt    ge
+    ldrge   r0, [r1, r2]
+    strge   r0, [r3, r2]
+    bge        .L_copy_loop
 
     b   .L_for_each_copy_region
 
@@ -63,9 +63,9 @@ Reset_Handler:
 
 .L_zero_loop:
     subs    r2, #4
-    itt     gt
-    strgt   r0, [r1, r2]
-    bgt     .L_zero_loop
+    itt     ge
+    strge   r0, [r1, r2]
+    bge     .L_zero_loop
 
     b       .L_for_each_zero_region
 .L_zero_table_done:
diff --git a/boot/startup/src/arch/cortex_m4/cortex_m4_startup.s 
b/boot/startup/src/arch/cortex_m4/cortex_m4_startup.s
index 9706fdcfb..03f77f779 100644
--- a/boot/startup/src/arch/cortex_m4/cortex_m4_startup.s
+++ b/boot/startup/src/arch/cortex_m4/cortex_m4_startup.s
@@ -40,10 +40,10 @@ Reset_Handler:
 
 .L_copy_loop:
     subs    r2, #4
-    ittt    gt
-    ldrgt   r0, [r1, r2]
-    strgt   r0, [r3, r2]
-    bgt        .L_copy_loop
+    ittt    ge
+    ldrge   r0, [r1, r2]
+    strge   r0, [r3, r2]
+    bge        .L_copy_loop
 
     b   .L_for_each_copy_region
 
@@ -60,9 +60,9 @@ Reset_Handler:
 
 .L_zero_loop:
     subs    r2, #4
-    itt     gt
-    strgt   r0, [r1, r2]
-    bgt     .L_zero_loop
+    itt     ge
+    strge   r0, [r1, r2]
+    bge     .L_zero_loop
 
     b       .L_for_each_zero_region
 .L_zero_table_done:
diff --git a/boot/startup/src/arch/cortex_m7/cortex_m7_startup.s 
b/boot/startup/src/arch/cortex_m7/cortex_m7_startup.s
index 9706fdcfb..03f77f779 100644
--- a/boot/startup/src/arch/cortex_m7/cortex_m7_startup.s
+++ b/boot/startup/src/arch/cortex_m7/cortex_m7_startup.s
@@ -40,10 +40,10 @@ Reset_Handler:
 
 .L_copy_loop:
     subs    r2, #4
-    ittt    gt
-    ldrgt   r0, [r1, r2]
-    strgt   r0, [r3, r2]
-    bgt        .L_copy_loop
+    ittt    ge
+    ldrge   r0, [r1, r2]
+    strge   r0, [r3, r2]
+    bge        .L_copy_loop
 
     b   .L_for_each_copy_region
 
@@ -60,9 +60,9 @@ Reset_Handler:
 
 .L_zero_loop:
     subs    r2, #4
-    itt     gt
-    strgt   r0, [r1, r2]
-    bgt     .L_zero_loop
+    itt     ge
+    strge   r0, [r1, r2]
+    bge     .L_zero_loop
 
     b       .L_for_each_zero_region
 .L_zero_table_done:

Reply via email to