proc_quit () and proc_test () syscalls
All checks were successful
Build documentation / build-and-deploy (push) Successful in 43s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 43s
This commit is contained in:
@@ -1,14 +1,37 @@
|
||||
#include <amd64/gdt.h>
|
||||
#include <amd64/intr.h>
|
||||
#include <amd64/mm.h>
|
||||
#include <amd64/msr-index.h>
|
||||
#include <amd64/msr.h>
|
||||
#include <proc/proc.h>
|
||||
#include <sys/debug.h>
|
||||
#include <sys/smp.h>
|
||||
#include <syscall/defs.h>
|
||||
#include <syscall/syscall.h>
|
||||
|
||||
extern void amd64_syscall_entry (void);
|
||||
|
||||
void amd64_syscall_dispatch (void* stack_ptr) {
|
||||
int amd64_syscall_dispatch (void* stack_ptr) {
|
||||
struct saved_regs* regs = stack_ptr;
|
||||
DEBUG ("hello syscall\n");
|
||||
|
||||
amd64_load_kernel_cr3 ();
|
||||
|
||||
int syscall_num = regs->rax;
|
||||
syscall_handler_func_t func = syscall_find_handler (syscall_num);
|
||||
|
||||
if (func == NULL)
|
||||
return -SR_SYSCALL_NOT_FOUND;
|
||||
|
||||
struct proc* caller = thiscpu->proc_current;
|
||||
|
||||
__asm__ volatile ("sti");
|
||||
|
||||
int result = func (caller, regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8, regs->r9);
|
||||
|
||||
__asm__ volatile ("cli");
|
||||
return 0;
|
||||
|
||||
/* return result; */
|
||||
}
|
||||
|
||||
void syscall_init (void) {
|
||||
|
||||
Reference in New Issue
Block a user