kernel: utility: change memcpy back to rep movsb

This commit is contained in:
Benji Dial 2025-12-28 20:15:07 -05:00
parent 35725e0cd0
commit e2188aa407
2 changed files with 11 additions and 21 deletions

View file

@ -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

View file

@ -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) |