summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/lm32/shared/misc/memcpy.c
blob: 868b736930f59d79e42e4f979f7ea5bc63ed52d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 *  C library memcpy routine
 *
 *  This routine shall get code to optimize performance on NIOS II
 *
 *  The routine is placed in this source directory to ensure that it
 *  is picked up by all applications.
 *
 *  $Id$
 */

#include <string.h>

void *
memcpy(void *s1, const void *s2, size_t n)
{
  char *p1 = s1;
  const char *p2 = s2;
  size_t left = n;

  while(left > 0) *(p1++) = *(p2++);
    return s1;
}