1 #ifndef __ASM_SH_STRING_H
2 #define __ASM_SH_STRING_H
5 * Copyright (C) 1999 Niibe Yutaka
6 * But consider these trivial functions to be public domain.
9 #define __HAVE_ARCH_STRCPY
10 static __inline__
char *strcpy(char *__dest
, const char *__src
)
12 register char *__xdest
= __dest
;
13 unsigned long __dummy
;
15 __asm__
__volatile__("1:\n\t"
21 : "=r" (__dest
), "=r" (__src
), "=&z" (__dummy
)
22 : "0" (__dest
), "1" (__src
)
28 #define __HAVE_ARCH_STRNCPY
29 static __inline__
char *strncpy(char *__dest
, const char *__src
, size_t __n
)
31 register char *__xdest
= __dest
;
32 unsigned long __dummy
;
47 : "=r" (__dest
), "=r" (__src
), "=&z" (__dummy
)
48 : "0" (__dest
), "1" (__src
), "r" (__src
+__n
)
54 #define __HAVE_ARCH_STRCMP
55 static __inline__
int strcmp(const char *__cs
, const char *__ct
)
58 unsigned long __dummy
;
73 : "=r" (__cs
), "=r" (__ct
), "=&r" (__res
), "=&z" (__dummy
)
74 : "0" (__cs
), "1" (__ct
)
80 #define __HAVE_ARCH_STRNCMP
81 static __inline__
int strncmp(const char *__cs
, const char *__ct
, size_t __n
)
84 unsigned long __dummy
;
105 :"=r" (__cs
), "=r" (__ct
), "=&r" (__res
), "=&z" (__dummy
)
106 : "0" (__cs
), "1" (__ct
), "r" (__cs
+__n
)
112 #define __HAVE_ARCH_MEMSET
113 extern void *memset(void *__s
, int __c
, size_t __count
);
115 #define __HAVE_ARCH_MEMCPY
116 extern void *memcpy(void *__to
, __const__
void *__from
, size_t __n
);
118 #define __HAVE_ARCH_MEMMOVE
119 extern void *memmove(void *__dest
, __const__
void *__src
, size_t __n
);
121 #define __HAVE_ARCH_MEMCHR
122 extern void *memchr(const void *__s
, int __c
, size_t __n
);
124 #define __HAVE_ARCH_STRLEN
125 extern size_t strlen(const char *);
127 #endif /* __ASM_SH_STRING_H */