kernel: utility: change memcpy back to rep movsb
This commit is contained in:
parent
35725e0cd0
commit
e2188aa407
2 changed files with 11 additions and 21 deletions
|
|
@ -20,15 +20,15 @@ default rel
|
||||||
|
|
||||||
section .text
|
section .text
|
||||||
|
|
||||||
;global memcpy
|
global memcpy
|
||||||
;memcpy:
|
memcpy:
|
||||||
; mov rcx, rdx
|
mov rcx, rdx
|
||||||
; rep movsb
|
rep movsb
|
||||||
; ret
|
ret
|
||||||
|
|
||||||
;global memzero
|
global memzero
|
||||||
;memzero:
|
memzero:
|
||||||
; xor al, al
|
xor al, al
|
||||||
; mov rcx, rsi
|
mov rcx, rsi
|
||||||
; rep stosb
|
rep stosb
|
||||||
; ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
uint32_t end_swap_u32(uint32_t value) {
|
||||||
return
|
return
|
||||||
(value >> 24) |
|
(value >> 24) |
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue