From 278ac9f8169dcd5e8f363762e49a0c9c0553d04f Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Fri, 29 Jun 2018 23:23:40 +0200 Subject: [PATCH] Rename IRQ exception base addr --- irq.c | 2 +- irq.h | 2 +- pic.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/irq.c b/irq.c index 7fe27f4..09ee6b2 100644 --- a/irq.c +++ b/irq.c @@ -23,7 +23,7 @@ int irqSetRoutine(int irq, irq_handler handler) if (handler != NULL) { int ret = - idt_set_handler(IRQ_BASE_ADDRESS + irq, (unsigned int)irq_handler_array[irq], 0); + idt_set_handler(IRQ_INTERRUPT_BASE_ADDRESS + irq, (unsigned int)irq_handler_array[irq], 0); if (!ret) enableIrq(irq); } diff --git a/irq.h b/irq.h index 6277e81..50c554f 100644 --- a/irq.h +++ b/irq.h @@ -28,7 +28,7 @@ #define IRQ_HARDDISK 14 #define IRQ_RESERVED_5 15 -#define IRQ_BASE_ADDRESS 0x20 +#define IRQ_INTERRUPT_BASE_ADDRESS 0x20 #define IRQ_NUM 16 // An handler should finish by the iret opcode -> https://wiki.osdev.org/Interrupt_Service_Routines diff --git a/pic.c b/pic.c index 844d55a..a3a3fa4 100644 --- a/pic.c +++ b/pic.c @@ -23,8 +23,8 @@ void initPic(void) /* Send ICW2: ctrl base address. Remap IRQ from interupt range 0x0-0xF to 0x20-0x2F as * intel * reserve interupt 0x0-0x1F in protected mode (e.g. 0-7 are CPU exception) */ - outb(IRQ_BASE_ADDRESS, PIC_MASTER_DATA); - outb(IRQ_BASE_ADDRESS + 8, PIC_SLAVE_DATA); + outb(IRQ_INTERRUPT_BASE_ADDRESS, PIC_MASTER_DATA); + outb(IRQ_INTERRUPT_BASE_ADDRESS + 8, PIC_SLAVE_DATA); /* Send ICW3 master: mask where slaves are connected */ outb(0x4, PIC_MASTER_DATA);