diff options
-rw-r--r-- | sys/arch/amd64/amd64/ioapic.c | 11 | ||||
-rw-r--r-- | sys/include/arch/amd64/ioapic.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/ioapic.c b/sys/arch/amd64/amd64/ioapic.c index b4d5f51..ffc732d 100644 --- a/sys/arch/amd64/amd64/ioapic.c +++ b/sys/arch/amd64/amd64/ioapic.c @@ -168,6 +168,17 @@ ioapic_set_base(void *mmio_base) } void +ioapic_set_vec(uint8_t irq, uint8_t vector) +{ + union ioapic_redentry redentry; + uint8_t gsi = irq_to_gsi(irq); + + ioapic_read_redentry(&redentry, gsi); + redentry.vector = vector; + ioapic_write_redentry(&redentry, gsi); +} + +void ioapic_init(void) { size_t tmp; diff --git a/sys/include/arch/amd64/ioapic.h b/sys/include/arch/amd64/ioapic.h index 54051cd..890f375 100644 --- a/sys/include/arch/amd64/ioapic.h +++ b/sys/include/arch/amd64/ioapic.h @@ -37,6 +37,7 @@ void ioapic_irq_unmask(uint8_t irq); void ioapic_gsi_mask(uint8_t irq); void ioapic_gsi_unmask(uint8_t irq); void ioapic_set_base(void *mmio_base); +void ioapic_set_vec(uint8_t irq, uint8_t vector); void ioapic_init(void); #endif /* !_AMD64_IOAPIC_H_ */ |