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
|
||||
|
||||
;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
|
||||
|
|
|
|||
|
|
@ -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) |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue