1 #ifndef __ASM_SH_STRING_H
2 #define __ASM_SH_STRING_H
7 * Copyright (C) 1999 Niibe Yutaka
8 * But consider these trivial functions to be public domain.
11 #define __HAVE_ARCH_STRCPY
12 static inline char *strcpy(char *__dest
, const char *__src
)
14 register char *__xdest
= __dest
;
15 unsigned long __dummy
;
17 __asm__
__volatile__("1:\n\t"
23 : "=r" (__dest
), "=r" (__src
), "=&z" (__dummy
)
24 : "0" (__dest
), "1" (__src
)
30 #define __HAVE_ARCH_STRNCPY
31 static inline char *strncpy(char *__dest
, const char *__src
, size_t __n
)
33 register char *__xdest
= __dest
;
34 unsigned long __dummy
;
49 : "=r" (__dest
), "=r" (__src
), "=&z" (__dummy
)
50 : "0" (__dest
), "1" (__src
), "r" (__src
+__n
)
56 #define __HAVE_ARCH_STRCMP
57 static inline int strcmp(const char *__cs
, const char *__ct
)
60 unsigned long __dummy
;
75 : "=r" (__cs
), "=r" (__ct
), "=&r" (__res
), "=&z" (__dummy
)
76 : "0" (__cs
), "1" (__ct
)
82 #define __HAVE_ARCH_STRNCMP
83 static inline int strncmp(const char *__cs
, const char *__ct
, size_t __n
)
86 unsigned long __dummy
;
101 " mov.b @%1+, %3\n\t"
107 :"=r" (__cs
), "=r" (__ct
), "=&r" (__res
), "=&z" (__dummy
)
108 : "0" (__cs
), "1" (__ct
), "r" (__cs
+__n
)
114 #define __HAVE_ARCH_MEMSET
115 extern void *memset(void *__s
, int __c
, size_t __count
);
117 #define __HAVE_ARCH_MEMCPY
118 extern void *memcpy(void *__to
, __const__
void *__from
, size_t __n
);
120 #define __HAVE_ARCH_MEMMOVE
121 extern void *memmove(void *__dest
, __const__
void *__src
, size_t __n
);
123 #define __HAVE_ARCH_MEMCHR
124 extern void *memchr(const void *__s
, int __c
, size_t __n
);
126 #define __HAVE_ARCH_STRLEN
127 extern size_t strlen(const char *);
129 #endif /* __KERNEL__ */
131 #endif /* __ASM_SH_STRING_H */