mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2024-10-27 20:34:19 +00:00
14 lines
281 B
C
14 lines
281 B
C
#include "mem.h"
|
|
|
|
void memory_copy(u8 *source, u8 *dest, int nbytes) {
|
|
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;
|
|
}
|