OurOS 0.1
Operating System built by McGill Students
 
Loading...
Searching...
No Matches
idt.h File Reference
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  cpu_idt_entry
 
struct  cpu_idt_register
 
struct  cpu_idt_iframe
 
struct  cpu_idt_interrupt_state
 

Macros

#define IDT_PRESENT   0x80
 
#define IDT_RING_0   0x00
 
#define IDT_RING_1   0x20
 
#define IDT_RING_2   0x40
 
#define IDT_RING_3   0x60
 
#define IDT_INT_GATE   0x0E
 
#define IDT_TRAP_GATE   0x0F
 
#define IDT_KTRAP_GATE   (IDT_PRESENT + IDT_RING_0 + IDT_TRAP_GATE)
 
#define IDT_KINT_GATE   (IDT_PRESENT + IDT_RING_0 + IDT_INT_GATE)
 
#define IDT_ENTRY_CREATE(addr, selector, ist, flags)
 

Functions

struct cpu_idt_entry __attribute__ ((packed))
 
void cpu_idt_bind (void)
 
void cpu_idt_describe (char *buf, uint64_t bufsz)
 
static void enable_interrupts ()
 
static void disable_interrupts ()
 

Variables

uint16_t address_low
 
uint16_t selector
 
uint8_t ist
 
uint8_t flags
 
uint16_t address_mid
 
uint32_t address_high
 
uint32_t reserved
 
uint16_t limit
 
uint64_t base
 
struct cpu_idt_iframe __attribute__
 

Macro Definition Documentation

◆ IDT_ENTRY_CREATE

#define IDT_ENTRY_CREATE (   addr,
  selector,
  ist,
  flags 
)
Value:
{ \
(addr) & 0xffff, /* 16-bit address (low) */ \
(selector) & 0xffff, /* 16-bit Code Selector */ \
(ist) & 0xff, /* Interrupt Stack Table */ \
(flags) & 0xff, /* Flags (one byte) */ \
(addr) >> 16 & 0xffff, /* Second two low bytes */ \
(addr) >> 32, /* Four high bytes */ \
0, /* Reserved (four bytes) */ \
}
uint16_t selector
Definition idt.h:1
uint8_t ist
Definition idt.h:2
uint8_t flags
Definition idt.h:3

◆ IDT_INT_GATE

#define IDT_INT_GATE   0x0E

◆ IDT_KINT_GATE

#define IDT_KINT_GATE   (IDT_PRESENT + IDT_RING_0 + IDT_INT_GATE)

◆ IDT_KTRAP_GATE

#define IDT_KTRAP_GATE   (IDT_PRESENT + IDT_RING_0 + IDT_TRAP_GATE)

◆ IDT_PRESENT

#define IDT_PRESENT   0x80

◆ IDT_RING_0

#define IDT_RING_0   0x00

◆ IDT_RING_1

#define IDT_RING_1   0x20

◆ IDT_RING_2

#define IDT_RING_2   0x40

◆ IDT_RING_3

#define IDT_RING_3   0x60

◆ IDT_TRAP_GATE

#define IDT_TRAP_GATE   0x0F

Function Documentation

◆ __attribute__()

struct cpu_idt_entry __attribute__ ( (packed)  )

◆ cpu_idt_bind()

void cpu_idt_bind ( void  )

◆ cpu_idt_describe()

void cpu_idt_describe ( char *  buf,
uint64_t  bufsz 
)

◆ disable_interrupts()

static void disable_interrupts ( )
inlinestatic

◆ enable_interrupts()

static void enable_interrupts ( )
inlinestatic

Variable Documentation

◆ __attribute__

struct cpu_idt_register __attribute__

◆ address_high

uint32_t address_high

◆ address_low

uint16_t address_low

◆ address_mid

uint16_t address_mid

◆ base

uint64_t base

◆ flags

uint8_t flags

◆ ist

uint8_t ist

◆ limit

uint16_t limit

◆ reserved

uint32_t reserved

◆ selector

uint16_t selector