ArvernOS
Loading...
Searching...
No Matches
idt.h File Reference
#include <stdint.h>
Include dependency graph for idt.h:

Data Structures

struct  idt_gate_t
 
struct  idt_register_t
 

Macros

#define IDT_ENTRIES   256
 

Functions

void idt_load ()
 
void idt_register_gate (uint16_t n, uint64_t handler, uint8_t type, uint8_t dpl)
 
void idt_register_interrupt (uint16_t n, uint64_t handler)
 

Detailed Description

Macro Definition Documentation

◆ IDT_ENTRIES

#define IDT_ENTRIES   256

The number of entries in the Interrupt Descriptor Table.

There are 256 interrupts (0..255), so IDT should have 256 entries, each entry corresponding to a specific interrupt.

Function Documentation

◆ idt_load()

void idt_load ( )

Loads the Interrupt Descriptor Table. The table should be updated with idt_register_gate() and/or idt_register_interrupt() before calling this function.

◆ idt_register_gate()

void idt_register_gate ( uint16_t n,
uint64_t handler,
uint8_t type,
uint8_t dpl )

Registers a gate in the IDT.

Parameters
na gate number
handlerthe handler to register for the given gate
typethe gate type
dplthe DPL value ("ring")

◆ idt_register_interrupt()

void idt_register_interrupt ( uint16_t n,
uint64_t handler )

Registers a an interrupt gate in the IDT.

Parameters
na gate number
handlerthe handler to register for the given gate