2021-11-03 23:54:36 +01:00
|
|
|
#include "assert.h"
|
2021-11-02 21:47:05 +01:00
|
|
|
#include "swintr.h"
|
2021-10-25 23:25:31 +02:00
|
|
|
#include "irq.h"
|
|
|
|
#include "idt.h"
|
|
|
|
|
|
|
|
extern void syscallHandler();
|
|
|
|
|
|
|
|
int syscallSetup(){
|
|
|
|
uint32_t flags, ret;
|
|
|
|
|
|
|
|
disable_IRQs(flags);
|
2021-11-03 23:54:36 +01:00
|
|
|
ret = idt_set_handler(SYSCALL_INTR_NB, (vaddr_t)syscallHandler, 3);
|
2021-10-25 23:25:31 +02:00
|
|
|
restore_IRQs(flags);
|
|
|
|
|
2021-11-03 23:54:36 +01:00
|
|
|
assert(ret == 0);
|
2021-10-25 23:25:31 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|