diff options
| author | Amlal <amlal@nekernel.org> | 2025-08-17 18:12:58 +0200 |
|---|---|---|
| committer | Amlal <amlal@nekernel.org> | 2025-08-17 18:12:58 +0200 |
| commit | db1d0e53cc21678ace07b72652ed7b3b1054da30 (patch) | |
| tree | 608e26b598e99b28727b42a17f2234871536f040 | |
| parent | 0814d36b8b2849c73e7585b79588a34df9aacdc5 (diff) | |
feat: libSystem/SystemProc.asm: Move r8, to rax, cleanup rax
before entering calling system call handler too.
Signed-off-by: Amlal <amlal@nekernel.org>
| -rw-r--r-- | dev/libSystem/src/SystemProc.asm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/dev/libSystem/src/SystemProc.asm b/dev/libSystem/src/SystemProc.asm index 299b59f9..8adcea0b 100644 --- a/dev/libSystem/src/SystemProc.asm +++ b/dev/libSystem/src/SystemProc.asm @@ -1,7 +1,7 @@ ;; /* ;; * ======================================================== ;; * -;; * libSystem/src/SystemCalls+IO.asm +;; * libSystem/src/SystemProc.asm ;; * Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. ;; * ;; * ======================================================== @@ -22,6 +22,8 @@ libsys_syscall_arg_1: mov r8, rcx + xor rax, rax + int 50 pop rbp @@ -34,7 +36,9 @@ libsys_syscall_arg_2: mov r8, rcx mov r9, rdx - + + xor rax, rax + int 50 pop rbp @@ -49,6 +53,8 @@ libsys_syscall_arg_3: mov r9, rdx mov r10, rbx + xor rax, rax + int 50 pop rbp @@ -59,11 +65,15 @@ libsys_syscall_arg_4: push rbp mov rbp, rsp + mov rax, r8 + mov r8, rcx mov r9, rdx mov r10, rbx mov r11, rax + xor rax, rax + int 50 pop rbp |
