aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2009-09-28 08:21:22 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-09-28 19:43:15 -0400
commitff60fab71bb3b4fdbf8caf57ff3739ffd0887396 (patch)
tree280ee4d949e548d06aa09983de4eef6c227ba94f /Documentation
parent9f0cf4adb6aa0bfccf675c938124e68f7f06349d (diff)
x86: Use __builtin_memset and __builtin_memcpy for memset/memcpy
GCC provides reasonable memset/memcpy functions itself, with __builtin_memset and __builtin_memcpy. For the "unknown" cases, it'll fall back to our current existing functions, but for fixed size versions it'll inline something smart. Quite often that will be the same as we have now, but sometimes it can do something smarter (for example, if the code then sets the first member of a struct, it can do a shorter memset). In addition, and this is more important, gcc knows which registers and such are not clobbered (while for our asm version it pretty much acts like a compiler barrier), so for various cases it can avoid reloading values. The effect on codesize is shown below on my typical laptop .config: text data bss dec hex filename 5605675 2041100 6525148 14171923 d83f13 vmlinux.before 5595849 2041668 6525148 14162665 d81ae9 vmlinux.after Due to some not-so-good behavior in the gcc 3.x series, this change is only done for GCC 4.x and above. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> LKML-Reference: <20090928142122.6fc57e9c@infradead.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions
m"> * Copyright (C) 2005-2008 ARM * * 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 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef __LINUX_SMSC911X_H__ #define __LINUX_SMSC911X_H__ #include <linux/phy.h> /* platform_device configuration data, should be assigned to * the platform_device's dev.platform_data */ struct smsc911x_platform_config { unsigned int irq_polarity; unsigned int irq_type; unsigned int flags; unsigned int shift; phy_interface_t phy_interface; unsigned char mac[6]; }; /* Constants for platform_device irq polarity configuration */ #define SMSC911X_IRQ_POLARITY_ACTIVE_LOW 0 #define SMSC911X_IRQ_POLARITY_ACTIVE_HIGH 1 /* Constants for platform_device irq type configuration */ #define SMSC911X_IRQ_TYPE_OPEN_DRAIN 0 #define SMSC911X_IRQ_TYPE_PUSH_PULL 1 /* Constants for flags */ #define SMSC911X_USE_16BIT (BIT(0)) #define SMSC911X_USE_32BIT (BIT(1)) #define SMSC911X_FORCE_INTERNAL_PHY (BIT(2)) #define SMSC911X_FORCE_EXTERNAL_PHY (BIT(3)) #define SMSC911X_SAVE_MAC_ADDRESS (BIT(4)) /* * SMSC911X_SWAP_FIFO: * Enables software byte swap for fifo data. Should only be used as a * "last resort" in the case of big endian mode on boards with incorrectly * routed data bus to older devices such as LAN9118. Newer devices such as * LAN9221 can handle this in hardware, there are registers to control * this swapping but the driver doesn't currently use them. */ #define SMSC911X_SWAP_FIFO (BIT(5)) #endif /* __LINUX_SMSC911X_H__ */