1 /* $Id: string.h,v 1.6 1998/07/20 17:52:21 ralf Exp $
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
7 * Copyright (c) 1994, 1995, 1996, 1997, 1998 by Ralf Baechle
9 #ifndef __ASM_MIPS_STRING_H
10 #define __ASM_MIPS_STRING_H
12 #define __HAVE_ARCH_STRCPY
13 extern __inline__
char *strcpy(char *__dest
, __const__
char *__src
)
15 char *__xdest
= __dest
;
20 "1:\tlbu\t$1,(%1)\n\t"
27 : "=r" (__dest
), "=r" (__src
)
28 : "0" (__dest
), "1" (__src
)
34 #define __HAVE_ARCH_STRNCPY
35 extern __inline__
char *strncpy(char *__dest
, __const__
char *__src
, size_t __n
)
37 char *__xdest
= __dest
;
45 "1:\tlbu\t$1,(%1)\n\t"
55 : "=r" (__dest
), "=r" (__src
), "=r" (__n
)
56 : "0" (__dest
), "1" (__src
), "2" (__n
)
62 #define __HAVE_ARCH_STRCMP
63 extern __inline__
int strcmp(__const__
char *__cs
, __const__
char *__ct
)
71 "1:\tlbu\t$1,(%1)\n\t"
77 #if _MIPS_ISA == _MIPS_ISA_MIPS1
84 : "=r" (__cs
), "=r" (__ct
), "=r" (__res
)
85 : "0" (__cs
), "1" (__ct
)
91 #define __HAVE_ARCH_STRNCMP
92 extern __inline__
int strncmp(__const__
char *__cs
, __const__
char *__ct
, size_t __count
)
99 "1:\tlbu\t%3,(%1)\n\t"
111 : "=r" (__cs
), "=r" (__ct
), "=r" (__count
), "=r" (__res
)
112 : "0" (__cs
), "1" (__ct
), "2" (__count
)
118 #define __HAVE_ARCH_MEMSET
119 extern void *memset(void *__s
, int __c
, size_t __count
);
121 #define __HAVE_ARCH_MEMCPY
122 extern void *memcpy(void *__to
, __const__
void *__from
, size_t __n
);
124 #define __HAVE_ARCH_MEMMOVE
125 extern void *memmove(void *__dest
, __const__
void *__src
, size_t __n
);
127 /* Don't build bcopy at all ... */
128 #define __HAVE_ARCH_BCOPY
130 #define __HAVE_ARCH_MEMSCAN
131 extern __inline__
void *memscan(void *__addr
, int __c
, size_t __size
)
133 char *__end
= (char *)__addr
+ __size
;
135 __asm__(".set\tpush\n\t"
138 "1:\tbeq\t%0,%1,2f\n\t"
143 : "=r" (__addr
), "=r" (__end
)
144 : "0" (__addr
), "1" (__end
), "r" (__c
)
150 #endif /* __ASM_MIPS_STRING_H */