Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Antony Pavlov | dc4d7b3 | 2014-01-14 01:30:56 +0400 | [diff] [blame] | 2 | /* |
| 3 | * arch/mips/boot/compressed/string.c |
| 4 | * |
| 5 | * Very small subset of simple string routines |
| 6 | */ |
| 7 | |
| 8 | #include <linux/types.h> |
| 9 | |
| 10 | void *memcpy(void *dest, const void *src, size_t n) |
| 11 | { |
| 12 | int i; |
| 13 | const char *s = src; |
| 14 | char *d = dest; |
| 15 | |
| 16 | for (i = 0; i < n; i++) |
| 17 | d[i] = s[i]; |
| 18 | return dest; |
| 19 | } |
| 20 | |
| 21 | void *memset(void *s, int c, size_t n) |
| 22 | { |
| 23 | int i; |
| 24 | char *ss = s; |
| 25 | |
| 26 | for (i = 0; i < n; i++) |
| 27 | ss[i] = c; |
| 28 | return s; |
| 29 | } |