lkml.org 
[lkml]   [1999]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] invalid asm in strnlen_user() (2.3.18ac, 2.2.13pre & gcc 2.95)
Hi, Alan!

This fixes compilation failure with gcc >= 2.95 on i386.
Diff is against 2.3.18ac, but could be applied to 2.2.13pre
as well.
[Bonus for gcc 2.7.2: it generates more compact code (3 insns less :-)]

Ivan.

--- 2.3.18ac5/arch/i386/lib/usercopy.c Tue Sep 14 21:06:53 1999
+++ linux/arch/i386/lib/usercopy.c Thu Sep 16 12:30:46 1999
@@ -155,7 +155,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"
@@ -172,8 +172,8 @@
" .align 4\n"
" .long 0b,2b\n"
".previous"
- :"=r" (n), "=D" (s), "=a" (res)
- :"0" (n), "1" (s), "2" (0), "c" (mask)
- :"cx", "cc");
+ :"=r" (n), "=D" (s), "=a" (res), "=c" (tmp)
+ :"0" (n), "1" (s), "2" (0), "3" (mask)
+ :"cc");
return res & mask;
}
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.024 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site