[coreboot-gerrit] Patch set updated for coreboot: 7be29ee nyan: Use asm volatile instead of plain asm so it doesn't get optimized out.

Marc Jones (marc.jones@se-eng.com) gerrit at coreboot.org
Tue Nov 11 20:41:23 CET 2014


Marc Jones (marc.jones at se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7396

-gerrit

commit 7be29ee4e34198f3042d8c28611b2ee132d85d6f
Author: Gabe Black <gabeblack at google.com>
Date:   Sat Feb 8 05:01:06 2014 -0800

    nyan: Use asm volatile instead of plain asm so it doesn't get optimized out.
    
    If an asm blob isn't marked as volatile, gcc is free to throw it out if it
    doesn't think it produces any values that are actually used. To prevent that
    from happening, add volatile to some asm blobs in the nyan romstage code.
    
    BUG=None
    TEST=Booted on nyan rev1.
    BRANCH=None
    
    Original-Change-Id: I819e068e738e94ea749fcb72bba2eee080e1dfb1
    Original-Signed-off-by: Gabe Black <gabeblack at google.com>
    Original-Reviewed-on: https://chromium-review.googlesource.com/185610
    Original-Reviewed-by: Julius Werner <jwerner at chromium.org>
    Original-Commit-Queue: Gabe Black <gabeblack at chromium.org>
    Original-Tested-by: Gabe Black <gabeblack at chromium.org>
    (cherry picked from commit 76c09581d6ca4dc6c2f9048f599822939f439d11)
    Signed-off-by: Marc Jones <marc.jones at se-eng.com>
    
    Change-Id: I0b32197abf0ddc5f454f9c2415a65d98c60ca48b
---
 src/mainboard/google/nyan/romstage.c     | 3 ++-
 src/mainboard/google/nyan_big/romstage.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mainboard/google/nyan/romstage.c b/src/mainboard/google/nyan/romstage.c
index d7daea8..c3e87fb 100644
--- a/src/mainboard/google/nyan/romstage.c
+++ b/src/mainboard/google/nyan/romstage.c
@@ -136,6 +136,7 @@ static void __attribute__((noinline)) romstage(void)
 /* Stub to force arm_init_caches to the top, before any stack/memory accesses */
 void main(void)
 {
-	asm ("bl arm_init_caches" ::: "r0","r1","r2","r3","r4","r5","ip");
+	asm volatile ("bl arm_init_caches"
+		      ::: "r0","r1","r2","r3","r4","r5","ip");
 	romstage();
 }
diff --git a/src/mainboard/google/nyan_big/romstage.c b/src/mainboard/google/nyan_big/romstage.c
index 5fd255e..9c887a8 100644
--- a/src/mainboard/google/nyan_big/romstage.c
+++ b/src/mainboard/google/nyan_big/romstage.c
@@ -136,6 +136,7 @@ static void __attribute__((noinline)) romstage(void)
 /* Stub to force arm_init_caches to the top, before any stack/memory accesses */
 void main(void)
 {
-	asm ("bl arm_init_caches" ::: "r0","r1","r2","r3","r4","r5","ip");
+	asm volatile ("bl arm_init_caches"
+		      ::: "r0","r1","r2","r3","r4","r5","ip");
 	romstage();
 }



More information about the coreboot-gerrit mailing list