aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/asm/string.h')
-rw-r--r--arch/s390/include/asm/string.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/s390/include/asm/string.h b/arch/s390/include/asm/string.h
index adf079170aa6..cd0241db5a46 100644
--- a/arch/s390/include/asm/string.h
+++ b/arch/s390/include/asm/string.h
@@ -100,6 +100,7 @@ static inline char *strcat(char *dst, const char *src)
100 100
101static inline char *strcpy(char *dst, const char *src) 101static inline char *strcpy(char *dst, const char *src)
102{ 102{
103#if __GNUC__ < 4
103 register int r0 asm("0") = 0; 104 register int r0 asm("0") = 0;
104 char *ret = dst; 105 char *ret = dst;
105 106
@@ -109,10 +110,14 @@ static inline char *strcpy(char *dst, const char *src)
109 : "+&a" (dst), "+&a" (src) : "d" (r0) 110 : "+&a" (dst), "+&a" (src) : "d" (r0)
110 : "cc", "memory"); 111 : "cc", "memory");
111 return ret; 112 return ret;
113#else
114 return __builtin_strcpy(dst, src);
115#endif
112} 116}
113 117
114static inline size_t strlen(const char *s) 118static inline size_t strlen(const char *s)
115{ 119{
120#if __GNUC__ < 4
116 register unsigned long r0 asm("0") = 0; 121 register unsigned long r0 asm("0") = 0;
117 const char *tmp = s; 122 const char *tmp = s;
118 123
@@ -121,6 +126,9 @@ static inline size_t strlen(const char *s)
121 " jo 0b" 126 " jo 0b"
122 : "+d" (r0), "+a" (tmp) : : "cc"); 127 : "+d" (r0), "+a" (tmp) : : "cc");
123 return r0 - (unsigned long) s; 128 return r0 - (unsigned long) s;
129#else
130 return __builtin_strlen(s);
131#endif
124} 132}
125 133
126static inline size_t strnlen(const char * s, size_t n) 134static inline size_t strnlen(const char * s, size_t n)