From 2e3a9d32ca23e52b764d71bc82bd4dc9fed08342 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Tue, 31 Mar 2015 15:47:01 +0800 Subject: external/opal-prd: Use link register for cross-endian branch With the change to the official switch_endian system call, we lost preservation of the counter across the system call. This change uses the LR instead. It's preserved across the system call, and is going to be overwritten by the branch-and-link instruction anyway. Signed-off-by: Jeremy Kerr Signed-off-by: Stewart Smith --- external/opal-prd/thunk.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/external/opal-prd/thunk.S b/external/opal-prd/thunk.S index 773df26..ab1e737 100644 --- a/external/opal-prd/thunk.S +++ b/external/opal-prd/thunk.S @@ -47,15 +47,15 @@ call_be: ld %r2,8(%r11) #endif - mtctr %r0 + mtlr %r0 #if __BYTE_ORDER == __LITTLE_ENDIAN /* Switch to the "other endian" */ li %r0,__NR_switch_endian sc - /* Branch to CTR */ - .long 0x2104804e /* (byteswapped bctrl) */ + /* Branch to LR */ + .long 0x2100804e /* (byteswapped blrl) */ /* Switch endian back */ .long 0x00000038 | le_si16(__NR_switch_endian) -- cgit v1.1