Clean up header file for interrupts
This commit is contained in:
parent
6f0a745adc
commit
73a33c23a4
@ -2,11 +2,32 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
#include <cpu.h>
|
||||||
|
|
||||||
|
#define IDT_INTERRUPT 0xE
|
||||||
|
#define IDT_DPL0 0x0
|
||||||
|
#define IDT_PRESENT 0x80
|
||||||
|
|
||||||
|
#define NUM_INTERRUPTS 256
|
||||||
|
|
||||||
|
struct idt
|
||||||
|
{
|
||||||
|
uint16_t base_l;
|
||||||
|
uint16_t cs;
|
||||||
|
uint8_t ist;
|
||||||
|
uint8_t flags;
|
||||||
|
uint16_t base_m;
|
||||||
|
uint32_t base_h;
|
||||||
|
uint32_t ignored;
|
||||||
|
} __attribute__((packed)) idt[NUM_INTERRUPTS];
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint16_t len;
|
||||||
|
struct idt *addr;
|
||||||
|
} __attribute__((packed)) idtr;
|
||||||
|
|
||||||
struct int_gate_descriptor idt[NUM_INTERRUPTS];
|
|
||||||
struct idtr idtr;
|
|
||||||
extern uintptr_t isr_table[];
|
extern uintptr_t isr_table[];
|
||||||
|
|
||||||
int_handler_t int_handlers[NUM_INTERRUPTS];
|
int_handler_t int_handlers[NUM_INTERRUPTS];
|
||||||
|
|
||||||
void idt_set_gate(uint32_t num, uintptr_t vector, uint16_t cs, uint8_t ist, uint8_t flags)
|
void idt_set_gate(uint32_t num, uintptr_t vector, uint16_t cs, uint8_t ist, uint8_t flags)
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
// vim: ft=c
|
// vim: ft=c
|
||||||
#include <ttest.h>
|
#include <ttest.h>
|
||||||
#include <debug.h>
|
|
||||||
#undef debug
|
|
||||||
#define debug(...)
|
|
||||||
#include "interrupts.c"
|
#include "interrupts.c"
|
||||||
|
|
||||||
uintptr_t isr_table[] ={};
|
uintptr_t isr_table[] ={};
|
||||||
|
@ -1,29 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cpu.h>
|
|
||||||
|
|
||||||
#define IDT_INTERRUPT 0xE
|
|
||||||
#define IDT_DPL0 0x0
|
|
||||||
#define IDT_PRESENT 0x80
|
|
||||||
|
|
||||||
#define NUM_INTERRUPTS 256
|
|
||||||
|
|
||||||
struct int_gate_descriptor
|
|
||||||
{
|
|
||||||
uint16_t base_l;
|
|
||||||
uint16_t cs;
|
|
||||||
uint8_t ist;
|
|
||||||
uint8_t flags;
|
|
||||||
uint16_t base_m;
|
|
||||||
uint32_t base_h;
|
|
||||||
uint32_t ignored;
|
|
||||||
} __attribute__((packed));
|
|
||||||
|
|
||||||
struct idtr
|
|
||||||
{
|
|
||||||
uint16_t len;
|
|
||||||
struct int_gate_descriptor *addr;
|
|
||||||
} __attribute__((packed));
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user