mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	We have assembly implementations of strcpy(), strncpy(), strcmp() & strncmp() which: - Are simple byte-at-a-time loops with no particular optimizations. As a comment in the code describes, they're "rather naive". - Offer no clear performance advantage over the generic C implementations - in microbenchmarks performed by Alexander Lobakin the asm functions sometimes win & sometimes lose, but generally not by large margins in either direction. - Don't support 64-bit kernels, where we already make use of the generic C implementations. - Tend to bloat kernel code size due to inlining. - Don't support CONFIG_FORTIFY_SOURCE. - Won't support nanoMIPS without rework. For all of these reasons, delete the asm implementations & make use of the generic C implementations for 32-bit kernels just like we already do for 64-bit kernels. Signed-off-by: Paul Burton <paul.burton@mips.com> URL: https://lore.kernel.org/linux-mips/a2a35f1cf58d6db19eb4af9b4ae21e35@dlink.ru/ Cc: Alexander Lobakin <alobakin@dlink.ru> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Cc: linux-mips@vger.kernel.org
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			692 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			692 B
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * This file is subject to the terms and conditions of the GNU General Public
 | 
						|
 * License.  See the file "COPYING" in the main directory of this archive
 | 
						|
 * for more details.
 | 
						|
 *
 | 
						|
 * Copyright (c) 1994, 95, 96, 97, 98, 2000, 01 Ralf Baechle
 | 
						|
 * Copyright (c) 2000 by Silicon Graphics, Inc.
 | 
						|
 * Copyright (c) 2001 MIPS Technologies, Inc.
 | 
						|
 */
 | 
						|
#ifndef _ASM_STRING_H
 | 
						|
#define _ASM_STRING_H
 | 
						|
 | 
						|
#define __HAVE_ARCH_MEMSET
 | 
						|
extern void *memset(void *__s, int __c, size_t __count);
 | 
						|
 | 
						|
#define __HAVE_ARCH_MEMCPY
 | 
						|
extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
 | 
						|
 | 
						|
#define __HAVE_ARCH_MEMMOVE
 | 
						|
extern void *memmove(void *__dest, __const__ void *__src, size_t __n);
 | 
						|
 | 
						|
#endif /* _ASM_STRING_H */
 |