aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/syscalls.c')
-rw-r--r--arch/powerpc/kernel/syscalls.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index b2702e87db0d..5fa92706444b 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -121,3 +121,20 @@ long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
121 return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low, 121 return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low,
122 (u64)len_high << 32 | len_low, advice); 122 (u64)len_high << 32 | len_low, advice);
123} 123}
124
125long sys_switch_endian(void)
126{
127 struct thread_info *ti;
128
129 current->thread.regs->msr ^= MSR_LE;
130
131 /*
132 * Set TIF_RESTOREALL so that r3 isn't clobbered on return to
133 * userspace. That also has the effect of restoring the non-volatile
134 * GPRs, so we saved them on the way in here.
135 */
136 ti = current_thread_info();
137 ti->flags |= _TIF_RESTOREALL;
138
139 return 0;
140}