1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SH_STRING_H
3 #define __ASM_SH_STRING_H
6 * Copyright (C) 1999 Niibe Yutaka
7 * But consider these trivial functions to be public domain.
10 #define __HAVE_ARCH_STRCPY
11 static inline char *strcpy(char *__dest
, const char *__src
)
13 register char *__xdest
= __dest
;
14 unsigned long __dummy
;
16 __asm__
__volatile__("1:\n\t"
22 : "=r" (__dest
), "=r" (__src
), "=&z" (__dummy
)
23 : "0" (__dest
), "1" (__src
)
29 #define __HAVE_ARCH_STRCMP
30 static inline int strcmp(const char *__cs
, const char *__ct
)
33 unsigned long __dummy
;
48 : "=r" (__cs
), "=r" (__ct
), "=&r" (__res
), "=&z" (__dummy
)
49 : "0" (__cs
), "1" (__ct
)
55 #define __HAVE_ARCH_STRNCMP
56 static inline int strncmp(const char *__cs
, const char *__ct
, size_t __n
)
59 unsigned long __dummy
;
80 :"=r" (__cs
), "=r" (__ct
), "=&r" (__res
), "=&z" (__dummy
)
81 : "0" (__cs
), "1" (__ct
), "r" (__cs
+__n
)
87 #define __HAVE_ARCH_MEMSET
88 extern void *memset(void *__s
, int __c
, size_t __count
);
90 #define __HAVE_ARCH_MEMCPY
91 extern void *memcpy(void *__to
, __const__
void *__from
, size_t __n
);
93 #define __HAVE_ARCH_MEMMOVE
94 extern void *memmove(void *__dest
, __const__
void *__src
, size_t __n
);
96 #define __HAVE_ARCH_MEMCHR
97 extern void *memchr(const void *__s
, int __c
, size_t __n
);
99 #define __HAVE_ARCH_STRLEN
100 extern size_t strlen(const char *);
102 #endif /* __ASM_SH_STRING_H */