Skip to contentSkip to conversation

ppc64/kexec/purgatory Fix RTAS calls in Little Endian mode.

PATCH Superseded Laurent Dufour 1 participant 1 message Jan 13, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ppc64/kexec/purgatory Fix RTAS calls in Little Endian mode.

RTAS is expecting parameters in Big Endian order so we have to byte swap them in LE mode.

In the purgatory RTAS calls are only made for debug output.

---
 purgatory/arch/ppc64/console-ppc64.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
purgatory/arch/ppc64/console-ppc64.c +5 -1
index 78a233b..b80183c 100644
@@ -21,6 +21,9 @@
 
 #include <purgatory.h>
 #include "hvCall.h"
+#include <byteswap.h>
+#include <endian.h>
+#include <asm/byteorder.h>
 
 extern int debug;
 
@@ -36,6 +39,7 @@ void putchar(int c)
 		putchar('\r');
 
 	buff[0] = c;
-	plpar_hcall_norets(H_PUT_TERM_CHAR, 0, 1, lbuf[0], lbuf[1]);
+	plpar_hcall_norets(H_PUT_TERM_CHAR, 0, 1,
+			   __cpu_to_be64(lbuf[0]), __cpu_to_be64(lbuf[1]));
 	return;
 }

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec