diff options
author | Marvin Borner | 2020-05-06 19:04:05 +0200 |
---|---|---|
committer | Marvin Borner | 2020-05-06 19:04:05 +0200 |
commit | d94ffac4a584dc7a4f6f2ec567b8caab05ce9253 (patch) | |
tree | 559cd596a0a407d4b40c1d12d3c6a0686494da16 /src/kernel/interrupts | |
parent | 1a8563a05608b5b5e27eada44cf4790926001c68 (diff) |
New build parameters and shared includes
This changes many files but I've just applied some replace commands.. So
- nothing special!
Diffstat (limited to 'src/kernel/interrupts')
-rw-r--r-- | src/kernel/interrupts/idt.c | 20 | ||||
-rw-r--r-- | src/kernel/interrupts/interrupts.h | 4 | ||||
-rw-r--r-- | src/kernel/interrupts/irq.c | 6 | ||||
-rw-r--r-- | src/kernel/interrupts/isr.c | 24 |
4 files changed, 27 insertions, 27 deletions
diff --git a/src/kernel/interrupts/idt.c b/src/kernel/interrupts/idt.c index 4be3d7c..532435a 100644 --- a/src/kernel/interrupts/idt.c +++ b/src/kernel/interrupts/idt.c @@ -1,12 +1,12 @@ -#include <kernel/lib/lib.h> -#include <kernel/system.h> +#include <lib/lib.h> +#include <system.h> struct idt_entry { - uint16_t base_low; - uint16_t sel; // Kernel segment - uint8_t always0; // Always 0 - uint8_t flags; - uint16_t base_high; + u16 base_low; + u16 sel; // Kernel segment + u8 always0; // Always 0 + u8 flags; + u16 base_high; } __attribute__((packed)); struct idt_ptr { @@ -24,13 +24,13 @@ extern void idt_load(); void idt_set_gate(unsigned char num, unsigned long base, unsigned short sel, unsigned char flags) { // Specify the interrupt routine's base address - idt[num].base_low = (uint16_t)(base & 0xFFFF); - idt[num].base_high = (uint16_t)((base >> 16) & 0xFFFF); + idt[num].base_low = (u16)(base & 0xFFFF); + idt[num].base_high = (u16)((base >> 16) & 0xFFFF); // Set selector/segment of IDT entry idt[num].sel = sel; idt[num].always0 = 0; - idt[num].flags = (uint8_t)(flags | 0x60); + idt[num].flags = (u8)(flags | 0x60); } // Install IDT diff --git a/src/kernel/interrupts/interrupts.h b/src/kernel/interrupts/interrupts.h index 6651cfd..f7b5846 100644 --- a/src/kernel/interrupts/interrupts.h +++ b/src/kernel/interrupts/interrupts.h @@ -40,13 +40,13 @@ void isrs_install(); */ typedef void (*irq_handler_t)(struct regs *); -void isr_install_handler(size_t isr, irq_handler_t handler); +void isr_install_handler(u32 isr, irq_handler_t handler); /** * Uninstall a handler by index * @param irq The index of the IRQ routine that should be removed */ -void isr_uninstall_handler(size_t isr); +void isr_uninstall_handler(u32 isr); /** * Initialize the Interrupt Requests by mapping the ISRs to the correct diff --git a/src/kernel/interrupts/irq.c b/src/kernel/interrupts/irq.c index ad35346..4c34d15 100644 --- a/src/kernel/interrupts/irq.c +++ b/src/kernel/interrupts/irq.c @@ -1,6 +1,6 @@ -#include <kernel/io/io.h> -#include <kernel/interrupts/interrupts.h> -#include <kernel/system.h> +#include <io/io.h> +#include <interrupts/interrupts.h> +#include <system.h> extern void irq0(); diff --git a/src/kernel/interrupts/isr.c b/src/kernel/interrupts/isr.c index 880c23a..54584b4 100644 --- a/src/kernel/interrupts/isr.c +++ b/src/kernel/interrupts/isr.c @@ -1,12 +1,12 @@ #include <stdint.h> -#include <kernel/interrupts/interrupts.h> -#include <kernel/system.h> -#include <kernel/lib/string.h> -#include <kernel/lib/stdio.h> -#include <kernel/lib/lib.h> -#include <kernel/graphics/vesa.h> -#include <kernel/tasks/process.h> -#include <kernel/io/io.h> +#include <interrupts/interrupts.h> +#include <system.h> +#include <lib/string.h> +#include <lib/stdio.h> +#include <lib/lib.h> +#include <graphics/vesa.h> +#include <tasks/process.h> +#include <io/io.h> // Install ISRs in IDT void isrs_install() @@ -55,13 +55,13 @@ void isrs_install() irq_handler_t isr_routines[256] = { 0 }; // Install custom IRQ handler -void isr_install_handler(size_t isr, irq_handler_t handler) +void isr_install_handler(u32 isr, irq_handler_t handler) { isr_routines[isr] = handler; } // Remove the custom IRQ handler -void isr_uninstall_handler(size_t isr) +void isr_uninstall_handler(u32 isr) { isr_routines[isr] = 0; } @@ -111,7 +111,7 @@ void fault_handler(struct regs *r) handler(r); } else { cli(); - uint32_t faulting_address; + u32 faulting_address; asm("mov %%cr2, %0" : "=r"(faulting_address)); log("\n[DEBUG]\nEIP: 0x%x\nEAX: 0x%x\nEBX: 0x%x\nECX: 0x%x\nEDX: 0x%x\nESP: 0x%x\nFault addr: 0x%x\nErr flag: 0x%x\nErr code: 0x%x\nINT code: 0x%x\nINT msg: %s", @@ -133,7 +133,7 @@ void fault_handler(struct regs *r) scheduler(r); sti(); } else { - if (faulting_address != (uint32_t)fb) { + if (faulting_address != (u32)fb) { panic("Page fault before multitasking started!"); } else { debug(RED "Fatal video error!" RES); |