kernel: x86-64 idt

This commit is contained in:
Matheus
2023-04-08 21:13:43 -03:00
parent ef2d0fc874
commit 7b58504b01
6 changed files with 151 additions and 10 deletions
+5 -3
View File
@@ -3,6 +3,8 @@
#include <stdbool.h>
#include <arch/context.h>
#ifdef __x86_64__
#define MAX_ISR_COUNT 256
#else
@@ -11,15 +13,15 @@
struct _isr_t;
typedef struct _isr_t {
void (*func)(struct _isr_t *self); // TODO pass register context as argument as well.
void (*func)(struct _isr_t *self, context_t *ctx);
void (*eoi)(struct _isr_t *self);
long id;
long priority;
bool pending;
} isr_t;
void interrupt_register(int vector, void (*func)(isr_t *self), void (*eoi)(isr_t *self), long priority); // TODO pass register context as well.
isr_t *interrupt_allocate(void (*func)(isr_t *self), void (*eoi)(isr_t *self), long priority); // TODO pass register context as well.
void interrupt_register(int vector, void (*func)(isr_t *self, context_t *ctx), void (*eoi)(isr_t *self), long priority);
isr_t *interrupt_allocate(void (*func)(isr_t *self, context_t *ctx), void (*eoi)(isr_t *self), long priority);
void interrupt_raiseipl(long newipl);
void interrupt_loweripl(long newipl);
+7
View File
@@ -0,0 +1,7 @@
#ifndef _IDT_H
#define _IDT_h
void arch_idt_reload();
void arch_idt_setup();
#endif