Syscall args

This commit is contained in:
Adrien Bourmault 2021-03-04 18:05:20 +01:00
parent 999f41f3c2
commit bc2e1f80d3
Signed by: neox
GPG Key ID: 6EB408FE0ACEC664
4 changed files with 15 additions and 13 deletions

View File

@ -35,7 +35,8 @@ extern error_t KeSyscall(ulong code);
extern void KeJumpToUserspace(ulong args, void *entryPoint, void *stackAddr);
error_t _KeSyscallHandler(ulong code, ISRFrame_t *regs);
error_t _KeSyscallHandler( ulong code, void *arg0, void *arg1, void *arg2,
ISRFrame_t *regs );
//----------------------------------------------------------------------------//

View File

@ -68,7 +68,7 @@ isrPreHandler:
add rsp, 48
; pop registers
popAll
; pop the error code and interrupt id
; pop the error code, interrupt id + crx
add rsp, 16
iretq

View File

@ -41,13 +41,13 @@ syscallPreHandler:
push r13
push r12
push r11
push 0
push 0 ; r10
push r9
push r8
push rbp
push 0
push 0
push 0
push 0 ; rdi
push 0 ; rsi
push 0 ; rdx
push rcx
push rbx
push rax
@ -76,21 +76,21 @@ syscallPreHandler:
add rsp, 48
; pop registers except return value
pop rbx
pop rbx ; 2x rbx to discard rax
pop rbx ; 2x rbx to discard old rax
pop rcx
pop rdx
pop rsi
pop rdi
pop rdx ; 0
pop rsi ; 0
pop rdi ; 0
pop rbp
pop r8
pop r9
pop r10
pop r10 ; 0
pop r11
pop r12
pop r13
pop r14
pop r15
; pop the error code and interrupt id
; pop the error code, interrupt id + crx
add rsp, 16
iretq

View File

@ -27,7 +27,8 @@
#include <ke/idt.h>
#include <io/vga.h>
error_t _KeSyscallHandler(ulong code, ISRFrame_t *regs)
error_t _KeSyscallHandler( ulong code, void *arg0, void *arg1, void *arg2,
ISRFrame_t *regs )
{
DebugLog("Got a system call code %ld from cs %#x\n", code, regs->cs);