luxos/SysCore/drivers/cpu/idt/idt.h

31 lines
876 B
C
Raw Normal View History

2021-09-14 15:34:14 +00:00
/******************************************************************
* idt.h - INTERRUPT DESCRIPTOR TABLE *
* Contains structures and function declarations for IDT *
******************************************************************/
#ifndef __IDT_H
#define __IDT_H
/* Defines an IDT entry */
2021-09-14 15:46:50 +00:00
struct IdtEntry
2021-09-14 15:34:14 +00:00
{
unsigned short base_lo;
unsigned short sel;
unsigned char always0;
unsigned char flags;
unsigned short base_hi;
} __attribute__((packed));
2021-09-14 15:46:50 +00:00
struct IdtPointer
2021-09-14 15:34:14 +00:00
{
unsigned short limit;
unsigned int base;
} __attribute__((packed));
/* This exists in 'start.asm', and is used to load our IDT */
2021-09-14 15:46:50 +00:00
extern void i86_IdtSetGate(unsigned char num, unsigned long base, unsigned short sel, unsigned char flags);
extern struct IdtEntry* i86_IdtGetGate(unsigned char num);
extern void i86_IdtInstall();
2021-09-14 15:34:14 +00:00
#endif