> On Sun, Sep 12, 1999 at 08:16:29PM -0400, Horst von Brand wrote:
> > BTW, the function definition itself bothers me a lot: it is called
> > strnlen_user; but doesn't return the string's length, but its size; or some
> > weird values that signal various errors. I'd clean it up to return a string
> > length (I can see the unending patches "fixing" the uses assuming it
> > returns a proper length...), -EFAULT for bad addresses, or -E2BIG (?) for
> > strings that are too long.
>
> Meanwhile, this patch would make all versions of gcc happy.
>
> Ivan.
>
> --- linux-2.2.13ac7/arch/i386/lib/usercopy.c Mon Sep 13 14:10:43 1999
> +++ linux/arch/i386/lib/usercopy.c Mon Sep 13 14:12:13 1999
> @@ -123,7 +123,7 @@
> long strnlen_user(const char *s, long n)
> {
> unsigned long mask = -__addr_ok(s);
> - unsigned long res;
> + unsigned long res, tmp;
>
> __asm__ __volatile__(
> " andl %0,%%ecx\n"
> @@ -140,8 +140,8 @@
> " .align 4\n"
> " .long 0b,2b\n"
> ".previous"
> - :"=r" (n), "=D" (s), "=a" (res)
> + :"=r" (n), "=D" (s), "=a" (res), "=c" (tmp)
> :"0" (n), "1" (s), "2" (0), "c" (mask)
> - :"cx", "cc");
> + :"cc");
> return res & mask;
> }
Unfortunately enough, it's not the only illegal assembler construct... The
kernel itself does build, but modules fail...
=== Cut ===
refclock.c: In function `hfmodem_refclock_current':
refclock.c:136: Invalid `asm' statement:
refclock.c:136: fixed or forbidden register 0 (ax) was spilled for class
AREG.
refclock.c:137: Invalid `asm' statement:
refclock.c:137: fixed or forbidden register 0 (ax) was spilled for class
AREG.
make[3]: *** [refclock.o] Error 1
=== Cut ===
===========================================================================
Sergey Kubushin aka the Tamer < > The impossible we do immediately.
e-mail: ksi@ksi-linux.com SK320-RIPE < > Miracles require 24-hour notice.
===========================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/