summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/hvconsole.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-08-07 02:01:49 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-14 15:33:38 +1000
commita02f6dfc954ed2308a2809e37c2f262d52b82a2b (patch)
tree3456ca000bd299c09e5211cf832129002fe449a7 /arch/powerpc/platforms/pseries/hvconsole.c
parent0654de1cd744a86e19e0a5afb75e3c23571093e6 (diff)
downloadop-kernel-dev-a02f6dfc954ed2308a2809e37c2f262d52b82a2b.zip
op-kernel-dev-a02f6dfc954ed2308a2809e37c2f262d52b82a2b.tar.gz
powerpc/pseries: Fix endian issues in H_GET_TERM_CHAR/H_PUT_TERM_CHAR
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/hvconsole.c')
-rw-r--r--arch/powerpc/platforms/pseries/hvconsole.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/pseries/hvconsole.c b/arch/powerpc/platforms/pseries/hvconsole.c
index aa0aa37..ef6d59a 100644
--- a/arch/powerpc/platforms/pseries/hvconsole.c
+++ b/arch/powerpc/platforms/pseries/hvconsole.c
@@ -45,8 +45,8 @@ int hvc_get_chars(uint32_t vtermno, char *buf, int count)
unsigned long *lbuf = (unsigned long *)buf;
ret = plpar_hcall(H_GET_TERM_CHAR, retbuf, vtermno);
- lbuf[0] = retbuf[1];
- lbuf[1] = retbuf[2];
+ lbuf[0] = be64_to_cpu(retbuf[1]);
+ lbuf[1] = be64_to_cpu(retbuf[2]);
if (ret == H_SUCCESS)
return retbuf[0];
@@ -75,8 +75,9 @@ int hvc_put_chars(uint32_t vtermno, const char *buf, int count)
if (count > MAX_VIO_PUT_CHARS)
count = MAX_VIO_PUT_CHARS;
- ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count, lbuf[0],
- lbuf[1]);
+ ret = plpar_hcall_norets(H_PUT_TERM_CHAR, vtermno, count,
+ cpu_to_be64(lbuf[0]),
+ cpu_to_be64(lbuf[1]));
if (ret == H_SUCCESS)
return count;
if (ret == H_BUSY)
OpenPOWER on IntegriCloud