Go to the documentation of this file. 1 #ifndef _M68K_STRING_H_
2 #define _M68K_STRING_H_
4 #include <linux/types.h>
5 #include <linux/compiler.h>
7 static inline size_t __kernel_strlen(
const char *
s)
16 static inline char *__kernel_strcpy(
char *
dest,
const char *
src)
21 "1: move.b (%1)+,(%0)+\n"
23 :
"+a" (
dest),
"+a" (src)
30 #define __HAVE_ARCH_STRLEN
31 #define strlen(s) (__builtin_constant_p(s) ? \
32 __builtin_strlen(s) : \
35 #define __HAVE_ARCH_STRNLEN
36 static inline size_t strnlen(
const char *s,
size_t count)
47 :
"+a" (
sc),
"+d" (count));
51 #define __HAVE_ARCH_STRCPY
53 #define strcpy(d, s) (__builtin_constant_p(s) && \
54 __builtin_strlen(s) <= 32 ? \
55 __builtin_strcpy(d, s) : \
56 __kernel_strcpy(d, s))
58 #define strcpy(d, s) __kernel_strcpy(d, s)
61 #define __HAVE_ARCH_STRNCPY
62 static inline char *strncpy(
char *dest,
const char *src,
size_t n)
68 "1: move.b (%1),(%0)+\n"
73 :
"+a" (
dest),
"+a" (src),
"+d" (
n)
78 #define __HAVE_ARCH_STRCAT
79 #define strcat(d, s) ({ \
81 strcpy(__d + strlen(__d), (s)); \
84 #ifndef CONFIG_COLDFIRE
85 #define __HAVE_ARCH_STRCMP
86 static inline int strcmp(
const char *
cs,
const char *
ct)
91 "1: move.b (%0)+,%2\n"
99 :
"+a" (
cs),
"+a" (ct),
"=d" (
res));
104 #define __HAVE_ARCH_MEMMOVE
107 #define memcmp(d, s, n) __builtin_memcmp(d, s, n)
109 #define __HAVE_ARCH_MEMSET
111 #define memset(d, c, n) __builtin_memset(d, c, n)
113 #define __HAVE_ARCH_MEMCPY
115 #define memcpy(d, s, n) __builtin_memcpy(d, s, n)