[coreboot-gerrit] New patch to review for coreboot: riscv and power8: Convert printk/while(1) to die

Jonathan Neuschäfer (j.neuschaefer@gmx.net) gerrit at coreboot.org
Tue Oct 11 18:45:20 CEST 2016


Jonathan Neuschäfer (j.neuschaefer at gmx.net) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16984

-gerrit

commit bc199584ca671c38bf9c574f6a33572b684b5788
Author: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
Date:   Tue Oct 11 18:28:26 2016 +0200

    riscv and power8: Convert printk/while(1) to die
    
    Change-Id: I277cc9ae22cd33f2cd9ded808960349d09e8670d
    Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
---
 src/arch/riscv/trap_handler.c                   | 6 ++----
 src/mainboard/emulation/qemu-power8/mainboard.c | 4 +---
 src/mainboard/emulation/qemu-riscv/mainboard.c  | 3 +--
 src/mainboard/emulation/spike-riscv/mainboard.c | 3 +--
 4 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/arch/riscv/trap_handler.c b/src/arch/riscv/trap_handler.c
index 3d3c7de..59aa221 100644
--- a/src/arch/riscv/trap_handler.c
+++ b/src/arch/riscv/trap_handler.c
@@ -193,8 +193,7 @@ void handle_misaligned_load(trapframe *tf) {
 		tf->gpr[destRegister] = value;
 	} else {
 		// panic, this should not have happened
-		printk(BIOS_DEBUG, "Code should not reach this path, misaligned on a non-64 bit store/load\n");
-		while(1);
+		die("Code should not reach this path, misaligned on a non-64 bit store/load\n");
 	}
 
 	// return to where we came from
@@ -223,8 +222,7 @@ void handle_misaligned_store(trapframe *tf) {
 		}
 	} else {
 		// panic, this should not have happened
-		printk(BIOS_DEBUG, "Code should not reach this path, misaligned on a non-64 bit store/load\n");
-		while(1);
+		die("Code should not reach this path, misaligned on a non-64 bit store/load\n");
 	}
 
 	// return to where we came from
diff --git a/src/mainboard/emulation/qemu-power8/mainboard.c b/src/mainboard/emulation/qemu-power8/mainboard.c
index 102f54c..6413f29 100644
--- a/src/mainboard/emulation/qemu-power8/mainboard.c
+++ b/src/mainboard/emulation/qemu-power8/mainboard.c
@@ -21,9 +21,7 @@ static void mainboard_enable(device_t dev)
 {
 
 	if (!dev) {
-		printk(BIOS_EMERG, "No dev0; die\n");
-		while (1)
-			;
+		die("No dev0; die\n");
 	}
 
 	// Where does RAM live?
diff --git a/src/mainboard/emulation/qemu-riscv/mainboard.c b/src/mainboard/emulation/qemu-riscv/mainboard.c
index 111e9b1..c53ca7b 100644
--- a/src/mainboard/emulation/qemu-riscv/mainboard.c
+++ b/src/mainboard/emulation/qemu-riscv/mainboard.c
@@ -21,8 +21,7 @@ static void mainboard_enable(device_t dev)
 {
 
 	if (!dev) {
-		printk(BIOS_EMERG, "No dev0; die\n");
-		while (1);
+		die("No dev0; die\n");
 	}
 
 	ram_resource(dev, 0, 2048, 32768);
diff --git a/src/mainboard/emulation/spike-riscv/mainboard.c b/src/mainboard/emulation/spike-riscv/mainboard.c
index df2bdd6..eff95c0 100644
--- a/src/mainboard/emulation/spike-riscv/mainboard.c
+++ b/src/mainboard/emulation/spike-riscv/mainboard.c
@@ -28,8 +28,7 @@ static void mainboard_enable(device_t dev)
 	const size_t ram_size = 1*GiB;
 
 	if (!dev) {
-		printk(BIOS_EMERG, "No dev0; die\n");
-		while (1);
+		die("No dev0; die\n");
 	}
 
 	ram_resource(dev, 0, 0x80000000/KiB, ram_size/KiB);



More information about the coreboot-gerrit mailing list