summaryrefslogtreecommitdiff
path: root/src/kernel/arch/amd64/interrupts
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/arch/amd64/interrupts')
-rw-r--r--src/kernel/arch/amd64/interrupts/irq.c5
-rw-r--r--src/kernel/arch/amd64/interrupts/irq.h2
-rw-r--r--src/kernel/arch/amd64/interrupts/isr.c6
3 files changed, 11 insertions, 2 deletions
diff --git a/src/kernel/arch/amd64/interrupts/irq.c b/src/kernel/arch/amd64/interrupts/irq.c
index 1760825..818ea8e 100644
--- a/src/kernel/arch/amd64/interrupts/irq.c
+++ b/src/kernel/arch/amd64/interrupts/irq.c
@@ -24,11 +24,12 @@ void irq_init(void) {
port_out8(PIC2+1, 0x1);
uint16_t mask = 0xffff;
- mask &= ~(1 << IRQ_PIT);
mask &= ~(1 << 2); // cascade
- mask &= ~(1 << IRQ_PS2KB);
mask &= ~(1 << IRQ_COM1);
+ mask &= ~(1 << IRQ_PIT);
+ mask &= ~(1 << IRQ_PS2KB);
mask &= ~(1 << IRQ_PS2MOUSE);
+ mask &= ~(1 << IRQ_RTL8139);
port_out8(PIC1+1, mask & 0xff);
port_out8(PIC2+1, (mask >> 8) & 0xff);
diff --git a/src/kernel/arch/amd64/interrupts/irq.h b/src/kernel/arch/amd64/interrupts/irq.h
index 3243224..f949824 100644
--- a/src/kernel/arch/amd64/interrupts/irq.h
+++ b/src/kernel/arch/amd64/interrupts/irq.h
@@ -8,5 +8,7 @@
#define IRQ_COM1 4
#define IRQ_PS2MOUSE 12
+#define IRQ_RTL8139 11
+
void irq_init(void);
void irq_eoi(uint8_t line);
diff --git a/src/kernel/arch/amd64/interrupts/isr.c b/src/kernel/arch/amd64/interrupts/isr.c
index d1c2b26..17dce6e 100644
--- a/src/kernel/arch/amd64/interrupts/isr.c
+++ b/src/kernel/arch/amd64/interrupts/isr.c
@@ -1,4 +1,5 @@
#include <kernel/arch/amd64/driver/ps2.h>
+#include <kernel/arch/amd64/driver/rtl8139.h>
#include <kernel/arch/amd64/driver/serial.h>
#include <kernel/arch/amd64/interrupts/irq.h>
#include <kernel/arch/amd64/interrupts/isr.h>
@@ -45,6 +46,11 @@ void isr_stage3(int interrupt, uint64_t *stackframe) {
irq_eoi(IRQ_COM1);
return;
+ case IRQ_IBASE + IRQ_RTL8139:
+ rtl8139_irq();
+ irq_eoi(interrupt - IRQ_IBASE);
+ return;
+
default:
if ((stackframe[1] & 0x3) == 0) {
log_interrupt(interrupt, stackframe);