2 * include/asm-s390/string.h
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
9 #ifndef _S390_STRING_H_
10 #define _S390_STRING_H_
14 #ifndef _LINUX_TYPES_H
15 #include <linux/types.h>
18 #define __HAVE_ARCH_MEMCHR
19 #define __HAVE_ARCH_MEMCPY
20 #define __HAVE_ARCH_MEMSET
21 #define __HAVE_ARCH_STRCAT
22 #define __HAVE_ARCH_STRCMP
23 #define __HAVE_ARCH_STRCPY
24 #define __HAVE_ARCH_STRLEN
25 #define __HAVE_ARCH_STRNCPY
27 #undef __HAVE_ARCH_MEMMOVE
28 #undef __HAVE_ARCH_STRNICMP
29 #undef __HAVE_ARCH_STRNCAT
30 #undef __HAVE_ARCH_STRNCMP
31 #undef __HAVE_ARCH_STRCHR
32 #undef __HAVE_ARCH_STRRCHR
33 #undef __HAVE_ARCH_STRNLEN
34 #undef __HAVE_ARCH_STRSPN
35 #undef __HAVE_ARCH_STRPBRK
36 #undef __HAVE_ARCH_STRTOK
37 #undef __HAVE_ARCH_BCOPY
38 #undef __HAVE_ARCH_MEMCMP
39 #undef __HAVE_ARCH_MEMSCAN
40 #undef __HAVE_ARCH_STRSTR
42 extern void *memset(void *, int, size_t);
43 extern void *memcpy(void *, const void *, size_t);
44 extern void *memmove(void *, const void *, size_t);
45 extern char *strncpy(char *, const char *, size_t);
46 extern int strcmp(const char *,const char *);
48 static inline void * memchr(const void * cs,int c,size_t count)
52 __asm__ __volatile__ (" lgr 0,%2\n"
60 : "=&a" (ptr) : "a" (cs), "d" (c), "d" (count)
65 static __inline__ char *strcpy(char *dest, const char *src)
69 __asm__ __volatile__ (" slgr 0,0\n"
72 : "+&a" (dest), "+&a" (src) :
73 : "cc", "memory", "0" );
77 static __inline__ size_t strlen(const char *s)
81 __asm__ __volatile__ (" slgr 0,0\n"
87 : "=&a" (len) : "a" (s)
92 static __inline__ char *strcat(char *dest, const char *src)
96 __asm__ __volatile__ (" slgr 0,0\n"
103 : "+&a" (dest), "+&a" (src) :
104 : "cc", "memory", "0" );
108 extern void *alloca(size_t);
109 #endif /* __KERNEL__ */
111 #endif /* __S390_STRING_H_ */