Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sparc64: don't treat 64-bit syscall return codes as 32-bit

When checking a system call return code for an error,
linux_sparc_syscall was sign-extending the lower 32-bit value and
comparing it to -ERESTART_RESTARTBLOCK. lseek can return valid return
codes whose lower 32-bits alone would indicate a failure (such as 4G-1).
Use the whole 64-bit value to check for errors. Only the 32-bit path
should sign extend the lower 32-bit value.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Acked-by: Bob Picco <bob.picco@oracle.com>
Acked-by: Allen Pais <allen.pais@oracle.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Dave Kleikamp and committed by
David S. Miller
1535bd8a e58e241c

+2 -2
+2 -2
arch/sparc/kernel/syscalls.S
··· 189 189 mov %i0, %l5 ! IEU1 190 190 5: call %l7 ! CTI Group brk forced 191 191 srl %i5, 0, %o5 ! IEU1 192 - ba,a,pt %xcc, 3f 192 + ba,pt %xcc, 3f 193 + sra %o0, 0, %o0 193 194 194 195 /* Linux native system calls enter here... */ 195 196 .align 32 ··· 218 217 3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] 219 218 ret_sys_call: 220 219 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 221 - sra %o0, 0, %o0 222 220 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 223 221 sllx %g2, 32, %g2 224 222