blob: 5ad2ee6f4b1a055d4437c94c8dbeb35f3f81564d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <sched/scheduler.h>
#include <syscalls.h>
process_t *tmp;
void *handler;
void jump_signal_handler(void *func, u32 esp);
void test_handler(reg_t *regs) {
tmp->interrupt_handler = handler;
signal_t sig;
sig.handler_ip = (uintptr_t)handler;
process_push_signal(tmp, sig);
return;
}
int syscall_install_irq(void (*irq_handler)(), u8 irq) {
// TODO: This should be able to fail if the handler is already set
tmp = current_task;
handler = irq_handler;
install_handler(test_handler, INT_32_INTERRUPT_GATE(0x0), 0x20 + irq);
return 1;
}
|