[coreboot-gerrit] Patch set updated for coreboot: e421389 ARM: Don't leave alignment checking on after the exception test.

Gabe Black (gabeblack@chromium.org) gerrit at coreboot.org
Wed Jul 10 11:35:52 CEST 2013


Gabe Black (gabeblack at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3690

-gerrit

commit e421389075afa5f202c74a49d2834f67288c8c5a
Author: Gabe Black <gabeblack at google.com>
Date:   Wed Jun 19 20:15:57 2013 -0700

    ARM: Don't leave alignment checking on after the exception test.
    
    Currently, the exception handling code on ARM turns on alignment checks as an
    easy way to generate an exception for testing purposes. It was leaving it on
    which disabled unaligned accesses for other, unlreated code running later.
    This change adjusts the code so the original value of the alignment bit is
    restored after the test exception.
    
    Change-Id: Id8d035a05175f9fb13de547ab4aa5496d681d30c
    Signed-off-by: Gabe Black <gabeblack at chromium.org>
---
 src/arch/armv7/exception.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/arch/armv7/exception.c b/src/arch/armv7/exception.c
index 14f8216..1055cb5 100644
--- a/src/arch/armv7/exception.c
+++ b/src/arch/armv7/exception.c
@@ -143,9 +143,8 @@ void exception_init(void)
 	sctlr &= ~sctlr_te;
 	/* Set V=0 in SCTLR so VBAR points to the exception vector table. */
 	sctlr &= ~sctlr_v;
-	/* Enforce alignment. */
-	sctlr |= sctlr_a;
-	set_sctlr(sctlr);
+	/* Enforce alignment temporarily. */
+	set_sctlr(sctlr | sctlr_a);
 
 	extern uint32_t exception_table[];
 	set_vbar((uintptr_t)exception_table);
@@ -155,4 +154,7 @@ void exception_init(void)
 	exception_test();
 	test_abort = 0;
 	printk(BIOS_ERR, "Testing exceptions: DONE\n");
+
+	/* Restore original alignment settings. */
+	set_sctlr(sctlr);
 }



More information about the coreboot-gerrit mailing list