mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
kernel: user safe strlen
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
section .text:
|
||||
|
||||
global arch_u_strlen
|
||||
global arch_u_strlen_cont
|
||||
|
||||
arch_u_strlen:
|
||||
xor rcx, rcx
|
||||
.loop:
|
||||
cmp byte [rdi],0
|
||||
je .done
|
||||
inc rcx
|
||||
inc rdi
|
||||
.done:
|
||||
mov [rsi], rcx
|
||||
xor rax, rax
|
||||
ret
|
||||
arch_u_strlen_cont:
|
||||
mov rax, 1
|
||||
ret
|
||||
Reference in New Issue
Block a user