2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (c) 1994, 95, 96, 97, 98, 2000, 01 Ralf Baechle
7 * Copyright (c) 2000 by Silicon Graphics, Inc.
8 * Copyright (c) 2001 MIPS Technologies, Inc.
15 * Most of the inline functions are rather naive implementations so I just
16 * didn't bother updating them for 64-bit ...
22 #define __HAVE_ARCH_STRCPY
23 static __inline__ char *strcpy(char *__dest, __const__ char *__src)
25 char *__xdest = __dest;
30 "1:\tlbu\t$1,(%1)\n\t"
37 : "=r" (__dest), "=r" (__src)
38 : "0" (__dest), "1" (__src)
44 #define __HAVE_ARCH_STRNCPY
45 static __inline__ char *strncpy(char *__dest, __const__ char *__src, size_t __n)
47 char *__xdest = __dest;
55 "1:\tlbu\t$1,(%1)\n\t"
65 : "=r" (__dest), "=r" (__src), "=r" (__n)
66 : "0" (__dest), "1" (__src), "2" (__n)
72 #define __HAVE_ARCH_STRCMP
73 static __inline__ int strcmp(__const__ char *__cs, __const__ char *__ct)
81 "1:\tlbu\t$1,(%1)\n\t"
87 #if defined(CONFIG_CPU_R3000)
94 : "=r" (__cs), "=r" (__ct), "=r" (__res)
95 : "0" (__cs), "1" (__ct));
100 #endif /* !defined(IN_STRING_C) */
102 #define __HAVE_ARCH_STRNCMP
103 static __inline__ int
104 strncmp(__const__ char *__cs, __const__ char *__ct, size_t __count)
108 __asm__ __volatile__(
109 ".set\tnoreorder\n\t"
111 "1:\tlbu\t%3,(%0)\n\t"
120 #if defined(CONFIG_CPU_R3000)
124 "3:\tsubu\t%3,$1\n\t"
127 : "=r" (__cs), "=r" (__ct), "=r" (__count), "=r" (__res)
128 : "0" (__cs), "1" (__ct), "2" (__count));
132 #endif /* CONFIG_32BIT */
134 #define __HAVE_ARCH_MEMSET
135 extern void *memset(void *__s, int __c, size_t __count);
137 #define __HAVE_ARCH_MEMCPY
138 extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
140 #define __HAVE_ARCH_MEMMOVE
141 extern void *memmove(void *__dest, __const__ void *__src, size_t __n);
143 #endif /* _ASM_STRING_H */