File: memcpy.c

package info (click to toggle)
aboot 0.9b-3
  • links: PTS
  • area: main
  • in suites: etch-m68k, sarge
  • size: 984 kB
  • ctags: 1,659
  • sloc: ansic: 8,970; perl: 738; makefile: 382; asm: 309; sh: 3
file content (22 lines) | stat: -rw-r--r-- 454 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 *  aboot/lib/memcpy.c
 *
 *  Copyright (c) 1995  David Mosberger (davidm@cs.arizona.edu)
 */
#include <linux/types.h>

/*
 * Booting is I/O bound so rather than a time-optimized, we want
 * a space-optimized memcpy.  Not that the rest of the loader
 * were particularly small, though...
 */
void *__memcpy(void *dest, const void *source, size_t n)
{
	char *dst = dest;
	const char *src = source;

	while (n--) {
		*dst++ = *src++;
	}
	return dest;
}