From 2ce0f8af51dae9e7d591ff5fd038f89d6ca9dbbe Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Sat, 24 Feb 2024 14:44:38 -0600 Subject: arch: i386: cleanup everything and reorganize Clean up everything in the i386 arch directory. This code has been in dire need of refactoring for a long while. All the inline assembly functions and the data structures related to the architecture should be placed into their own header file. Now the scheduler can access registers and ISRs without having to deal with arch-specific code. Signed-off-by: Danny Holman --- arch/i386/include/kernel/pic.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'arch/i386/include/kernel/pic.h') diff --git a/arch/i386/include/kernel/pic.h b/arch/i386/include/kernel/pic.h index ca3cc99..2b757ee 100644 --- a/arch/i386/include/kernel/pic.h +++ b/arch/i386/include/kernel/pic.h @@ -1,8 +1,7 @@ #ifndef I386_PIC_H #define I386_PIC_H -#include -#include +#include #include #define PIC1 0x20 @@ -27,16 +26,6 @@ #define PIC_READ_IRR 0x0A #define PIC_READ_ISR 0x0B -static inline void outb(uint16_t port, uint8_t value) { - __asm__ volatile("outb %0, %1" : : "a"(value), "Nd"(port)); -} - -static inline uint8_t inb(uint16_t port) { - uint8_t ret; - __asm__ volatile("inb %1, %0" : "=a"(ret) : "Nd"(port)); - return ret; -} - static inline void io_wait(void) { outb(0x80, 0); } @@ -46,8 +35,8 @@ void pic_remap(void); uint16_t pic_get_irr(void); uint16_t pic_get_isr(void); -void register_irq_handler(uint8_t irq, void (*handler)(struct isr_frame *frame)); -void irq_dispatch(struct isr_frame *frame); +void register_irq_handler(uint8_t irq, void (*handler)(struct regs *regs)); +void irq_dispatch(struct regs *regs); void irq_set_mask(uint8_t irq); void irq_clear_mask(uint8_t irq); -- cgit v1.2.3