blob: 1f312969216228e387d3f09bdc77ec342a1f19af [file] [log] [blame]
swissChili64228692021-03-16 08:19:23 -07001#include "syscall.h"
2#include "log.h"
3#include "pic.h"
swissChili52a03d82021-07-18 15:22:14 -07004#include "task.h"
5
6#include <sys.h>
swissChili64228692021-03-16 08:19:23 -07007
8void do_syscall(struct registers *regs)
9{
swissChili52a03d82021-07-18 15:22:14 -070010 switch (regs->eax)
11 {
12 case SYS_GIVEUP:
13 // easy, just switch tasks
14 switch_task();
15 break;
16
17 default:
18 kprintf(INFO "Syscall executed: %d\n", regs->eax);
19 }
swissChili64228692021-03-16 08:19:23 -070020}
21
22void init_syscall()
23{
24 add_interrupt_handler(SYSCALL_INT, do_syscall);
25}