2 * arch/arm/boot/compressed/string.c
4 * Small subset of simple string routines
7 #include <linux/string.h>
9 void *memcpy(void *__dest
, __const
void *__src
, size_t __n
)
12 unsigned char *d
= (unsigned char *)__dest
, *s
= (unsigned char *)__src
;
14 for (i
= __n
>> 3; i
> 0; i
--) {
43 void *memmove(void *__dest
, __const
void *__src
, size_t count
)
45 unsigned char *d
= __dest
;
46 const unsigned char *s
= __src
;
52 return memcpy(__dest
, __src
, count
);
59 size_t strlen(const char *s
)
68 int memcmp(const void *cs
, const void *ct
, size_t count
)
70 const unsigned char *su1
= cs
, *su2
= ct
, *end
= su1
+ count
;
74 res
= *su1
++ - *su2
++;
81 int strcmp(const char *cs
, const char *ct
)
96 void *memchr(const void *s
, int c
, size_t count
)
98 const unsigned char *p
= s
;
101 if ((unsigned char)c
== *p
++)
102 return (void *)(p
- 1);
106 char *strchr(const char *s
, int c
)
108 while (*s
!= (char)c
)
116 void *memset(void *s
, int c
, size_t count
)
124 void __memzero(void *s
, size_t count
)