POK(kernelpart)
libc.h File Reference
#include <types.h>

Go to the source code of this file.

Functions

void * memcpy (void *to, const void *from, size_t n)
void * memset (void *dest, unsigned char val, size_t count)
int strlen (const char *str)
int strcmp (const char *s1, const char *s2)
int strncmp (const char *s1, const char *s2, size_t size)

Function Documentation

void* memcpy ( void *  to,
const void *  from,
size_t  n 
)

Definition at line 20 of file memcpy.c.

{
#ifdef __i386__
int d0;
int d1;
int d2;
__asm__ __volatile__(
"rep ; movsl\n\t"
"testb $2,%b4\n\t"
"je 1f\n\t"
"movsw\n"
"1:\ttestb $1,%b4\n\t"
"je 2f\n\t"
"movsb\n"
"2:"
: "=&c" (d0), "=&D" (d1), "=&S" (d2)
:"0" (n/4), "q" (n),"1" ((long) to),"2" ((long) from)
: "memory");
#else
char *cto = (char *)to;
const char *cfrom = (const char *)from;
for (; n > 0; n--)
{
*cto++ = *cfrom++;
}
#endif
return (to);
}
void* memset ( void *  dest,
unsigned char  val,
size_t  count 
)
int strcmp ( const char *  s1,
const char *  s2 
)
int strlen ( const char *  str)
int strncmp ( const char *  s1,
const char *  s2,
size_t  size 
)