diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-alpha/string.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-alpha/string.h')
-rw-r--r-- | include/asm-alpha/string.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/include/asm-alpha/string.h b/include/asm-alpha/string.h new file mode 100644 index 000000000000..9e44fea669bf --- /dev/null +++ b/include/asm-alpha/string.h | |||
@@ -0,0 +1,68 @@ | |||
1 | #ifndef __ALPHA_STRING_H__ | ||
2 | #define __ALPHA_STRING_H__ | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | /* | ||
7 | * GCC of any recent vintage doesn't do stupid things with bcopy. | ||
8 | * EGCS 1.1 knows all about expanding memcpy inline, others don't. | ||
9 | * | ||
10 | * Similarly for a memset with data = 0. | ||
11 | */ | ||
12 | |||
13 | #define __HAVE_ARCH_MEMCPY | ||
14 | extern void * memcpy(void *, const void *, size_t); | ||
15 | #define __HAVE_ARCH_MEMMOVE | ||
16 | extern void * memmove(void *, const void *, size_t); | ||
17 | |||
18 | /* For backward compatibility with modules. Unused otherwise. */ | ||
19 | extern void * __memcpy(void *, const void *, size_t); | ||
20 | |||
21 | #define memcpy __builtin_memcpy | ||
22 | |||
23 | #define __HAVE_ARCH_MEMSET | ||
24 | extern void * __constant_c_memset(void *, unsigned long, size_t); | ||
25 | extern void * __memset(void *, int, size_t); | ||
26 | extern void * memset(void *, int, size_t); | ||
27 | |||
28 | #define memset(s, c, n) \ | ||
29 | (__builtin_constant_p(c) \ | ||
30 | ? (__builtin_constant_p(n) && (c) == 0 \ | ||
31 | ? __builtin_memset((s),0,(n)) \ | ||
32 | : __constant_c_memset((s),0x0101010101010101UL*(unsigned char)(c),(n))) \ | ||
33 | : __memset((s),(c),(n))) | ||
34 | |||
35 | #define __HAVE_ARCH_STRCPY | ||
36 | extern char * strcpy(char *,const char *); | ||
37 | #define __HAVE_ARCH_STRNCPY | ||
38 | extern char * strncpy(char *, const char *, size_t); | ||
39 | #define __HAVE_ARCH_STRCAT | ||
40 | extern char * strcat(char *, const char *); | ||
41 | #define __HAVE_ARCH_STRNCAT | ||
42 | extern char * strncat(char *, const char *, size_t); | ||
43 | #define __HAVE_ARCH_STRCHR | ||
44 | extern char * strchr(const char *,int); | ||
45 | #define __HAVE_ARCH_STRRCHR | ||
46 | extern char * strrchr(const char *,int); | ||
47 | #define __HAVE_ARCH_STRLEN | ||
48 | extern size_t strlen(const char *); | ||
49 | #define __HAVE_ARCH_MEMCHR | ||
50 | extern void * memchr(const void *, int, size_t); | ||
51 | |||
52 | /* The following routine is like memset except that it writes 16-bit | ||
53 | aligned values. The DEST and COUNT parameters must be even for | ||
54 | correct operation. */ | ||
55 | |||
56 | #define __HAVE_ARCH_MEMSETW | ||
57 | extern void * __memsetw(void *dest, unsigned short, size_t count); | ||
58 | |||
59 | #define memsetw(s, c, n) \ | ||
60 | (__builtin_constant_p(c) \ | ||
61 | ? __constant_c_memset((s),0x0001000100010001UL*(unsigned short)(c),(n)) \ | ||
62 | : __memsetw((s),(c),(n))) | ||
63 | |||
64 | extern int strcasecmp(const char *, const char *); | ||
65 | |||
66 | #endif /* __KERNEL__ */ | ||
67 | |||
68 | #endif /* __ALPHA_STRING_H__ */ | ||