[PATCH 14/20] powerpc/xmon: Convert read/write_spr() to use start_bus_error_jump()

Michael Ellerman michael at ellerman.id.au
Wed Oct 10 01:20:41 EST 2012


read_spr() and write_spr() were both forgetting to clear catch_memory_errors,
that's fixed now that they use start/end_bus_error_jump().

Also drop the setting of n in both routines, it's never used.

Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---
 arch/powerpc/xmon/xmon.c |   22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index ddae5cf..a8188f0 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1599,16 +1599,9 @@ read_spr(int n)
 	store_inst(instrs);
 	store_inst(instrs+1);
 
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
-
+	if (start_bus_error_jump() == 0) {
 		ret = code();
-
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
-		n = size;
+		end_bus_error_jump();
 	}
 
 	return ret;
@@ -1635,16 +1628,9 @@ write_spr(int n, unsigned long val)
 	store_inst(instrs);
 	store_inst(instrs+1);
 
-	if (setjmp(bus_error_jmp) == 0) {
-		catch_memory_errors = 1;
-		sync();
-
+	if (start_bus_error_jump() == 0) {
 		code(val);
-
-		sync();
-		/* wait a little while to see if we get a machine check */
-		__delay(200);
-		n = size;
+		end_bus_error_jump();
 	}
 }
 
-- 
1.7.9.5



More information about the Linuxppc-dev mailing list