summaryrefslogtreecommitdiffstats
path: root/arch/mips/boot/compressed/string.c
blob: 9de9885acd0dbcac06604aa5ce4cc7e0e09ae7b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * arch/mips/boot/compressed/string.c
 *
 * Very small subset of simple string routines
 */

#include <linux/types.h>

void *memcpy(void *dest, const void *src, size_t n)
{
	int i;
	const char *s = src;
	char *d = dest;

	for (i = 0; i < n; i++)
		d[i] = s[i];
	return dest;
}

void *memset(void *s, int c, size_t n)
{
	int i;
	char *ss = s;

	for (i = 0; i < n; i++)
		ss[i] = c;
	return s;
}