OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-x86_64/] [string.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#ifndef _X86_64_STRING_H_
2
#define _X86_64_STRING_H_
3
 
4
#ifdef __KERNEL__
5
 
6
#define struct_cpy(x,y) (*(x)=*(y))
7
 
8
/* Written 2002 by Andi Kleen */
9
 
10
/* Only used for special circumstances. Stolen from i386/string.h */
11
static inline void * __inline_memcpy(void * to, const void * from, size_t n)
12
{
13
unsigned long d0, d1, d2;
14
__asm__ __volatile__(
15
        "rep ; movsl\n\t"
16
        "testb $2,%b4\n\t"
17
        "je 1f\n\t"
18
        "movsw\n"
19
        "1:\ttestb $1,%b4\n\t"
20
        "je 2f\n\t"
21
        "movsb\n"
22
        "2:"
23
        : "=&c" (d0), "=&D" (d1), "=&S" (d2)
24
        :"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from)
25
        : "memory");
26
return (to);
27
}
28
 
29
/* Even with __builtin_ the compiler may decide to use the out of line
30
   function. */
31
 
32
#define __HAVE_ARCH_MEMCPY 1
33
extern void *__memcpy(void *to, const void *from, size_t len);
34
#define memcpy(dst,src,len) \
35
        ({ size_t __len = (len);                                \
36
           void *__ret;                                         \
37
           if (__builtin_constant_p(len) && __len >= 64)        \
38
                 __ret = __memcpy((dst),(src),__len);           \
39
           else                                                 \
40
                 __ret = __builtin_memcpy((dst),(src),__len);   \
41
           __ret; })
42
 
43
 
44
#define __HAVE_ARCH_MEMSET
45
#define memset __builtin_memset
46
 
47
#define __HAVE_ARCH_MEMMOVE
48
void * memmove(void * dest,const void *src,size_t count);
49
 
50
#endif /* __KERNEL__ */
51
 
52
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.