~ubuntu-branches/debian/experimental/linux-tools/experimental

« back to all changes in this revision

Viewing changes to arch/alpha/include/asm/string.h

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings
  • Date: 2014-02-02 16:57:49 UTC
  • mfrom: (1.1.10) (0.1.21 sid)
  • Revision ID: package-import@ubuntu.com-20140202165749-tw94o9t1t0a8txk6
Tags: 3.13-1~exp2
Merge changes from sid up to 3.12.6-3

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#define __HAVE_ARCH_MEMSET
24
24
extern void * __constant_c_memset(void *, unsigned long, size_t);
 
25
extern void * ___memset(void *, int, size_t);
25
26
extern void * __memset(void *, int, size_t);
26
27
extern void * memset(void *, int, size_t);
27
28
 
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)))
 
29
/* For gcc 3.x, we cannot have the inline function named "memset" because
 
30
   the __builtin_memset will attempt to resolve to the inline as well,
 
31
   leading to a "sorry" about unimplemented recursive inlining.  */
 
32
extern inline void *__memset(void *s, int c, size_t n)
 
33
{
 
34
        if (__builtin_constant_p(c)) {
 
35
                if (__builtin_constant_p(n)) {
 
36
                        return __builtin_memset(s, c, n);
 
37
                } else {
 
38
                        unsigned long c8 = (c & 0xff) * 0x0101010101010101UL;
 
39
                        return __constant_c_memset(s, c8, n);
 
40
                }
 
41
        }
 
42
        return ___memset(s, c, n);
 
43
}
 
44
 
 
45
#define memset __memset
34
46
 
35
47
#define __HAVE_ARCH_STRCPY
36
48
extern char * strcpy(char *,const char *);