MOS Source Code
Loading...
Searching...
No Matches
x86_interrupt.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
6
8#include <mos/mos_global.h>
9#include <mos/types.h>
10
11#define IRQ_BASE 0x20
12#define IPI_BASE 0x50
13
14#define ISR_MAX_COUNT 32
15#define IRQ_MAX_COUNT 16
16#define IDT_ENTRY_COUNT 256
17
50
51MOS_STATIC_ASSERT(IRQ_BASE > EXCEPTION_MAX, "IRQ_BASE is too small, possibly overlapping with exceptions");
52
73
74MOS_STATIC_ASSERT(IRQ_MAX_COUNT == IRQ_MAX, "IRQ_MAX_COUNT is not equal to IRQ_MAX");
75
76void pic_remap_irq(void);
77
78// The following `extern` symbols are defined in the interrupt_handler.asm file.
79extern void *isr_stub_table[];
80extern void *irq_stub_table[];
81
83
84[[noreturn]] extern void x86_interrupt_return_impl(const platform_regs_t *regs);
#define MOS_STATIC_ASSERT
Definition mos_global.h:14
unsigned long ptr_t
Definition types.h:25
x86_exception_enum_t
@ EXCEPTION_COUNT
@ EXCEPTION_INVALID_TSS
@ EXCEPTION_SECURITY_EXCEPTION
@ EXCEPTION_FPU_ERROR
@ EXCEPTION_INVALID_OPCODE
@ EXCEPTION_STACK_SEGMENT_FAULT
@ EXCEPTION_VIRTUALIZATION_EXCEPTION
@ EXCEPTION_DEVICE_NOT_AVAILABLE
@ EXCEPTION_MACHINE_CHECK
@ EXCEPTION_SEGMENT_NOT_PRESENT
@ EXCEPTION_NMI
@ EXCEPTION_DOUBLE_FAULT
@ EXCEPTION_SIMD_ERROR
@ EXCEPTION_VMM_COMMUNICATION_EXCEPTION
@ EXCEPTION_GENERAL_PROTECTION_FAULT
@ EXCEPTION_DEBUG
@ EXCEPTION_COPROCESSOR_SEGMENT_OVERRUN
@ EXCEPTION_OVERFLOW
@ EXCEPTION_ALIGNMENT_CHECK
@ EXCEPTION_DIVIDE_ERROR
@ EXCEPTION_HYPERVISOR_EXCEPTION
@ EXCEPTION_BREAKPOINT
@ EXCEPTION_PAGE_FAULT
@ EXCEPTION_CONTROL_PROTECTION_EXCEPTION
@ EXCEPTION_MAX
@ EXCEPTION_BOUND_RANGE_EXCEEDED
void * isr_stub_table[]
void * irq_stub_table[]
x86_irq_enum_t
@ IRQ_FREE3
@ IRQ_KEYBOARD
@ IRQ_FREE2
@ IRQ_PS2_MOUSE
@ IRQ_MAX
@ IRQ_FREE1
@ IRQ_COM2
@ IRQ_LPT1
@ IRQ_ATA_PRIMARY
@ IRQ_CASCADE
@ IRQ_FLOPPY
@ IRQ_CMOS_RTC
@ IRQ_ATA_SECONDARY
@ IRQ_LPT2
@ IRQ_COM1
@ IRQ_FPU
@ IRQ_PIT_TIMER
void x86_interrupt_entry(ptr_t esp)
void pic_remap_irq(void)
Definition pic.c:25
#define IRQ_BASE
void x86_interrupt_return_impl(const platform_regs_t *regs)
#define IRQ_MAX_COUNT