diff --git a/src/kernel/utility.asm b/src/kernel/utility.asm index f8e6342..c8e0b98 100644 --- a/src/kernel/utility.asm +++ b/src/kernel/utility.asm @@ -20,15 +20,15 @@ default rel section .text -;global memcpy -;memcpy: -; mov rcx, rdx -; rep movsb -; ret +global memcpy +memcpy: + mov rcx, rdx + rep movsb + ret -;global memzero -;memzero: -; xor al, al -; mov rcx, rsi -; rep stosb -; ret +global memzero +memzero: + xor al, al + mov rcx, rsi + rep stosb + ret diff --git a/src/kernel/utility.c b/src/kernel/utility.c index 605619f..944ede5 100644 --- a/src/kernel/utility.c +++ b/src/kernel/utility.c @@ -28,16 +28,6 @@ int strequ(const char *str1, const char *str2) { } } -void memcpy(void *to, const void *from, uint64_t bytes) { - for (uint64_t i = 0; i < bytes; ++i) - *(uint8_t *)(to + i) = *(const uint8_t *)(from + i); -} - -void memzero(void *start, uint64_t bytes) { - for (uint64_t i = 0; i < bytes; ++i) - *(uint8_t *)(start + i) = 0; -} - uint32_t end_swap_u32(uint32_t value) { return (value >> 24) |