From b82ba2f011fc4628ceece07412846d0b4d50cac2 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Tue, 5 Feb 2013 14:41:32 +0000 Subject: MIPS: Respect the legacy syscall restart convention. That convention requires the instruction immediately preceding SYSCALL to initialize $v0 with the syscall number. Then if a restart triggers, $v0 will have been clobbered by the syscall interrupted, and needs to be reinititalized. The kernel will decrement the PC by 4 before switching back to the user mode so that $v0 has been reloaded before SYSCALL is executed again. This implies the place $v0 is loaded from must be preserved across a syscall, e.g. an immediate, static register, stack slot, etc. The restriction was lifted with Linux 2.6.36 kernel release and no special requirements are placed around the SYSCALL instruction anymore, however we still support older kernel binaries. --- ports/ChangeLog.mips | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'ports/ChangeLog.mips') diff --git a/ports/ChangeLog.mips b/ports/ChangeLog.mips index 65d420673f..c5a2cb9da2 100644 --- a/ports/ChangeLog.mips +++ b/ports/ChangeLog.mips @@ -1,3 +1,37 @@ +2013-02-05 Maciej W. Rozycki + + [BZ #15054] + * sysdeps/unix/sysv/linux/mips/mips32/sysdep.h (MOVE32): + New macro. + (INTERNAL_SYSCALL_NCS): Use it. Rewrite to respect the syscall + restart convention. + (INTERNAL_SYSCALL): Rewrite to respect the syscall restart + convention. + (internal_syscall0, internal_syscall1): Likewise. + (internal_syscall2, internal_syscall3): Likewise. + (internal_syscall4, internal_syscall5): Likewise. + (internal_syscall6, internal_syscall7): Likewise. + * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (MOVE32): + New macro. + (INTERNAL_SYSCALL_NCS): Use it. Rewrite to respect the syscall + restart convention. + (INTERNAL_SYSCALL): Rewrite to respect the syscall restart + convention. + (internal_syscall0, internal_syscall1): Likewise. + (internal_syscall2, internal_syscall3): Likewise. + (internal_syscall4, internal_syscall5): Likewise. + (internal_syscall6): Likewise. + * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (MOVE32): + New macro. + (INTERNAL_SYSCALL_NCS): Use it. Rewrite to respect the syscall + restart convention. + (INTERNAL_SYSCALL): Rewrite to respect the syscall restart + convention. + (internal_syscall0, internal_syscall1): Likewise. + (internal_syscall2, internal_syscall3): Likewise. + (internal_syscall4, internal_syscall5): Likewise. + (internal_syscall6): Likewise. + 2013-02-04 Joseph Myers [BZ #13550] -- cgit 1.4.1