Messages in this thread Patch in this message |  | | Subject | linux-2.3.4pre1: Adjustments for using gcc builtins | | Date | Fri, 28 May 1999 19:15:31 -0400 | | From | Horst von Brand <> |
| |
After the recent problems with egcs snapshots, it was suggested that the kernel don't use handcrafted mem* and str* functions, it better use the gcc builtins. This gives rise to the first patch below: It just blows away the redundant definitions in include/asm-i386/string.h and adds the symbols for the functions to kernel/ksyms.c (gcc doesn't allways inline them for some reason, falling back on the library functions).
During this work I found many files using mem* and str* functions that didn't include <linux/string.h>. This means that the hand-polished inline functions where not being used everywhere, in fact using the gcc builtins instead or falling back on the definitions in lib/string.c if gcc doesn't provide them.
The resulting kernel is what I'm running right now (i586/UP, egcs-19990524, binutils-2.9.1.0.25, -fno-strict-aliasing instead of -fno-strength-reduce), no ill efects are aparent up to here. My kernel includes the patch David Miller posted for i386/UP here.
--- linux/fs/isofs/symlink.c.dist-2.3.4pre1 Fri May 28 15:01:10 1999 +++ linux/fs/isofs/symlink.c Fri May 28 15:47:02 1999 @@ -9,6 +9,7 @@ * extensions to iso9660 */ +#include <linux/string.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/fs.h> --- linux/fs/hpfs/buffer.c.dist-2.3.4pre1 Fri May 28 15:01:11 1999 +++ linux/fs/hpfs/buffer.c Fri May 28 15:44:34 1999 @@ -6,6 +6,7 @@ * general buffer i/o */ +#include <linux/string.h> #include "hpfs_fn.h" void hpfs_lock_creation(struct super_block *s) --- linux/fs/hpfs/ea.c.dist-2.3.4pre1 Fri May 28 15:01:11 1999 +++ linux/fs/hpfs/ea.c Fri May 28 15:44:18 1999 @@ -6,6 +6,7 @@ * handling extended attributes */ +#include <linux/string.h> #include "hpfs_fn.h" /* Remove external extended attributes. ano specifies wheter a is a --- linux/fs/hpfs/file.c.dist-2.3.4pre1 Fri May 28 15:01:11 1999 +++ linux/fs/hpfs/file.c Fri May 28 15:43:56 1999 @@ -6,6 +6,7 @@ * file VFS functions */ +#include <linux/string.h> #include "hpfs_fn.h" int hpfs_open(struct inode *i, struct file *f) --- linux/fs/hpfs/name.c.dist-2.3.4pre1 Fri May 28 15:01:11 1999 +++ linux/fs/hpfs/name.c Fri May 28 15:43:23 1999 @@ -6,6 +6,7 @@ * operations with filenames */ +#include <linux/string.h> #include "hpfs_fn.h" char *text_postfix[]={ --- linux/fs/hpfs/namei.c.dist-2.3.4pre1 Fri May 28 15:01:11 1999 +++ linux/fs/hpfs/namei.c Fri May 28 15:43:14 1999 @@ -6,6 +6,7 @@ * adding & removing files & directories */ +#include <linux/string.h> #include "hpfs_fn.h" int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) --- linux/fs/hpfs/super.c.dist-2.3.4pre1 Fri May 28 15:01:11 1999 +++ linux/fs/hpfs/super.c Fri May 28 15:42:52 1999 @@ -6,6 +6,7 @@ * mouning, unmounting, error handling */ +#include <linux/string.h> #include "hpfs_fn.h" #include <linux/module.h> --- linux/fs/ufs/util.c.dist-2.3.4pre1 Fri May 28 15:01:11 1999 +++ linux/fs/ufs/util.c Fri May 28 15:41:11 1999 @@ -6,6 +6,7 @@ * Charles University, Faculty of Mathematics and Physics */ +#include <linux/string.h> #include <linux/malloc.h> #include <linux/locks.h> --- linux/fs/lockd/svcsubs.c.dist-2.3.4pre1 Fri May 28 15:01:11 1999 +++ linux/fs/lockd/svcsubs.c Fri May 28 15:39:18 1999 @@ -7,6 +7,7 @@ */ #include <linux/types.h> +#include <linux/string.h> #include <linux/sched.h> #include <linux/in.h> #include <linux/sunrpc/svc.h> --- linux/fs/lockd/svcshare.c.dist-2.3.4pre1 Fri May 28 15:01:12 1999 +++ linux/fs/lockd/svcshare.c Fri May 28 15:39:08 1999 @@ -8,6 +8,7 @@ #include <linux/sched.h> #include <linux/unistd.h> +#include <linux/string.h> #include <linux/malloc.h> #include <linux/sunrpc/clnt.h> --- linux/fs/qnx4/inode.c.dist-2.3.4pre1 Fri May 28 15:01:12 1999 +++ linux/fs/qnx4/inode.c Fri May 28 15:37:40 1999 @@ -15,6 +15,7 @@ #include <linux/config.h> #include <linux/module.h> #include <linux/types.h> +#include <linux/string.h> #include <linux/errno.h> #include <linux/malloc.h> #include <linux/qnx4_fs.h> --- linux/fs/qnx4/symlinks.c.dist-2.3.4pre1 Fri May 28 15:01:12 1999 +++ linux/fs/qnx4/symlinks.c Fri May 28 15:36:51 1999 @@ -13,6 +13,7 @@ /* THIS FILE HAS TO BE REWRITTEN */ +#include <linux/string.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/fs.h> --- linux/fs/coda/cnode.c.dist-2.3.4pre1 Fri May 28 15:01:12 1999 +++ linux/fs/coda/cnode.c Fri May 28 15:36:08 1999 @@ -3,6 +3,7 @@ */ #include <linux/types.h> +#include <linux/string.h> #include <linux/time.h> #include <linux/coda.h> --- linux/fs/ntfs/util.c.dist-2.3.4pre1 Fri May 28 15:01:14 1999 +++ linux/fs/ntfs/util.c Fri May 28 15:35:30 1999 @@ -12,6 +12,7 @@ #include "struct.h" #include "util.h" +#include <linux/string.h> #include <linux/errno.h> /* FreeBSD doesn't seem to have EILSEQ in errno.h */ #ifndef EILSEQ --- linux/fs/devpts/inode.c.dist-2.3.4pre1 Fri May 28 15:01:14 1999 +++ linux/fs/devpts/inode.c Fri May 28 15:35:16 1999 @@ -12,6 +12,7 @@ #include <linux/module.h> +#include <linux/string.h> #include <linux/fs.h> #include <linux/init.h> #include <linux/kdev_t.h> --- linux/fs/efs/namei.c.dist-2.3.4pre1 Fri May 28 15:01:14 1999 +++ linux/fs/efs/namei.c Fri May 28 15:34:51 1999 @@ -6,6 +6,7 @@ * Portions derived from work (c) 1995,1996 Christian Vogelgsang. */ +#include <linux/string.h> #include <linux/efs_fs.h> static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len) { --- linux/fs/efs/symlink.c.dist-2.3.4pre1 Fri May 28 15:01:14 1999 +++ linux/fs/efs/symlink.c Fri May 28 15:34:34 1999 @@ -6,6 +6,7 @@ * Portions derived from work (c) 1995,1996 Christian Vogelgsang. */ +#include <linux/string.h> #include <linux/malloc.h> #include <linux/efs_fs.h> --- linux/fs/file_table.c.dist-2.3.4pre1 Fri May 28 15:01:10 1999 +++ linux/fs/file_table.c Fri May 28 15:48:34 1999 @@ -5,6 +5,7 @@ * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) */ +#include <linux/string.h> #include <linux/slab.h> #include <linux/file.h> #include <linux/init.h> --- linux/init/main.c.dist-2.3.4pre1 Sun May 16 13:21:17 1999 +++ linux/init/main.c Fri May 28 14:47:35 1999 @@ -14,6 +14,7 @@ #include <linux/config.h> #include <linux/proc_fs.h> #include <linux/unistd.h> +#include <linux/string.h> #include <linux/ctype.h> #include <linux/delay.h> #include <linux/utsname.h> --- linux/net/802/llc_macinit.c.dist-2.3.4pre1 Fri May 28 15:01:15 1999 +++ linux/net/802/llc_macinit.c Fri May 28 15:34:21 1999 @@ -17,6 +17,8 @@ * Alan Cox : Chainsawed to Linux format * Added llc_ to names * Started restructuring handlers + * + * Horst von Brand : Add #include <linux/string.h> */ #include <linux/module.h> @@ -24,6 +26,7 @@ #include <linux/kernel.h> #include <linux/malloc.h> #include <linux/unistd.h> +#include <linux/string.h> #include <linux/netdevice.h> #include <linux/init.h> #include <net/p8022.h> --- linux/net/core/neighbour.c.dist-2.3.4pre1 Fri May 28 15:01:15 1999 +++ linux/net/core/neighbour.c Fri May 28 15:33:28 1999 @@ -12,10 +12,12 @@ * * Fixes: * Vitaly E. Lavrov releasing NULL neighbor in neigh_add. + * Horst von Brand Add #include <linux/string.h> */ #include <linux/config.h> #include <linux/types.h> +#include <linux/string.h> #include <linux/kernel.h> #include <linux/socket.h> #include <linux/sched.h> --- linux/net/ipv4/ip_masq_quake.c.dist-2.3.4pre1 Fri May 28 15:01:16 1999 +++ linux/net/ipv4/ip_masq_quake.c Fri May 28 15:32:31 1999 @@ -12,6 +12,7 @@ * http://www.gamers.org/dEngine/quake/spec/ * Harald Hoyer : Check for QUAKE-STRING * Juan Jose Ciarlante : litl bits for 2.1 + * Horst von Brand : Add #include <linux/string.h> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -24,6 +25,7 @@ #include <linux/module.h> #include <asm/system.h> #include <linux/types.h> +#include <linux/string.h> #include <linux/kernel.h> #include <linux/skbuff.h> #include <linux/in.h> --- linux/net/ipv4/ip_masq_vdolive.c.dist-2.3.4pre1 Fri May 28 15:01:17 1999 +++ linux/net/ipv4/ip_masq_vdolive.c Fri May 28 15:30:09 1999 @@ -10,6 +10,9 @@ * Fixes: Minor changes for 2.1 by * Steven Clarke <Steven.Clarke@ThePlanet.Net>, Planet Online Ltd * + * Add missing #include <linux/string.h> + * Horst von Brand <vonbrand@sleipnir.valparaiso.cl> + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version @@ -25,6 +28,7 @@ #include <linux/config.h> #include <linux/module.h> #include <linux/types.h> +#include <linux/string.h> #include <linux/kernel.h> #include <asm/system.h> #include <linux/skbuff.h> --- linux/net/ipv6/reassembly.c.dist-2.3.4pre1 Fri May 28 15:01:17 1999 +++ linux/net/ipv6/reassembly.c Fri May 28 15:27:31 1999 @@ -19,9 +19,12 @@ * Fixes: * Andi Kleen Make it work with multiple hosts. * More RFC compliance. + * + * Horst von Brand Add missing #include <linux/string.h> */ #include <linux/errno.h> #include <linux/types.h> +#include <linux/string.h> #include <linux/socket.h> #include <linux/sockios.h> #include <linux/sched.h> --- linux/net/ipv6/mcast.c.dist-2.3.4pre1 Fri May 28 15:01:17 1999 +++ linux/net/ipv6/mcast.c Fri May 28 15:26:35 1999 @@ -20,6 +20,7 @@ #include <linux/module.h> #include <linux/errno.h> #include <linux/types.h> +#include <linux/string.h> #include <linux/socket.h> #include <linux/sockios.h> #include <linux/sched.h> --- linux/net/ipv6/ip6_fw.c.dist-2.3.4pre1 Fri May 28 15:01:17 1999 +++ linux/net/ipv6/ip6_fw.c Fri May 28 15:26:20 1999 @@ -16,6 +16,7 @@ #include <linux/config.h> #include <linux/errno.h> #include <linux/types.h> +#include <linux/string.h> #include <linux/socket.h> #include <linux/sockios.h> #include <linux/net.h> --- linux/net/ipv6/ip6_output.c.dist-2.3.4pre1 Fri May 28 15:01:17 1999 +++ linux/net/ipv6/ip6_output.c Fri May 28 15:25:34 1999 @@ -20,11 +20,13 @@ * route changes now work. * ip6_forward does not confuse sniffers. * etc. - * + * + * H. von Brand : Added missing #include <linux/string.h> */ #include <linux/errno.h> #include <linux/types.h> +#include <linux/string.h> #include <linux/socket.h> #include <linux/net.h> #include <linux/netdevice.h> --- linux/net/sunrpc/auth.c.dist-2.3.4pre1 Fri May 28 15:01:17 1999 +++ linux/net/sunrpc/auth.c Fri May 28 15:22:30 1999 @@ -4,9 +4,12 @@ * Generic RPC authentication API. * * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> + * + * Modified May 1999, Horst von Brand <vonbrand@sleipnir.valparaiso.cl> */ #include <linux/types.h> +#include <linux/string.h> #include <linux/sched.h> #include <linux/malloc.h> #include <linux/errno.h> --- linux/net/sunrpc/auth_unix.c.dist-2.3.4pre1 Fri May 28 15:01:17 1999 +++ linux/net/sunrpc/auth_unix.c Fri May 28 15:21:35 1999 @@ -4,9 +4,12 @@ * UNIX-style authentication; no AUTH_SHORT support * * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> + * + * Modified May 1999 Horst von Brand <vonbrand@sleipnir.valparaiso.cl> */ #include <linux/types.h> +#include <linux/string.h> #include <linux/malloc.h> #include <linux/socket.h> #include <linux/in.h> --- linux/net/irda/irda_device.c.dist-2.3.4pre1 Fri May 28 15:01:18 1999 +++ linux/net/irda/irda_device.c Fri May 28 15:20:16 1999 @@ -8,6 +8,8 @@ * Created at: Wed Sep 2 20:22:08 1998 * Modified at: Wed Apr 21 09:48:19 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> + * Modified at: Fri May 28 3:11 CST 1999 + * Modified by: Horst von Brand <vonbrand@sleipnir.valparaiso.cl> * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. * @@ -23,6 +25,7 @@ ********************************************************************/ #include <linux/config.h> +#include <linux/string.h> #include <linux/proc_fs.h> #include <linux/skbuff.h> #include <linux/if.h> --- linux/net/irda/irlap_comp.c.dist-2.3.4pre1 Fri May 28 15:01:18 1999 +++ linux/net/irda/irlap_comp.c Fri May 28 15:19:26 1999 @@ -8,6 +8,8 @@ * Created at: Fri Oct 9 09:18:07 1998 * Modified at: Mon Feb 8 01:23:52 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> + * Modified at: Fri May 28 3:11 CST 1999 + * Modified by: Horst von Brand <vonbrand@sleipnir.valparaiso.cl> * Sources: ppp.c, isdn_ppp.c * * Copyright (c) 1998 Dag Brattli, All Rights Reserved. @@ -22,6 +24,8 @@ * provided "AS-IS" and at no charge. * ********************************************************************/ + +#include <linux/string.h> #include <net/irda/irda.h> #include <net/irda/irqueue.h> --- linux/net/irda/wrapper.c.dist-2.3.4pre1 Fri May 28 15:01:18 1999 +++ linux/net/irda/wrapper.c Fri May 28 15:17:16 1999 @@ -8,6 +8,8 @@ * Created at: Mon Aug 4 20:40:53 1997 * Modified at: Wed Apr 21 12:45:55 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> + * Modified at: Fri May 28 3:11 CST 1999 + * Modified by: Horst von Brand <vonbrand@sleipnir.valparaiso.cl> * * Copyright (c) 1998 Dag Brattli <dagb@cs.uit.no>, * All Rights Reserved. @@ -24,6 +26,7 @@ ********************************************************************/ #include <linux/skbuff.h> +#include <linux/string.h> #include <asm/byteorder.h> #include <net/irda/irda.h> --- linux/net/irda/discovery.c.dist-2.3.4pre1 Fri May 28 15:01:18 1999 +++ linux/net/irda/discovery.c Fri May 28 15:18:21 1999 @@ -8,6 +8,8 @@ * Created at: Tue Apr 6 15:33:50 1999 * Modified at: Sun Apr 11 00:41:58 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> + * Modified at: Fri May 28 3:11 CST 1999 + * Modified by: Horst von Brand <vonbrand@sleipnir.valparaiso.cl> * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. * @@ -28,6 +30,7 @@ * ********************************************************************/ +#include <linux/string.h> #include <linux/socket.h> #include <linux/irda.h> --- linux/drivers/net/ptifddi.c.dist-2.3.4pre1 Fri May 28 15:00:58 1999 +++ linux/drivers/net/ptifddi.c Fri May 28 16:02:17 1999 @@ -8,6 +8,7 @@ static char *version = "ptifddi.c:v1.0 10/Dec/96 David S. Miller (davem@caipfs.rutgers.edu)\n"; +#include <linux/string.h> #include <linux/init.h> #include "ptifddi.h" --- linux/drivers/sound/audio.c.dist-2.3.4pre1 Fri May 28 15:01:03 1999 +++ linux/drivers/sound/audio.c Fri May 28 16:00:22 1999 @@ -20,10 +20,12 @@ * Thomas Sailer : use more logical O_NONBLOCK semantics * Daniel Rodriksson: reworked the use of the device specific copy_user * still generic + * Horst von Brand: Add missing #include <linux/string.h> */ #include <linux/config.h> #include <linux/stddef.h> +#include <linux/string.h> #include <linux/kmod.h> #include "sound_config.h" --- linux/drivers/sound/sound_timer.c.dist-2.3.4pre1 Fri May 28 15:01:04 1999 +++ linux/drivers/sound/sound_timer.c Fri May 28 15:59:12 1999 @@ -12,6 +12,7 @@ * Thomas Sailer : ioctl code reworked (vmalloc/vfree removed) */ #include <linux/config.h> +#include <linux/string.h> #include "sound_config.h" --- linux/drivers/sound/bin2hex.c.dist-2.3.4pre1 Fri May 28 15:01:04 1999 +++ linux/drivers/sound/bin2hex.c Fri May 28 15:58:45 1999 @@ -1,4 +1,5 @@ #include <stdio.h> +#include <string.h> int main( int argc, const char * argv [] ) { --- linux/drivers/sound/hex2hex.c.dist-2.3.4pre1 Fri May 28 15:01:04 1999 +++ linux/drivers/sound/hex2hex.c Fri May 28 15:58:28 1999 @@ -5,6 +5,7 @@ */ #include <stdio.h> +#include <string.h> #include <stdlib.h> #define ABANDON(why) { fprintf(stderr, "%s\n", why); exit(1); } --- linux/drivers/isdn/avmb1/b1pci.c.dist-2.3.4pre1 Fri May 28 15:01:06 1999 +++ linux/drivers/isdn/avmb1/b1pci.c Fri May 28 15:57:27 1999 @@ -46,6 +46,7 @@ */ #include <linux/config.h> +#include <linux/string.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/pci.h> --- linux/drivers/isdn/hisax/hscx_irq.c.dist-2.3.4pre1 Fri May 28 15:01:07 1999 +++ linux/drivers/isdn/hisax/hscx_irq.c Fri May 28 15:56:03 1999 @@ -42,6 +42,8 @@ * */ +#include <linux/string.h> + static inline void waitforCEC(struct IsdnCardState *cs, int hscx) --- linux/drivers/isdn/hisax/elsa_ser.c.dist-2.3.4pre1 Fri May 28 15:01:08 1999 +++ linux/drivers/isdn/hisax/elsa_ser.c Fri May 28 15:55:10 1999 @@ -1,3 +1,4 @@ +#include <linux/string.h> #include <linux/serial.h> #include <linux/serial_reg.h> --- linux/drivers/isdn/hisax/telespci.c.dist-2.3.4pre1 Fri May 28 15:01:08 1999 +++ linux/drivers/isdn/hisax/telespci.c Fri May 28 15:53:24 1999 @@ -24,6 +24,7 @@ */ #define __NO_VERSION__ #include <linux/config.h> +#include <linux/string.h> #include "hisax.h" #include "isac.h" #include "hscx.h" --- linux/drivers/sbus/dvma.c.dist-2.3.4pre1 Fri May 28 15:01:09 1999 +++ linux/drivers/sbus/dvma.c Fri May 28 15:51:46 1999 @@ -4,6 +4,7 @@ */ #include <linux/config.h> +#include <linux/string.h> #include <linux/kernel.h> #include <linux/malloc.h> #include <linux/init.h> --- linux/drivers/video/fbcmap.c.dist-2.3.4pre1 Fri May 28 15:01:09 1999 +++ linux/drivers/video/fbcmap.c Fri May 28 15:51:20 1999 @@ -8,6 +8,7 @@ * more details. */ +#include <linux/string.h> #include <linux/module.h> #include <linux/tty.h> #include <linux/fb.h> --- linux/drivers/misc/parport_share.c.dist-2.3.4pre1 Fri May 28 15:01:09 1999 +++ linux/drivers/misc/parport_share.c Fri May 28 15:50:45 1999 @@ -15,6 +15,8 @@ #include <linux/config.h> +#include <linux/string.h> + #include <linux/tasks.h> #include <linux/parport.h> --- linux/drivers/misc/parport_procfs.c.dist-2.3.4pre1 Fri May 28 15:01:09 1999 +++ linux/drivers/misc/parport_procfs.c Fri May 28 15:50:11 1999 @@ -12,6 +12,7 @@ * Cleaned up include files - Russell King <linux@arm.uk.linux.org> */ +#include <linux/string.h> #include <linux/config.h> #include <linux/sched.h> #include <linux/delay.h> --- linux/drivers/misc/parport_ax.c.dist-2.3.4pre1 Fri May 28 15:01:09 1999 +++ linux/drivers/misc/parport_ax.c Fri May 28 15:49:54 1999 @@ -11,6 +11,7 @@ * Grant Guenther <grant@torque.net> */ +#include <linux/string.h> #include <linux/module.h> #include <linux/delay.h> #include <linux/errno.h> --- linux/drivers/acorn/block/ide-ics.c.dist-2.3.4pre1 Fri May 28 15:01:10 1999 +++ linux/drivers/acorn/block/ide-ics.c Fri May 28 15:49:29 1999 @@ -8,6 +8,7 @@ * 12-09-1997 RMK Added interrupt enable/disable */ +#include <linux/string.h> #include <linux/module.h> #include <linux/ioport.h> #include <linux/malloc.h> |  |