cfenollosa_os-tutorial/21-shell/libc/mem.c

14 lines
281 B
C
Raw Normal View History

2015-03-20 18:20:44 +00:00
#include "mem.h"
2015-03-23 15:08:34 +00:00
void memory_copy(u8 *source, u8 *dest, int nbytes) {
2015-03-20 18:20:44 +00:00
int i;
for (i = 0; i < nbytes; i++) {
*(dest + i) = *(source + i);
}
}
void memory_set(u8 *dest, u8 val, u32 len) {
u8 *temp = (u8 *)dest;
for ( ; len != 0; len--) *temp++ = val;
}