diff options
author | Tyler Murphy <=> | 2023-07-17 19:34:52 -0400 |
---|---|---|
committer | Tyler Murphy <=> | 2023-07-17 19:34:52 -0400 |
commit | 7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5 (patch) | |
tree | 4e86ff20e73171285156631db043e12aaf63bf04 /kernel/src/arch/i686/pic.c | |
parent | paging (diff) | |
download | finix-7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5.tar.gz finix-7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5.tar.bz2 finix-7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5.zip |
refactoring
Diffstat (limited to '')
-rw-r--r-- | kernel/src/arch/i686/pic.c (renamed from kernel/src/interrupt/pic.c) | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/kernel/src/interrupt/pic.c b/kernel/src/arch/i686/pic.c index 86056a1..f5d0f94 100644 --- a/kernel/src/interrupt/pic.c +++ b/kernel/src/arch/i686/pic.c @@ -1,17 +1,14 @@ #include <sys.h> #include <print.h> - -#include "pic.h" +#include <arch/i686/pic.h> +#include <arch/i686/asm.h> #define PIC1_COMMAND_PORT 0x20 #define PIC1_DATA_PORT 0x21 #define PIC2_COMMAND_PORT 0xA0 #define PIC2_DATA_PORT 0xA1 -void pic_remap(uint8_t offset) { - - debugk("Remapping PIC"); - +void pic_remap(void) { char a1 = inb(PIC1_DATA_PORT); char a2 = inb(PIC2_DATA_PORT); // control word 1 @@ -22,9 +19,9 @@ void pic_remap(uint8_t offset) { io_wait(); // control word 2 // interrupt offset - outb(PIC1_DATA_PORT, offset); + outb(PIC1_DATA_PORT, PIC_REMAP_OFFSET); io_wait(); - outb(PIC2_DATA_PORT, offset + 8); + outb(PIC2_DATA_PORT, PIC_REMAP_OFFSET + 8); io_wait(); // control word 3 // primary pic: set which pin secondary is connected to @@ -42,8 +39,6 @@ void pic_remap(uint8_t offset) { // clear data registers outb(PIC1_DATA_PORT, a1); outb(PIC2_DATA_PORT, a2); - - succek("PIC has been remapped to offset 0x%X", offset); } void pic_mask(int irq) { |