Module trap

Source
Expand description

Handles trap.

ModulesΒ§

gdt πŸ”’
Configure the Global Descriptor Table (GDT).
idt πŸ”’
Configure the Interrupt Descriptor Table (IDT).
syscall πŸ”’
Configure fast syscall.

StructsΒ§

RawUserContext πŸ”’
Userspace context.
TrapFrame
Trap frame of kernel interrupt

StaticsΒ§

KERNEL_INTERRUPT_NESTED_LEVEL πŸ”’
USER_PAGE_FAULT_HANDLER πŸ”’

FunctionsΒ§

handle_kernel_page_fault πŸ”’
FIXME: this is a hack because we don’t allocate kernel space for IO memory. We are currently using the linear mapping for IO memory. This is not a good practice.
handle_user_page_fault πŸ”’
Handles page fault from user space.
init πŸ”’ ⚠
Initializes interrupt handling on x86_64.
inject_user_page_fault_handler
Injects a custom handler for page faults that occur in the kernel and are caused by user-space address.
is_kernel_interrupted
Returns true if this function is called within the context of an IRQ handler and the IRQ occurs while the CPU is executing in the kernel mode. Otherwise, it returns false.
trap_handler πŸ”’
Handle traps (only from kernel).