mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +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
|
; call logging function
|
||||||
|
|
||||||
|
sti
|
||||||
mov rdi, rax
|
mov rdi, rax
|
||||||
extern arch_syscall_log
|
extern arch_syscall_log
|
||||||
call arch_syscall_log ; compiled with __attribute__((no_caller_saved_registers))
|
call arch_syscall_log ; compiled with __attribute__((no_caller_saved_registers))
|
||||||
@@ -122,7 +123,6 @@ arch_syscall_entry:
|
|||||||
; prepare context argument
|
; prepare context argument
|
||||||
mov rdi, rsp
|
mov rdi, rsp
|
||||||
add rdi, 8 ; context pointer is after r9 argument
|
add rdi, 8 ; context pointer is after r9 argument
|
||||||
sti
|
|
||||||
|
|
||||||
cmp rax, syscallcount
|
cmp rax, syscallcount
|
||||||
jae .nosyscall
|
jae .nosyscall
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
#include <arch/e9.h>
|
#include <arch/e9.h>
|
||||||
|
#include <arch/cpu.h>
|
||||||
|
|
||||||
#define SYSCALL_COUNT 23
|
#define SYSCALL_COUNT 23
|
||||||
#define LOGSTR(x) arch_e9_puts(x)
|
#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);
|
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];
|
char printbuff[1024];
|
||||||
|
|
||||||
thread_t *thread = _cpu()->thread;
|
thread_t *thread = _cpu()->thread;
|
||||||
|
|||||||
Reference in New Issue
Block a user