diff options
| author | Michael Brown | 2012-11-05 01:25:25 +0100 |
|---|---|---|
| committer | Michael Brown | 2012-11-12 17:58:49 +0100 |
| commit | de20c526e68f7ec1155cdb7dcaeb2ff4c8c2c580 (patch) | |
| tree | 7bd001122acc5bad2709ca20a87b9065d576ebbe /src/arch/x86/include/bits | |
| parent | [libc] Reduce overall code size by externalising strncmp() (diff) | |
| download | ipxe-de20c526e68f7ec1155cdb7dcaeb2ff4c8c2c580.tar.gz ipxe-de20c526e68f7ec1155cdb7dcaeb2ff4c8c2c580.tar.xz ipxe-de20c526e68f7ec1155cdb7dcaeb2ff4c8c2c580.zip | |
[libc] Reduce overall code size by externalising strlen()
Typical saving is 5-20 bytes in each file using strlen().
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/x86/include/bits')
| -rw-r--r-- | src/arch/x86/include/bits/string.h | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/arch/x86/include/bits/string.h b/src/arch/x86/include/bits/string.h index 75a1f01a8..249dd5438 100644 --- a/src/arch/x86/include/bits/string.h +++ b/src/arch/x86/include/bits/string.h @@ -234,17 +234,7 @@ return dest; extern int strncmp ( const char *str1, const char *str2, size_t len ); #define __HAVE_ARCH_STRLEN -static inline size_t strlen(const char * s) -{ -int d0; -register int __res; -__asm__ __volatile__( - "repne\n\t" - "scasb\n\t" - "notl %0\n\t" - "decl %0" - :"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffff)); -return __res; -} + +extern size_t strlen ( const char *string ); #endif /* ETHERBOOT_BITS_STRING_H */ |
