feat: added support for waiting on an irq

This commit is contained in:
2021-02-27 15:52:10 +01:00
parent 934deb7984
commit 62ce1dfa77
8 changed files with 126 additions and 22 deletions

View File

@@ -10,6 +10,7 @@
#include <drivers/ports.h>
#include <libc/kprintf.h>
#include <libk/libk.h>
#include <tasks/task.h>
#define PIC_END_OF_INTERRUPT 0x20
@@ -142,6 +143,9 @@ void irq_handler(isr_registers_t r) {
if (r.int_no >= 40) port_byte_out(PORT_PIC_SLAVE_COMMAND, PIC_END_OF_INTERRUPT); /* slave */
port_byte_out(PORT_PIC_MASTER_COMMAND, PIC_END_OF_INTERRUPT); /* master */
if (r.int_no >= IRQ0 && r.int_no < IRQ15) {
task_notify_irq(r.int_no - IRQ0);
}
/* Handle the interrupt in a more modular way */
if (interrupt_handlers[r.int_no] != NULL) {
isr_t handler = interrupt_handlers[r.int_no];