x86_64 syscall: fix interrupts and fix return logging

This commit is contained in:
Matheus
2023-07-03 22:39:17 -03:00
parent 63e971bb70
commit 3839136009
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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
+2 -1
View File
@@ -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;