summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/lm32/shared/misc/memcpy.c
blob: 5c5762d8ccbae434c4dab8045d4e343a80353171 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 *  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.
 */

#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;
}