1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-10-30 12:03:52 -04:00
kernel/arch/syscall.c

23 lines
504 B
C
Raw Normal View History

2017-11-05 07:44:57 -05:00
#include "interrupt.h"
2017-11-05 22:48:16 -05:00
#include "logger.h"
2017-11-05 04:50:04 -05:00
2017-11-05 12:15:34 -05:00
#include <kernelmq/syscall.h>
static void syscall_do_exit(struct IsrRegisters regs);
void syscall_handler(const struct IsrRegisters regs)
2017-11-05 04:50:04 -05:00
{
2017-11-05 08:54:23 -05:00
const unsigned int id = regs.eax & 0xFFFF;
2017-11-05 04:50:04 -05:00
2017-11-05 12:15:34 -05:00
switch (id) {
case KERNELMQ_SYSCALL_EXIT: return syscall_do_exit(regs);
}
2017-11-05 22:48:16 -05:00
logger_info("syscall %u", id);
2017-11-05 04:50:04 -05:00
}
2017-11-05 12:15:34 -05:00
void syscall_do_exit(const struct IsrRegisters regs)
{
2017-11-05 22:48:16 -05:00
logger_warn("process try to exit with error code %u, haha", regs.ebx & 0xFFFF);
2017-11-05 12:15:34 -05:00
}