Re: 2.6.6-rc3: modular DVB tda1004x broken

From: Paul Mackerras
Date: Sat May 01 2004 - 20:18:22 EST


Andrew Morton writes:

> diff -puN include/asm-ppc64/unistd.h~kernel-syscalls-retval-fix include/asm-ppc64/unistd.h
> --- 25/include/asm-ppc64/unistd.h~kernel-syscalls-retval-fix 2004-05-01 17:06:01.187628160 -0700
> +++ 25-akpm/include/asm-ppc64/unistd.h 2004-05-01 17:21:43.897314504 -0700
> @@ -286,6 +286,17 @@
>
> #ifndef __ASSEMBLY__
>
> +#ifdef __KERNEL__
> +#define __syscall_return /* */

For ppc and ppc64 a syscall that returns an error puts the positive
error number in r3 and sets the SO bit in CR0. So if we are expecting
the negative error number as the return value for syscalls in the
kernel we will need this instead:

#define __syscall_return \
if (__sc_err & 0x10000000) \
__sc_ret = - __sc_ret;

for the #ifdef __KERNEL__ case for both ppc and ppc64.

Thanks,
Paul.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/