[PATCH] __asm__ changes for newer egcs-19981109, works also with gcc-2.7

Harald Hoyer (Harald.Hoyer@hot.spotline.de)
Fri, 20 Nov 1998 22:00:32 +0100


This is a multi-part message in MIME format.
--------------1A21CE851321749CDCBCCA4C
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi,

because the egcs behavious for __asm__ changed, I patched the kernel a little
bit. The patch attached was made with pre-2.1.129-4, but should apply to newer
and
older kernels as well.

For Linus: Have a look also at the ksyms.c changes, cause they are necessary to
compile modules, if you have no asm/string.h (was used in the development). Also
interesting are the changes from asm to __asm__ __volatile__, where the
nonvolatile version is not wanted.

Please check my changes ... cause it's dangerous to make mistakes.... you may
also fix other places, where egcs moans with the following explained algorithm.

Suppose you have an old __asm__ like in string.h:

#define COMMON(x) \
__asm__("cld\n\t" \
"rep ; stosl" \
x \
: /* no outputs */ \
: "a" (pattern),"c" (count/4),"D" ((long) s) \
: "cx","di","memory")

egcs moans because cx and di are registers that have been used as input. We are
now tricky to let egcs know that the registers are clobbered, by defining them
as outputs. egcs now knows, that the values of the registers have (maybe)
changed. But we declare these ouput variables only in a local block of do {}
while(0) and because the variables are never used, no extra register nor stack
is used for them. OK... are we done? No because no output is used and nothing
is clobbered (except of memory .. but this doesn't disturb even old gcc from
optimizing it away), we must declare it __volatile__. So the original one
changed to:

#define COMMON(x) do {int c; long sr;\
__asm__ __volatile__("cld\n\t" \
"rep ; stosl" \
x \
: "=c" (c),"=D" (sr) \
: "a" (pattern),"c" (count/4),"D" ((long) s) \
: "memory"); }while(0)

We now look at a simple function:

void f(void * s, unsigned long pattern, int count)
{
COMMON("");
COMMON("\n\tstosb");
COMMON("\n\tstosw");
COMMON("\n\tstosw\n\tstosb");
}

Compiling with old gcc -S -m486 -O2 -fomit-frame-pointer results in these
relevant opcodes:

sarl $2,%ebp
movl %ebp,20(%esp)
movl %edx,%eax
movl %ebp,%ecx
movl %ebx,%edi
#APP
cld
rep ; stosl
#NO_APP
movl %edx,%eax
movl 20(%esp),%ecx
movl %ebx,%edi
#APP
cld
rep ; stosl
stosb
#NO_APP
movl %edx,%eax
movl 20(%esp),%ecx
movl %ebx,%edi
#APP
cld
rep ; stosl
stosw
#NO_APP
movl %edx,%eax
movl 20(%esp),%ecx
movl %ebx,%edi
#APP
cld
rep ; stosl
stosw
stosb
#NO_APP

Compiling with new egcs -S -m486 -O2 -fomit-frame-pointer results in a reduced
version, cause %eax was unecessary reloaded every time by the old gcc:

sarl $2,%edx
movl %edx,16(%esp)
movl %edx,%ecx
movl %ebp,%edi
#APP
cld
rep ; stosl
#NO_APP
movl 16(%esp),%ecx
movl %ebp,%edi
#APP
cld
rep ; stosl
stosb
#NO_APP
movl 16(%esp),%ecx
movl %ebp,%edi
#APP
cld
rep ; stosl
stosw
#NO_APP
movl 16(%esp),%ecx
movl %ebp,%edi
#APP
cld
rep ; stosl
stosw
stosb
#NO_APP
popl %ebx
popl %esi
popl %edi
popl %ebp
popl %ecx
ret

OK ... now go and fix the (hopefully only few or not existing) bugs I produced
by changing the %1, %2, %3 ....
Maybe Linus is willing to put these changes in 2.1, so we can delete our (only
for the kernel used) gcc-2.7.3.

Yours,
Harald

--
»»»» Harald Hoyer ««»» mailto:HarryH@Royal.Net ««»» http://hot.spotline.de ««««
···············································································
Today's fortune: With your bare hands?!?
--------------1A21CE851321749CDCBCCA4C
Content-Type: text/plain; charset=us-ascii; name="egcs.asm_patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="egcs.asm_patch"

diff -x Entries -x Tag -p -u --recursive linux/arch/i386/kernel/apm.c /usr/src/linux/arch/i386/kernel/apm.c --- linux/arch/i386/kernel/apm.c Fri Oct 9 11:56:01 1998 +++ /usr/src/linux/arch/i386/kernel/apm.c Thu Nov 19 11:49:50 1998 @@ -410,7 +410,7 @@ static inline u8 apm_bios_call(u32 eax_i : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx), "=S" (*esi) : "a" (eax_in), "b" (ebx_in), "c" (ecx_in) - : "ax", "bx", "cx", "dx", "si", "di", "bp", "memory", "cc"); + : "di", "bp", "memory", "cc"); APM_DO_RESTORE_SEGS; __restore_flags(flags); return *eax & 0xff; @@ -437,7 +437,7 @@ static inline u8 apm_bios_call_simple(u3 APM_DO_POP_SEGS : "=a" (*eax), "=b" (error) : "a" (eax_in), "b" (ebx_in), "c" (ecx_in) - : "ax", "bx", "cx", "dx", "si", "di", "bp", "memory", "cc"); + : "dx", "si", "di", "bp", "memory", "cc"); APM_DO_RESTORE_SEGS; __restore_flags(flags); return error; diff -x Entries -x Tag -p -u --recursive linux/arch/i386/kernel/time.c /usr/src/linux/arch/i386/kernel/time.c --- linux/arch/i386/kernel/time.c Thu Nov 19 11:25:56 1998 +++ /usr/src/linux/arch/i386/kernel/time.c Thu Nov 19 12:41:15 1998 @@ -410,7 +410,7 @@ static void pentium_timer_interrupt(int __cli(); /* read Pentium cycle counter */ __asm__("rdtsc" - :"=a" (last_tsc_low):: "eax", "edx"); + :"=a" (last_tsc_low):: "edx"); outb_p(0x00, 0x43); /* latch the count ASAP */ diff -x Entries -x Tag -p -u --recursive linux/arch/i386/kernel/traps.c /usr/src/linux/arch/i386/kernel/traps.c --- linux/arch/i386/kernel/traps.c Thu Nov 19 11:19:59 1998 +++ /usr/src/linux/arch/i386/kernel/traps.c Thu Nov 19 12:52:13 1998 @@ -498,16 +498,17 @@ __initfunc(void trap_init_f00f_bug(void) __asm__ __volatile__("lidt %0": "=m" (idt_descr)); } -#define _set_gate(gate_addr,type,dpl,addr) \ +#define _set_gate(gate_addr,type,dpl,addr) do { \ + unsigned int _ar; \ __asm__ __volatile__ ("movw %%dx,%%ax\n\t" \ - "movw %2,%%dx\n\t" \ + "movw %4,%%dx\n\t" \ "movl %%eax,%0\n\t" \ "movl %%edx,%1" \ :"=m" (*((long *) (gate_addr))), \ - "=m" (*(1+(long *) (gate_addr))) \ + "=m" (*(1+(long *) (gate_addr))), \ + "=d" ((char *) (addr)),"=a" (_ar) \ :"i" ((short) (0x8000+(dpl<<13)+(type<<8))), \ - "d" ((char *) (addr)),"a" (__KERNEL_CS << 16) \ - :"ax","dx") + "d" ((char *) (addr)),"a" (__KERNEL_CS << 16)) ; } while(0) /* * This needs to use 'idt_table' rather than 'idt', and diff -x Entries -x Tag -p -u --recursive linux/arch/i386/lib/checksum.c /usr/src/linux/arch/i386/lib/checksum.c --- linux/arch/i386/lib/checksum.c Tue Sep 29 14:45:07 1998 +++ /usr/src/linux/arch/i386/lib/checksum.c Thu Nov 19 13:13:34 1998 @@ -195,9 +195,9 @@ unsigned int csum_partial(const unsigned addl %%ebx,%%eax adcl $0,%%eax 80: " - : "=a"(sum) + : "=a"(sum), "=c"(len), "=S"(buf) : "0"(sum), "c"(len), "S"(buf) - : "bx", "dx", "cx", "si", "memory"); + : "bx", "dx", "memory"); return(sum); } @@ -373,7 +373,7 @@ unsigned int csum_partial_copy_generic ( int len, int sum, int *src_err_ptr, int *dst_err_ptr) { __asm__ __volatile__ (" - movl %4,%%ecx + movl %6,%%ecx movl %%ecx, %%edx movl %%ecx, %%ebx shrl $6, %%ecx @@ -409,25 +409,26 @@ ROUND (-16) ROUND(-12) ROUND(-8) ROUND( adcl $0, %%eax 7: .section .fixup, \"ax\" -6000: movl %7, (%%ebx) +#-EFAULT = -14 +6000: movl $-14, (%%ebx) # zero the complete destination (computing the rest is too much work) - movl %8,%%edi - movl %4,%%ecx + movl %9,%%edi + movl %6,%%ecx xorl %%eax,%%eax rep ; stosb jmp 7b -6001: movl %1, %%ebx +6001: movl %3, %%ebx jmp 6000b -6002: movl %2, %%ebx +6002: movl %4, %%ebx jmp 6000b .previous " - : "=a"(sum) + : "=a"(sum), "=S"(src), "=D" (dst) : "m"(src_err_ptr), "m"(dst_err_ptr), "0"(sum), "m"(len), "S"(src), "D" (dst), - "i" (-EFAULT), +/* "i" (-EFAULT),*/ "m" (dst) - : "bx", "cx", "si", "di", "dx", "memory" ); + : "bx", "cx", "dx", "memory" ); return(sum); } diff -x Entries -x Tag -p -u --recursive linux/arch/i386/lib/delay.c /usr/src/linux/arch/i386/lib/delay.c --- linux/arch/i386/lib/delay.c Fri Oct 9 11:56:08 1998 +++ /usr/src/linux/arch/i386/lib/delay.c Thu Nov 19 11:27:55 1998 @@ -25,17 +25,16 @@ void __delay(unsigned long loops) "1:\tjmp 2f\n" ".align 16\n" "2:\tdecl %0\n\tjns 2b" - :/* no outputs */ - :"a" (loops) - :"ax"); + :"=a" (loops) + :"a" (loops)); } inline void __const_udelay(unsigned long xloops) { + unsigned long a; __asm__("mull %0" - :"=d" (xloops) - :"a" (xloops),"0" (current_cpu_data.loops_per_sec) - :"ax"); + :"=d" (xloops), "=a" (a) + :"a" (xloops),"0" (current_cpu_data.loops_per_sec)); __delay(xloops); } diff -x Entries -x Tag -p -u --recursive linux/arch/i386/lib/usercopy.c /usr/src/linux/arch/i386/lib/usercopy.c --- linux/arch/i386/lib/usercopy.c Mon Aug 31 09:23:21 1998 +++ /usr/src/linux/arch/i386/lib/usercopy.c Thu Nov 19 11:31:54 1998 @@ -28,7 +28,8 @@ __generic_copy_from_user(void *to, const * Copy a null terminated string from userspace. */ -#define __do_strncpy_from_user(dst,src,count,res) \ +#define __do_strncpy_from_user(dst,src,count,res) do { \ + char *s, *d; \ __asm__ __volatile__( \ " testl %1,%1\n" \ " jz 2f\n" \ @@ -41,16 +42,16 @@ __generic_copy_from_user(void *to, const "1: subl %1,%0\n" \ "2:\n" \ ".section .fixup,\"ax\"\n" \ - "3: movl %2,%0\n" \ + "3: movl %4,%0\n" \ " jmp 2b\n" \ ".previous\n" \ ".section __ex_table,\"a\"\n" \ " .align 4\n" \ " .long 0b,3b\n" \ ".previous" \ - : "=d"(res), "=c"(count) \ + : "=d"(res), "=c"(count), "=S"(s), "=D"(d) \ : "i"(-EFAULT), "0"(count), "1"(count), "S"(src), "D"(dst) \ - : "si", "di", "ax", "memory") + : "ax", "memory") ; }while(0) long __strncpy_from_user(char *dst, const char *src, long count) @@ -74,14 +75,15 @@ strncpy_from_user(char *dst, const char * Zero Userspace */ -#define __do_clear_user(addr,size) \ +#define __do_clear_user(addr,size) do { \ + char *d; \ __asm__ __volatile__( \ "0: rep; stosl\n" \ - " movl %1,%0\n" \ + " movl %2,%0\n" \ "1: rep; stosb\n" \ "2:\n" \ ".section .fixup,\"ax\"\n" \ - "3: lea 0(%1,%0,4),%0\n" \ + "3: lea 0(%2,%0,4),%0\n" \ " jmp 2b\n" \ ".previous\n" \ ".section __ex_table,\"a\"\n" \ @@ -89,9 +91,8 @@ strncpy_from_user(char *dst, const char " .long 0b,3b\n" \ " .long 1b,2b\n" \ ".previous" \ - : "=&c"(size) \ - : "r"(size & 3), "0"(size / 4), "D"(addr), "a"(0) \ - : "di") + : "=&c"(size), "=D"(d) \ + : "r"(size & 3), "0"(size / 4), "D"(addr), "a"(0));}while(0) unsigned long clear_user(void *to, unsigned long n) diff -x Entries -x Tag -p -u --recursive linux/arch/i386/mm/init.c /usr/src/linux/arch/i386/mm/init.c --- linux/arch/i386/mm/init.c Tue Sep 29 14:37:53 1998 +++ /usr/src/linux/arch/i386/mm/init.c Thu Nov 19 11:27:18 1998 @@ -119,24 +119,29 @@ int do_check_pgt_cache(int low, int high pte_t * __bad_pagetable(void) { extern char empty_bad_page_table[PAGE_SIZE]; - + char *p = empty_bad_page_table; + int c = (PAGE_SIZE/4); __asm__ __volatile__("cld ; rep ; stosl": + "=D" ((long) p), + "=c" (c) :"a" (pte_val(BAD_PAGE)), - "D" ((long) empty_bad_page_table), - "c" (PAGE_SIZE/4) - :"di","cx"); + "D" ((long) p), + "c" (c)); return (pte_t *) empty_bad_page_table; } pte_t __bad_page(void) { extern char empty_bad_page[PAGE_SIZE]; + char *p = empty_bad_page; + int c = (PAGE_SIZE/4); __asm__ __volatile__("cld ; rep ; stosl": + "=D" ((long) p), + "=c" (c) :"a" (0), - "D" ((long) empty_bad_page), - "c" (PAGE_SIZE/4) - :"di","cx"); + "D" ((long) p), + "c" (c)); return pte_mkdirty(mk_pte((unsigned long) empty_bad_page, PAGE_SHARED)); } diff -x Entries -x Tag -p -u --recursive linux/drivers/scsi/ppa.c /usr/src/linux/drivers/scsi/ppa.c --- linux/drivers/scsi/ppa.c Sat Oct 24 11:31:47 1998 +++ /usr/src/linux/drivers/scsi/ppa.c Thu Nov 19 14:50:38 1998 @@ -379,6 +379,8 @@ static inline void ecp_sync(unsigned sho static inline int ppa_byte_out(unsigned short base, char *buffer, unsigned int len) { + /* scratch ... never used */ + unsigned int _c; /* * %eax scratch * %ebx Data to transfer @@ -389,7 +391,7 @@ static inline int ppa_byte_out(unsigned * In case you are wondering what the last line of the asm does... * <output allocation> : <input allocation> : <trashed registers> */ - asm("shr $2,%%ecx\n" \ + asm __volatile__("shr $2,%%ecx\n" \ " jz .no_more_bulk_bo\n" \ " .align 4\n" \ ".loop_bulk_bo:\n" \ @@ -403,9 +405,9 @@ static inline int ppa_byte_out(unsigned " loop .loop_bulk_bo\n" \ " .align 4\n" \ ".no_more_bulk_bo:" \ - : "=S"(buffer): "c"(len), "d"(base), "S"(buffer):"eax", "ebx", "ecx"); + : "=S"(buffer), "=c"(_c): "c"(len), "d"(base), "S"(buffer):"eax", "ebx"); - asm("andl $3,%%ecx\n" \ + asm __volatile__("andl $3,%%ecx\n" \ " jz .no_more_loose_bo\n" \ " .align 4\n" \ ".loop_loose_bo:\n" \ @@ -413,7 +415,7 @@ static inline int ppa_byte_out(unsigned " incl %%esi\n" \ " loop .loop_loose_bo\n" \ ".no_more_loose_bo:\n" \ - : /* no output */ : "c"(len), "d"(base), "S"(buffer):"eax", "ebx", "ecx"); + : "=c"(_c): "c"(len), "d"(base), "S"(buffer):"eax", "ebx"); return 1; /* All went well - we hope! */ } @@ -429,6 +431,8 @@ static inline int ppa_byte_out(unsigned static inline int ppa_byte_in(unsigned short base, char *buffer, int len) { + /* scratch ... never used */ + unsigned int _c; /* * %eax scratch * %ebx Data to transfer @@ -439,7 +443,7 @@ static inline int ppa_byte_in(unsigned s * In case you are wondering what the last line of the asm does... * <output allocation> : <input allocation> : <trashed registers> */ - asm("shr $2,%%ecx\n" \ + asm __volatile__("shr $2,%%ecx\n" \ " jz .no_more_bulk_bi\n" \ " .align 4\n" \ ".loop_bulk_bi:\n" \ @@ -454,9 +458,9 @@ static inline int ppa_byte_in(unsigned s " loop .loop_bulk_bi\n" \ " .align 4\n" \ ".no_more_bulk_bi:" \ - : "=S"(buffer): "c"(len), "d"(base), "S"(buffer):"eax", "ebx", "ecx"); + : "=S"(buffer), "=c"(_c): "c"(len), "d"(base), "S"(buffer):"eax", "ebx"); - asm("andl $3,%%ecx\n" \ + asm __volatile__("andl $3,%%ecx\n" \ " jz .no_more_loose_bi\n" \ " .align 4\n" \ ".loop_loose_bi:\n" \ @@ -464,7 +468,7 @@ static inline int ppa_byte_in(unsigned s " incl %%esi\n" \ " loop .loop_loose_bi\n" \ ".no_more_loose_bi:\n" \ - : /* no output */ : "c"(len), "d"(base), "S"(buffer):"eax", "ebx", "ecx"); + : "=c"(_c) : "c"(len), "d"(base), "S"(buffer):"eax", "ebx"); return 1; /* All went well - we hope! */ } @@ -486,6 +490,8 @@ static inline int ppa_byte_in(unsigned s static inline int ppa_nibble_in(unsigned short str_p, char *buffer, int len) { + /* scratch ... never used */ + unsigned int _c; /* * %eax scratch * %ebx Data to transfer @@ -496,7 +502,7 @@ static inline int ppa_nibble_in(unsigned * In case you are wondering what the last line of the asm does... * <output allocation> : <input allocation> : <trashed registers> */ - asm("shr $2,%%ecx\n" \ + asm __volatile__("shr $2,%%ecx\n" \ " jz .no_more_bulk_ni\n" \ " .align 4\n" \ ".loop_bulk_ni:\n" \ @@ -511,7 +517,7 @@ static inline int ppa_nibble_in(unsigned " loop .loop_bulk_ni\n" \ " .align 4\n" \ ".no_more_bulk_ni:" \ - : "=S"(buffer): "c"(len), "d"(str_p), "S"(buffer):"eax", "ebx", "ecx"); + : "=S"(buffer), "=c"(_c): "c"(len), "d"(str_p), "S"(buffer):"eax", "ebx"); asm("andl $3,%%ecx\n" \ " jz .no_more_loose_ni\n" \ @@ -521,7 +527,7 @@ static inline int ppa_nibble_in(unsigned " incl %%esi\n" \ " loop .loop_loose_ni\n" \ ".no_more_loose_ni:\n" \ - : /* no output */ : "c"(len), "d"(str_p), "S"(buffer):"eax", "ebx", "ecx"); + : "=c"(_c) : "c"(len), "d"(str_p), "S"(buffer):"eax", "ebx"); return 1; /* All went well - we hope! */ } #else /* Old style C routines */ diff -x Entries -x Tag -p -u --recursive linux/include/asm-i386/bitops.h /usr/src/linux/include/asm-i386/bitops.h --- linux/include/asm-i386/bitops.h Mon Aug 31 08:33:02 1998 +++ /usr/src/linux/include/asm-i386/bitops.h Thu Nov 19 13:46:33 1998 @@ -128,9 +128,10 @@ extern __inline__ int __test_bit(int nr, extern __inline__ int find_first_zero_bit(void * addr, unsigned size) { int res; - if (!size) return 0; + { + unsigned int c = (size + 31) >> 5; __asm__("cld\n\t" "movl $-1,%%eax\n\t" "xorl %%edx,%%edx\n\t" @@ -142,9 +143,10 @@ extern __inline__ int find_first_zero_bi "1:\tsubl %%ebx,%%edi\n\t" "shll $3,%%edi\n\t" "addl %%edi,%%edx" - :"=d" (res) - :"c" ((size + 31) >> 5), "D" (addr), "b" (addr) - :"ax", "cx", "di"); + :"=d" (res), "=c" (c), "=D" (addr) + :"c" (c), "D" (addr), "b" (addr) + :"ax"); + } return res; } diff -x Entries -x Tag -p -u --recursive linux/include/asm-i386/bugs.h /usr/src/linux/include/asm-i386/bugs.h --- linux/include/asm-i386/bugs.h Mon Oct 5 08:56:32 1998 +++ /usr/src/linux/include/asm-i386/bugs.h Fri Nov 20 17:32:49 1998 @@ -141,9 +141,9 @@ __initfunc(static void check_popad(void) printk(KERN_INFO "Checking for popad bug... "); __asm__ __volatile__( "movl $12345678,%%eax; movl $0,%%edi; pusha; popa; movl (%%edx,%%edi),%%ecx " - : "=eax" (res) + : "=eax" (res), "=edx" (inp) : "edx" (inp) - : "eax", "ecx", "edx", "edi" ); + : "ecx", "edi" ); /* If this fails, it means that any user program may lock the CPU hard. Too bad. */ if (res != 12345678) printk( "Buggy.\n" ); else printk( "OK.\n" ); diff -x Entries -x Tag -p -u --recursive linux/include/asm-i386/posix_types.h /usr/src/linux/include/asm-i386/posix_types.h --- linux/include/asm-i386/posix_types.h Mon Jun 8 09:34:04 1998 +++ /usr/src/linux/include/asm-i386/posix_types.h Thu Nov 19 13:55:19 1998 @@ -58,11 +58,14 @@ typedef struct { __result; })) #undef __FD_ZERO -#define __FD_ZERO(fdsetp) \ +#define __FD_ZERO(fdsetp) do { \ + __kernel_fd_set *d = (__kernel_fd_set *) fdsetp; \ + int c = __FDSET_LONGS; \ __asm__ __volatile__("cld ; rep ; stosl" \ - :"=m" (*(__kernel_fd_set *) (fdsetp)) \ - :"a" (0), "c" (__FDSET_LONGS), \ - "D" ((__kernel_fd_set *) (fdsetp)) :"cx","di") + :"=m" (*(__kernel_fd_set *) (fdsetp)) , \ + "=c" (c), "=D" (d) \ + :"a" (0), "c" (c), \ + "D" (d) ) ;} while(0) #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ diff -x Entries -x Tag -p -u --recursive linux/include/asm-i386/string.h /usr/src/linux/include/asm-i386/string.h --- linux/include/asm-i386/string.h Wed Jul 1 09:36:15 1998 +++ /usr/src/linux/include/asm-i386/string.h Fri Nov 20 17:05:30 1998 @@ -30,23 +31,25 @@ #define __HAVE_ARCH_STRCPY extern inline char * strcpy(char * dest,const char *src) { + char * d, *s; __asm__ __volatile__( "cld\n" "1:\tlodsb\n\t" "stosb\n\t" "testb %%al,%%al\n\t" "jne 1b" - : /* no output */ - :"S" (src),"D" (dest):"si","di","ax","memory"); + : "=S" (s),"=D" (d) + :"S" (src),"D" (dest) : "ax","memory"); return dest; } #define __HAVE_ARCH_STRNCPY extern inline char * strncpy(char * dest,const char *src,size_t count) { + char * d, *s; __asm__ __volatile__( "cld\n" - "1:\tdecl %2\n\t" + "1:\tdecl %5\n\t" "js 2f\n\t" "lodsb\n\t" "stosb\n\t" @@ -55,48 +58,55 @@ __asm__ __volatile__( "rep\n\t" "stosb\n" "2:" - : /* no output */ - :"S" (src),"D" (dest),"c" (count):"si","di","ax","cx","memory"); + : "=S" (s),"=D" (d),"=c" (count) + :"S" (src),"D" (dest),"c" (count):"ax","memory"); return dest; } + #define __HAVE_ARCH_STRCAT extern inline char * strcat(char * dest,const char * src) { + unsigned int c = 0xffffffff; + char null = 0; + char * d, *s; __asm__ __volatile__( "cld\n\t" "repne\n\t" "scasb\n\t" - "decl %1\n" + "decl %5\n" "1:\tlodsb\n\t" "stosb\n\t" "testb %%al,%%al\n\t" "jne 1b" - : /* no output */ - :"S" (src),"D" (dest),"a" (0),"c" (0xffffffff):"si","di","ax","cx"); + : "=S" (s),"=D" (d), "=a" (null),"=c" (c) + :"S" (src),"D" (dest),"a" (null),"c" (c)); return dest; } #define __HAVE_ARCH_STRNCAT extern inline char * strncat(char * dest,const char * src,size_t count) { + unsigned int c = 0xffffffff; + int a = 0; + char * d, *s; __asm__ __volatile__( "cld\n\t" "repne\n\t" "scasb\n\t" - "decl %1\n\t" - "movl %4,%3\n" - "1:\tdecl %3\n\t" + "decl %6\n\t" + "movl %9,%8\n" + "1:\tdecl %8\n\t" "js 2f\n\t" "lodsb\n\t" "stosb\n\t" "testb %%al,%%al\n\t" "jne 1b\n" - "2:\txorl %2,%2\n\t" + "2:\txorl %7,%7\n\t" "stosb" - : /* no output */ - :"S" (src),"D" (dest),"a" (0),"c" (0xffffffff),"g" (count) - :"si","di","ax","cx","memory"); + : "=S" (s),"=D" (d),"=a" (a),"=c" (c),"=g" (count) + :"S" (src),"D" (dest),"a" (a),"c" (c),"g" (count) + :"memory"); return dest; } @@ -104,6 +114,7 @@ return dest; extern inline int strcmp(const char * cs,const char * ct) { register int __res; + char * d, *s; __asm__ __volatile__( "cld\n" "1:\tlodsb\n\t" @@ -116,7 +127,8 @@ __asm__ __volatile__( "2:\tsbbl %%eax,%%eax\n\t" "orb $1,%%al\n" "3:" - :"=a" (__res):"S" (cs),"D" (ct):"si","di"); + :"=a" (__res), "=S" (s),"=D" (d) + :"S" (cs),"D" (ct)); return __res; } @@ -124,9 +136,11 @@ return __res; extern inline int strncmp(const char * cs,const char * ct,size_t count) { register int __res; + char * d, *s; + size_t c; __asm__ __volatile__( "cld\n" - "1:\tdecl %3\n\t" + "1:\tdecl %6\n\t" "js 2f\n\t" "lodsb\n\t" "scasb\n\t" @@ -138,13 +152,15 @@ __asm__ __volatile__( "3:\tsbbl %%eax,%%eax\n\t" "orb $1,%%al\n" "4:" - :"=a" (__res):"S" (cs),"D" (ct),"c" (count):"si","di","cx"); + :"=a" (__res), "=S" (s),"=D" (d),"=c" (c) + :"S" (cs),"D" (ct),"c" (count)); return __res; } #define __HAVE_ARCH_STRCHR extern inline char * strchr(const char * s, int c) { + char *sr; register char * __res; __asm__ __volatile__( "cld\n\t" @@ -154,16 +170,18 @@ __asm__ __volatile__( "je 2f\n\t" "testb %%al,%%al\n\t" "jne 1b\n\t" - "movl $1,%1\n" - "2:\tmovl %1,%0\n\t" + "movl $1,%2\n" + "2:\tmovl %2,%0\n\t" "decl %0" - :"=a" (__res):"S" (s),"0" (c):"si"); + :"=a" (__res), "=S" (sr):"S" (s),"0" (c)); return __res; } #define __HAVE_ARCH_STRRCHR extern inline char * strrchr(const char * s, int c) { + char *sr; + int cr; register char * __res; __asm__ __volatile__( "cld\n\t" @@ -174,17 +192,20 @@ __asm__ __volatile__( "leal -1(%%esi),%0\n" "2:\ttestb %%al,%%al\n\t" "jne 1b" - :"=d" (__res):"0" (0),"S" (s),"a" (c):"ax","si"); + :"=d" (__res), "=S" (sr),"=a" (cr) + :"0" (0),"S" (s),"a" (c)); return __res; } #define __HAVE_ARCH_STRSPN extern inline size_t strspn(const char * cs, const char * ct) { + unsigned int c = 0xffffffff; + char null = 0; register char * __res; __asm__ __volatile__( "cld\n\t" - "movl %4,%%edi\n\t" + "movl %6,%%edi\n\t" "repne\n\t" "scasb\n\t" "notl %%ecx\n\t" @@ -193,24 +214,27 @@ __asm__ __volatile__( "1:\tlodsb\n\t" "testb %%al,%%al\n\t" "je 2f\n\t" - "movl %4,%%edi\n\t" + "movl %6,%%edi\n\t" "movl %%edx,%%ecx\n\t" "repne\n\t" "scasb\n\t" "je 1b\n" "2:\tdecl %0" - :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) - :"ax","cx","dx","di"); + :"=S" (__res),"=a" (null),"=c" (c) + :"a" (null),"c" (c),"0" (cs),"g" (ct) + :"dx","di"); return __res-cs; } #define __HAVE_ARCH_STRCSPN extern inline size_t strcspn(const char * cs, const char * ct) { + unsigned int c = 0xffffffff; + char null = 0; register char * __res; __asm__ __volatile__( "cld\n\t" - "movl %4,%%edi\n\t" + "movl %6,%%edi\n\t" "repne\n\t" "scasb\n\t" "notl %%ecx\n\t" @@ -219,24 +243,27 @@ __asm__ __volatile__( "1:\tlodsb\n\t" "testb %%al,%%al\n\t" "je 2f\n\t" - "movl %4,%%edi\n\t" + "movl %6,%%edi\n\t" "movl %%edx,%%ecx\n\t" "repne\n\t" "scasb\n\t" "jne 1b\n" "2:\tdecl %0" - :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) - :"ax","cx","dx","di"); + :"=S" (__res),"=a" (null),"=c" (c) + :"a" (null),"c" (c),"0" (cs),"g" (ct) + :"dx","di"); return __res-cs; } #define __HAVE_ARCH_STRPBRK extern inline char * strpbrk(const char * cs,const char * ct) { + unsigned int c = 0xffffffff; + char null = 0; register char * __res; __asm__ __volatile__( "cld\n\t" - "movl %4,%%edi\n\t" + "movl %6,%%edi\n\t" "repne\n\t" "scasb\n\t" "notl %%ecx\n\t" @@ -245,7 +272,7 @@ __asm__ __volatile__( "1:\tlodsb\n\t" "testb %%al,%%al\n\t" "je 2f\n\t" - "movl %4,%%edi\n\t" + "movl %6,%%edi\n\t" "movl %%edx,%%ecx\n\t" "repne\n\t" "scasb\n\t" @@ -254,8 +281,9 @@ __asm__ __volatile__( "jmp 3f\n" "2:\txorl %0,%0\n" "3:" - :"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct) - :"ax","cx","dx","di"); + :"=S" (__res), "=a" (null),"=c" (c) + :"a" (null),"c" (c),"0" (cs),"g" (ct) + :"dx","di"); return __res; } @@ -263,15 +291,16 @@ return __res; extern inline char * strstr(const char * cs,const char * ct) { register char * __res; + unsigned int c = 0xffffffff; __asm__ __volatile__( "cld\n\t" \ - "movl %4,%%edi\n\t" + "movl %6,%%edi\n\t" "repne\n\t" "scasb\n\t" "notl %%ecx\n\t" "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */ "movl %%ecx,%%edx\n" - "1:\tmovl %4,%%edi\n\t" + "1:\tmovl %6,%%edi\n\t" "movl %%esi,%%eax\n\t" "movl %%edx,%%ecx\n\t" "repe\n\t" @@ -283,8 +312,9 @@ __asm__ __volatile__( "jne 1b\n\t" "xorl %%eax,%%eax\n\t" "2:" - :"=a" (__res):"0" (0),"c" (0xffffffff),"S" (cs),"g" (ct) - :"cx","dx","di","si"); + :"=a" (__res), "=c" (c),"=S" (cs) + :"0" (0),"c" (c),"S" (cs),"g" (ct) + :"dx","di"); return __res; } @@ -298,7 +328,8 @@ __asm__ __volatile__( "scasb\n\t" "notl %0\n\t" "decl %0" - :"=c" (__res):"D" (s),"a" (0),"0" (0xffffffff):"di"); + :"=c" (__res), "=D" (s) + :"D" (s),"a" (0),"0" (0xffffffff)); return __res; } @@ -365,19 +396,21 @@ return __res; extern inline void * __memcpy(void * to, const void * from, size_t n) { + void *d, *s; + size_t c = n/4; __asm__ __volatile__( "cld\n\t" "rep ; movsl\n\t" - "testb $2,%b1\n\t" + "testb $2,%b4\n\t" "je 1f\n\t" "movsw\n" - "1:\ttestb $1,%b1\n\t" + "1:\ttestb $1,%b4\n\t" "je 2f\n\t" "movsb\n" "2:" - : /* no output */ - :"c" (n/4), "q" (n),"D" ((long) to),"S" ((long) from) - : "cx","di","si","memory"); + : "=c" (c),"=D" (d),"=S" (s) + :"c" (c), "q" (n),"D" ((long) to),"S" ((long) from) + : "memory"); return (to); } @@ -430,13 +463,13 @@ extern inline void * __constant_memcpy(v *(4+(unsigned long *)to) = *(4+(const unsigned long *)from); return to; } -#define COMMON(x) \ -__asm__("cld\n\t" \ +#define COMMON(x) do { int c; long d,s;\ +__asm__ __volatile__("cld\n\t" \ "rep ; movsl" \ x \ - : /* no outputs */ \ + : "=c" (c),"=D" (d),"=S" (s) \ : "c" (n/4),"D" ((long) to),"S" ((long) from) \ - : "cx","di","si","memory"); + : "memory"); } while(0) switch (n % 4) { case 0: COMMON(""); return to; @@ -453,29 +486,32 @@ __asm__("cld\n\t" \ __constant_memcpy((t),(f),(n)) : \ __memcpy((t),(f),(n))) + #define __HAVE_ARCH_MEMMOVE extern inline void * memmove(void * dest,const void * src, size_t n) { -if (dest<src) + if (dest<src) { + void *d, *s; __asm__ __volatile__( "cld\n\t" "rep\n\t" "movsb" - : /* no output */ - :"c" (n),"S" (src),"D" (dest) - :"cx","si","di"); -else + : "=c" (n),"=S" (s),"=D" (d) + :"c" (n),"S" (src),"D" (dest)); + } + else { + char *s = n-1+(char *)src; + char *d = n-1+(char *)dest; __asm__ __volatile__( "std\n\t" "rep\n\t" "movsb\n\t" "cld" - : /* no output */ - :"c" (n), - "S" (n-1+(const char *)src), - "D" (n-1+(char *)dest) - :"cx","si","di","memory"); -return dest; + :"=c" (n), "=S" (s), "=D" (d) + :"c" (n), "S" (s), "D" (d) + :"memory"); + } + return dest; } #define memcmp __builtin_memcmp @@ -500,13 +536,14 @@ return __res; extern inline void * __memset_generic(void * s, char c,size_t count) { + void *sr; __asm__ __volatile__( "cld\n\t" "rep\n\t" "stosb" - : /* no output */ + : "=D" (sr),"=c" (count) :"a" (c),"D" (s),"c" (count) - :"cx","di","memory"); + :"memory"); return s; } @@ -520,19 +557,21 @@ return s; */ extern inline void * __constant_c_memset(void * s, unsigned long c, size_t count) { + void *sr; + size_t tc = count/4; __asm__ __volatile__( "cld\n\t" "rep ; stosl\n\t" - "testb $2,%b1\n\t" + "testb $2,%b3\n\t" "je 1f\n\t" "stosw\n" - "1:\ttestb $1,%b1\n\t" + "1:\ttestb $1,%b3\n\t" "je 2f\n\t" "stosb\n" "2:" - : /* no output */ - :"a" (c), "q" (count), "c" (count/4), "D" ((long) s) - :"cx","di","memory"); + : "=c" (tc), "=D" (sr) + :"a" (c), "q" (tc), "c" (tc), "D" ((long) s) + :"memory"); return (s); } @@ -542,18 +581,17 @@ extern inline size_t strnlen(const char { register int __res; __asm__ __volatile__( - "movl %1,%0\n\t" + "movl %2,%0\n\t" "jmp 2f\n" "1:\tcmpb $0,(%0)\n\t" "je 3f\n\t" "incl %0\n" - "2:\tdecl %2\n\t" - "cmpl $-1,%2\n\t" + "2:\tdecl %3\n\t" + "cmpl $-1,%3\n\t" "jne 1b\n" - "3:\tsubl %1,%0" - :"=a" (__res) - :"c" (s),"d" (count) - :"dx"); + "3:\tsubl %2,%0" + :"=a" (__res), "=d" (count) + :"c" (s),"d" (count)); return __res; } /* end of additional stuff */ @@ -581,13 +619,13 @@ extern inline void * __constant_c_and_co *(unsigned long *)s = pattern; return s; } -#define COMMON(x) \ -__asm__("cld\n\t" \ +#define COMMON(x) do {int c=count/4; long sr;\ +__asm__ __volatile__("cld\n\t" \ "rep ; stosl" \ x \ - : /* no outputs */ \ - : "a" (pattern),"c" (count/4),"D" ((long) s) \ - : "cx","di","memory") + : "=c" (c),"=D" (sr) \ + : "a" (pattern),"c" (c),"D" ((long) s) \ + : "memory"); }while(0) switch (count % 4) { case 0: COMMON(""); return s; @@ -622,7 +660,7 @@ extern inline void * memscan(void * addr { if (!size) return addr; - __asm__("cld + __asm__ __volatile__("cld repnz; scasb jnz 1f dec %%edi @@ -633,4 +671,5 @@ extern inline void * memscan(void * addr } #endif + #endif diff -x Entries -x Tag -p -u --recursive linux/include/asm-i386/system.h /usr/src/linux/include/asm-i386/system.h --- linux/include/asm-i386/system.h Mon Nov 9 06:40:52 1998 +++ /usr/src/linux/include/asm-i386/system.h Thu Nov 19 13:41:32 1998 @@ -35,30 +35,30 @@ extern void FASTCALL(__switch_to(struct "a" (prev), "d" (next)); \ } while (0) -#define _set_base(addr,base) \ -__asm__("movw %%dx,%0\n\t" \ +#define _set_base(addr,base) do { unsigned long __pr; \ +__asm__ __volatile__ ("movw %%dx,%1\n\t" \ "rorl $16,%%edx\n\t" \ - "movb %%dl,%1\n\t" \ - "movb %%dh,%2" \ - : /* no output */ \ + "movb %%dl,%2\n\t" \ + "movb %%dh,%3" \ + :"=dx" (__pr) \ :"m" (*((addr)+2)), \ "m" (*((addr)+4)), \ "m" (*((addr)+7)), \ - "d" (base) \ - :"dx") + "d" (base) \ + ); } while(0) -#define _set_limit(addr,limit) \ -__asm__("movw %%dx,%0\n\t" \ +#define _set_limit(addr,limit) do { unsigned long __lr; \ +__asm__ __volatile__ ("movw %%dx,%1\n\t" \ "rorl $16,%%edx\n\t" \ - "movb %1,%%dh\n\t" \ + "movb %2,%%dh\n\t" \ "andb $0xf0,%%dh\n\t" \ "orb %%dh,%%dl\n\t" \ - "movb %%dl,%1" \ - : /* no output */ \ + "movb %%dl,%2" \ + :"=dx" (__lr) \ :"m" (*(addr)), \ "m" (*((addr)+6)), \ "d" (limit) \ - :"dx") + ); } while(0) #define set_base(ldt,base) _set_base( ((char *)&(ldt)) , (base) ) #define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , ((limit)-1)>>12 ) diff -x Entries -x Tag -p -u --recursive linux/include/asm-i386/uaccess.h /usr/src/linux/include/asm-i386/uaccess.h --- linux/include/asm-i386/uaccess.h Mon Aug 31 09:29:37 1998 +++ /usr/src/linux/include/asm-i386/uaccess.h Fri Nov 20 17:32:52 1998 @@ -249,14 +249,15 @@ do { \ */ /* Generic arbitrary sized copy. */ -#define __copy_user(to,from,size) \ +#define __copy_user(to,from,size) do { \ + void *d,*s; \ __asm__ __volatile__( \ "0: rep; movsl\n" \ - " movl %1,%0\n" \ + " movl %3,%0\n" \ "1: rep; movsb\n" \ "2:\n" \ ".section .fixup,\"ax\"\n" \ - "3: lea 0(%1,%0,4),%0\n" \ + "3: lea 0(%3,%0,4),%0\n" \ " jmp 2b\n" \ ".previous\n" \ ".section __ex_table,\"a\"\n" \ @@ -264,18 +265,19 @@ do { \ " .long 0b,3b\n" \ " .long 1b,2b\n" \ ".previous" \ - : "=&c"(size) \ + : "=&c"(size), "=D" (d), "=S" (s) \ : "r"(size & 3), "0"(size / 4), "D"(to), "S"(from) \ - : "di", "si", "memory") + : "memory") ;}while(0) -#define __copy_user_zeroing(to,from,size) \ +#define __copy_user_zeroing(to,from,size) do { \ + void *d,*s; \ __asm__ __volatile__( \ "0: rep; movsl\n" \ - " movl %1,%0\n" \ + " movl %3,%0\n" \ "1: rep; movsb\n" \ "2:\n" \ ".section .fixup,\"ax\"\n" \ - "3: lea 0(%1,%0,4),%0\n" \ + "3: lea 0(%3,%0,4),%0\n" \ "4: pushl %0\n" \ " pushl %%eax\n" \ " xorl %%eax,%%eax\n" \ @@ -289,9 +291,9 @@ do { \ " .long 0b,3b\n" \ " .long 1b,4b\n" \ ".previous" \ - : "=&c"(size) \ + : "=&c"(size), "=D" (d), "=S" (s) \ : "r"(size & 3), "0"(size / 4), "D"(to), "S"(from) \ - : "di", "si", "memory"); + : "memory") ; } while(0) /* We let the __ versions of copy_from/to_user inline, because they're often * used in fast paths and have only a small space overhead. @@ -314,6 +316,7 @@ __generic_copy_to_user_nocheck(void *to, /* Optimize just a little bit when we know the size of the move. */ #define __constant_copy_user(to, from, size) \ do { \ + void *d,*s; \ switch (size & 3) { \ default: \ __asm__ __volatile__( \ @@ -327,9 +330,9 @@ do { \ " .align 4\n" \ " .long 0b,2b\n" \ ".previous" \ - : "=c"(size) \ + : "=c"(size), "=S"(s), "=D"(d) \ : "S"(from), "D"(to), "0"(size/4) \ - : "di", "si", "memory"); \ + : "memory"); \ break; \ case 1: \ __asm__ __volatile__( \ @@ -346,9 +349,9 @@ do { \ " .long 0b,3b\n" \ " .long 1b,4b\n" \ ".previous" \ - : "=c"(size) \ + : "=c"(size), "=S"(s), "=D"(d) \ : "S"(from), "D"(to), "0"(size/4) \ - : "di", "si", "memory"); \ + : "memory"); \ break; \ case 2: \ __asm__ __volatile__( \ @@ -365,9 +368,9 @@ do { \ " .long 0b,3b\n" \ " .long 1b,4b\n" \ ".previous" \ - : "=c"(size) \ + : "=c"(size), "=S"(s), "=D"(d) \ : "S"(from), "D"(to), "0"(size/4) \ - : "di", "si", "memory"); \ + : "memory"); \ break; \ case 3: \ __asm__ __volatile__( \ @@ -387,16 +390,17 @@ do { \ " .long 1b,5b\n" \ " .long 2b,6b\n" \ ".previous" \ - : "=c"(size) \ + : "=c"(size), "=S"(s), "=D"(d) \ : "S"(from), "D"(to), "0"(size/4) \ - : "di", "si", "memory"); \ + : "memory"); \ break; \ - } \ + } \ } while (0) /* Optimize just a little bit when we know the size of the move. */ #define __constant_copy_user_zeroing(to, from, size) \ do { \ + void *d,*s; \ switch (size & 3) { \ default: \ __asm__ __volatile__( \ @@ -416,9 +420,9 @@ do { \ " .align 4\n" \ " .long 0b,2b\n" \ ".previous" \ - : "=c"(size) \ + : "=c"(size), "=S"(s), "=D"(d) \ : "S"(from), "D"(to), "0"(size/4) \ - : "di", "si", "memory"); \ + : "memory"); \ break; \ case 1: \ __asm__ __volatile__( \ @@ -448,9 +452,9 @@ do { \ " .long 0b,3b\n" \ " .long 1b,4b\n" \ ".previous" \ - : "=c"(size) \ + : "=c"(size), "=S"(s), "=D"(d) \ : "S"(from), "D"(to), "0"(size/4) \ - : "di", "si", "memory"); \ + : "memory"); \ break; \ case 2: \ __asm__ __volatile__( \ @@ -480,9 +484,9 @@ do { \ " .long 0b,3b\n" \ " .long 1b,4b\n" \ ".previous" \ - : "=c"(size) \ + : "=c"(size), "=S"(s), "=D"(d) \ : "S"(from), "D"(to), "0"(size/4) \ - : "di", "si", "memory"); \ + : "memory"); \ break; \ case 3: \ __asm__ __volatile__( \ @@ -522,9 +526,9 @@ do { \ " .long 1b,5b\n" \ " .long 2b,6b\n" \ ".previous" \ - : "=c"(size) \ + : "=c"(size), "=S"(s), "=D"(d) \ : "S"(from), "D"(to), "0"(size/4) \ - : "di", "si", "memory"); \ + : "memory"); \ break; \ } \ } while (0) diff -x Entries -x Tag -p -u --recursive linux/include/video/fbcon.h /usr/src/linux/include/video/fbcon.h --- linux/include/video/fbcon.h Thu Nov 19 11:25:59 1998 +++ /usr/src/linux/include/video/fbcon.h Thu Nov 19 14:18:02 1998 @@ -431,6 +431,7 @@ static __inline__ void *mymemset(void *s static __inline__ void fast_memmove(void *d, const void *s, size_t count) { + void *dr, *sr; if (d < s) { __asm__ __volatile__ ( "cld\n\t" @@ -442,9 +443,9 @@ __asm__ __volatile__ ( "movsw\n" "2:\trep\n\t" "movsl" - : /* no output */ + : "=c"(count),"=D"(dr),"=S"(sr) :"c"(count),"D"((long)d),"S"((long)s) - :"cx","di","si","memory"); + :"memory"); } else { __asm__ __volatile__ ( "std\n\t" @@ -465,9 +466,9 @@ __asm__ __volatile__ ( "2:\trep\n\t" "movsl\n\t" "cld" - : /* no output */ + : "=c"(count),"=D"(dr),"=S"(sr) :"c"(count),"D"(count-4+(long)d),"S"(count-4+(long)s) - :"ax","cx","di","si","memory"); + :"memory"); } } diff -x Entries -x Tag -p -u --recursive linux/kernel/ksyms.c /usr/src/linux/kernel/ksyms.c --- linux/kernel/ksyms.c Thu Nov 19 11:20:00 1998 +++ /usr/src/linux/kernel/ksyms.c Fri Nov 20 14:26:02 1998 @@ -84,6 +84,66 @@ EXPORT_SYMBOL(get_module_symbol); #endif EXPORT_SYMBOL(get_options); + +#ifndef __HAVE_ARCH_STRCPY +EXPORT_SYMBOL(strcpy); +#endif +#ifndef __HAVE_ARCH_STRNCPY +EXPORT_SYMBOL(strncpy); +#endif +#ifndef __HAVE_ARCH_STRCAT +EXPORT_SYMBOL(strcat); +#endif +#ifndef __HAVE_ARCH_STRNCAT +EXPORT_SYMBOL(strncat); +#endif +#ifndef __HAVE_ARCH_STRCMP +EXPORT_SYMBOL(strcmp); +#endif +#ifndef __HAVE_ARCH_STRNCMP +EXPORT_SYMBOL(strncmp); +#endif +#ifndef __HAVE_ARCH_STRCHR +EXPORT_SYMBOL(strchr); +#endif +#ifndef __HAVE_ARCH_STRRCHR +EXPORT_SYMBOL(strrchr); +#endif +#ifndef __HAVE_ARCH_STRLEN +EXPORT_SYMBOL(strlen); +#endif +#ifndef __HAVE_ARCH_STRNLEN +EXPORT_SYMBOL(strnlen); +#endif +#ifndef __HAVE_ARCH_STRSPN +EXPORT_SYMBOL(strspn); +#endif +#ifndef __HAVE_ARCH_STRPBRK +EXPORT_SYMBOL(strpbrk); +#endif +#ifndef __HAVE_ARCH_STRTOK +EXPORT_SYMBOL(strtok); +#endif +#ifndef __HAVE_ARCH_MEMSET +EXPORT_SYMBOL(memset); +#endif +#ifndef __HAVE_ARCH_MEMCPY +EXPORT_SYMBOL(memcpy); +#endif +#ifndef __HAVE_ARCH_MEMMOVE +EXPORT_SYMBOL(memmove); +#endif +#ifndef __HAVE_ARCH_MEMCMP +EXPORT_SYMBOL(memcmp); +#endif +#ifndef __HAVE_ARCH_MEMSCAN +EXPORT_SYMBOL(memscan); +#endif +#ifndef __HAVE_ARCH_STRSTR +EXPORT_SYMBOL(strstr); +#endif + + /* process memory management */ EXPORT_SYMBOL(do_mmap); EXPORT_SYMBOL(do_munmap); diff -x Entries -x Tag -p -u --recursive linux/lib/string.c /usr/src/linux/lib/string.c --- linux/lib/string.c Tue Sep 29 14:43:37 1998 +++ /usr/src/linux/lib/string.c Thu Nov 19 15:09:20 1998 @@ -233,7 +233,7 @@ char * strtok(char * s,const char * ct) #endif #ifndef __HAVE_ARCH_MEMSET -void * memset(void * s,char c,size_t count) +void * memset(void *s,int c,__kernel_size_t count) { char *xs = (char *) s;

--------------1A21CE851321749CDCBCCA4C--

- 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/