MOS Source Code
Loading...
Searching...
No Matches
x86_interrupt.h File Reference
+ Include dependency graph for x86_interrupt.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define IRQ_BASE   0x20
 
#define IPI_BASE   0x50
 
#define ISR_MAX_COUNT   32
 
#define IRQ_MAX_COUNT   16
 
#define IDT_ENTRY_COUNT   256
 

Enumerations

enum  x86_exception_enum_t {
  EXCEPTION_DIVIDE_ERROR = 0 , EXCEPTION_DEBUG = 1 , EXCEPTION_NMI = 2 , EXCEPTION_BREAKPOINT = 3 ,
  EXCEPTION_OVERFLOW = 4 , EXCEPTION_BOUND_RANGE_EXCEEDED = 5 , EXCEPTION_INVALID_OPCODE = 6 , EXCEPTION_DEVICE_NOT_AVAILABLE = 7 ,
  EXCEPTION_DOUBLE_FAULT = 8 , EXCEPTION_COPROCESSOR_SEGMENT_OVERRUN = 9 , EXCEPTION_INVALID_TSS = 10 , EXCEPTION_SEGMENT_NOT_PRESENT = 11 ,
  EXCEPTION_STACK_SEGMENT_FAULT = 12 , EXCEPTION_GENERAL_PROTECTION_FAULT = 13 , EXCEPTION_PAGE_FAULT = 14 , EXCEPTION_FPU_ERROR = 16 ,
  EXCEPTION_ALIGNMENT_CHECK = 17 , EXCEPTION_MACHINE_CHECK = 18 , EXCEPTION_SIMD_ERROR = 19 , EXCEPTION_VIRTUALIZATION_EXCEPTION = 20 ,
  EXCEPTION_CONTROL_PROTECTION_EXCEPTION = 21 , EXCEPTION_HYPERVISOR_EXCEPTION = 28 , EXCEPTION_VMM_COMMUNICATION_EXCEPTION = 29 , EXCEPTION_SECURITY_EXCEPTION = 30 ,
  EXCEPTION_MAX = 31 , EXCEPTION_COUNT = 32
}
 
enum  x86_irq_enum_t {
  IRQ_PIT_TIMER = 0 , IRQ_KEYBOARD = 1 , IRQ_CASCADE = 2 , IRQ_COM2 = 3 ,
  IRQ_COM1 = 4 , IRQ_LPT2 = 5 , IRQ_FLOPPY = 6 , IRQ_LPT1 = 7 ,
  IRQ_CMOS_RTC = 8 , IRQ_FREE1 = 9 , IRQ_FREE2 = 10 , IRQ_FREE3 = 11 ,
  IRQ_PS2_MOUSE = 12 , IRQ_FPU = 13 , IRQ_ATA_PRIMARY = 14 , IRQ_ATA_SECONDARY = 15 ,
  IRQ_MAX = 16
}
 

Functions

 MOS_STATIC_ASSERT (0x20 > EXCEPTION_MAX, "IRQ_BASE is too small, possibly overlapping with exceptions")
 
 MOS_STATIC_ASSERT (16==IRQ_MAX, "IRQ_MAX_COUNT is not equal to IRQ_MAX")
 
void pic_remap_irq (void)
 
void x86_interrupt_entry (ptr_t esp)
 
void x86_interrupt_return_impl (const platform_regs_t *regs)
 

Variables

voidisr_stub_table []
 
voidirq_stub_table []
 

Macro Definition Documentation

◆ IRQ_BASE

#define IRQ_BASE   0x20

Definition at line 11 of file x86_interrupt.h.

Referenced by x86_handle_irq(), x86_idt_init(), and x86_interrupt_entry().

◆ IPI_BASE

#define IPI_BASE   0x50

Definition at line 12 of file x86_interrupt.h.

Referenced by platform_ipi_send(), x86_idt_init(), and x86_interrupt_entry().

◆ ISR_MAX_COUNT

#define ISR_MAX_COUNT   32

Definition at line 14 of file x86_interrupt.h.

Referenced by ioapic_disable(), ioapic_enable_with_mode(), and x86_idt_init().

◆ IRQ_MAX_COUNT

#define IRQ_MAX_COUNT   16

Definition at line 15 of file x86_interrupt.h.

Referenced by x86_idt_init().

◆ IDT_ENTRY_COUNT

#define IDT_ENTRY_COUNT   256

Definition at line 16 of file x86_interrupt.h.

Referenced by x86_idt_init().

Enumeration Type Documentation

◆ x86_exception_enum_t

Enumerator
EXCEPTION_DIVIDE_ERROR 
EXCEPTION_DEBUG 
EXCEPTION_NMI 
EXCEPTION_BREAKPOINT 
EXCEPTION_OVERFLOW 
EXCEPTION_BOUND_RANGE_EXCEEDED 
EXCEPTION_INVALID_OPCODE 
EXCEPTION_DEVICE_NOT_AVAILABLE 
EXCEPTION_DOUBLE_FAULT 
EXCEPTION_COPROCESSOR_SEGMENT_OVERRUN 
EXCEPTION_INVALID_TSS 
EXCEPTION_SEGMENT_NOT_PRESENT 
EXCEPTION_STACK_SEGMENT_FAULT 
EXCEPTION_GENERAL_PROTECTION_FAULT 
EXCEPTION_PAGE_FAULT 
EXCEPTION_FPU_ERROR 
EXCEPTION_ALIGNMENT_CHECK 
EXCEPTION_MACHINE_CHECK 
EXCEPTION_SIMD_ERROR 
EXCEPTION_VIRTUALIZATION_EXCEPTION 
EXCEPTION_CONTROL_PROTECTION_EXCEPTION 
EXCEPTION_HYPERVISOR_EXCEPTION 
EXCEPTION_VMM_COMMUNICATION_EXCEPTION 
EXCEPTION_SECURITY_EXCEPTION 
EXCEPTION_MAX 
EXCEPTION_COUNT 

Definition at line 18 of file x86_interrupt.h.

◆ x86_irq_enum_t

Enumerator
IRQ_PIT_TIMER 
IRQ_KEYBOARD 
IRQ_CASCADE 
IRQ_COM2 
IRQ_COM1 
IRQ_LPT2 
IRQ_FLOPPY 
IRQ_LPT1 
IRQ_CMOS_RTC 
IRQ_FREE1 
IRQ_FREE2 
IRQ_FREE3 
IRQ_PS2_MOUSE 
IRQ_FPU 
IRQ_ATA_PRIMARY 
IRQ_ATA_SECONDARY 
IRQ_MAX 

Definition at line 53 of file x86_interrupt.h.

Function Documentation

◆ MOS_STATIC_ASSERT() [1/2]

MOS_STATIC_ASSERT ( 0x20 ,
EXCEPTION_MAX ,
"IRQ_BASE is too small,
possibly overlapping with exceptions"  )

◆ MOS_STATIC_ASSERT() [2/2]

MOS_STATIC_ASSERT ( 16 = =IRQ_MAX,
"IRQ_MAX_COUNT is not equal to IRQ_MAX"  )

◆ pic_remap_irq()

void pic_remap_irq ( void )

Definition at line 25 of file pic.c.

Referenced by platform_startup_late().

+ Here is the call graph for this function:

◆ x86_interrupt_entry()

void x86_interrupt_entry ( ptr_t esp)

Definition at line 212 of file x86_interrupt.c.

+ Here is the call graph for this function:

◆ x86_interrupt_return_impl()

Variable Documentation

◆ isr_stub_table

void* isr_stub_table[]
extern

Referenced by x86_idt_init().

◆ irq_stub_table

void* irq_stub_table[]
extern

Referenced by x86_idt_init().