mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
x86_64 syscall: fix interrupts and fix return logging
This commit is contained in:
@@ -115,6 +115,7 @@ arch_syscall_entry:
|
||||
|
||||
; call logging function
|
||||
|
||||
sti
|
||||
mov rdi, rax
|
||||
extern arch_syscall_log
|
||||
call arch_syscall_log ; compiled with __attribute__((no_caller_saved_registers))
|
||||
@@ -122,7 +123,6 @@ arch_syscall_entry:
|
||||
; prepare context argument
|
||||
mov rdi, rsp
|
||||
add rdi, 8 ; context pointer is after r9 argument
|
||||
sti
|
||||
|
||||
cmp rax, syscallcount
|
||||
jae .nosyscall
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <logging.h>
|
||||
#include <arch/e9.h>
|
||||
#include <arch/cpu.h>
|
||||
|
||||
#define SYSCALL_COUNT 23
|
||||
#define LOGSTR(x) arch_e9_puts(x)
|
||||
@@ -69,7 +70,7 @@ __attribute__((no_caller_saved_registers)) void arch_syscall_log(int syscall, ui
|
||||
LOGSTR(printbuff);
|
||||
}
|
||||
|
||||
__attribute__((no_caller_saved_registers)) void arch_syscall_log_return(int syscall, uint64_t ret, uint64_t errno) {
|
||||
__attribute__((no_caller_saved_registers)) void arch_syscall_log_return(uint64_t ret, uint64_t errno) {
|
||||
char printbuff[1024];
|
||||
|
||||
thread_t *thread = _cpu()->thread;
|
||||
|
||||
Reference in New Issue
Block a user