|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "./interrupt.h"#include "autoconf.h"#include "console/console.h"#include "hal/apic/apic.h"#include "hal/cpu/paging.h"#include "init/init.h"#include <hal/cpu/core.h>#include <libk/debug/debug.h>#include <libk/io.h>#include <libk/serial.h>#include <memory/memory_utils.h>#include <memory/vm_manager.h>#include <procc/scheduler.h>#include <procc/task.h>#include <spinlock.h>#include <str.h>#include <type.h>Go to the source code of this file.
Enumerations | |
| enum | EXCEPTION_ID { DIVIDE_BY_ZERO = 0 , DEBUG = 1 , NON_MASKABLE_INTERRUPT = 2 , BREAKPOINT = 3 , INTO_DETECTED_OVERFLOW = 4 , OUT_OF_BOUNDS = 5 , INVALID_OPCODE = 6 , NO_COPROCESSOR = 7 , DOUBLE_FAULT = 8 , COPROCESSOR_SEGMENT_OVERRUN = 9 , BAD_TSS = 10 , SEGMENT_NOT_PRESENT = 11 , STACK_FAULT = 12 , GENERAL_PROTECTION_FAULT = 13 , PAGE_FAULT = 14 , X87_FPU_FLOATING_POINT_ERROR = 16 , ALIGNMENT_CHECK = 17 , MACHINE_CHECK = 18 , SIMD_FLOATING_POINT_EXCEPTION = 19 , VIRTUALIZATION_EXCEPTION = 20 , CONTORL_PROTECTION_EXCEPTION = 21 , HYPERVISOR_INJECTION_EXCEPTION = 28 , VMM_COMMUNICATION_EXCEPTION = 29 , SECURITY_EXCEPTION = 30 } |
Functions | |
| static void | interrupt_io_wait () |
| static void | interrupt_pic_remap (void) |
| static void | interrupt_reload (interrupt_pointers_t *ptr, interrupt_entry_t *tbl) |
| static void | interrupt_register (interrupt_entry_t *entries, int n, void *handler, int selector, uint8_t ist, uint8_t type_attr) |
| void | irq_register (uint8_t core, int n, void *handler, boolean_t use_default_isr, uint16_t selector, uint8_t ist, uint8_t type_attr) |
| uint16_t | irq_alloc_entry (uint8_t core) |
| void | irq_setup (uint16_t core) |
| INIT (Interrupt) | |
| void | jump_usermode (uintptr_t addr) |
| void | init_runtime () |
| void | timer_handle (void) |
| void | virtio_irq () |
| __attribute__ ((no_stack_protector)) | |
Variables | |
| static interrupt_per_core_data_t | interrupt_per_core_data [VOXIA_MAX_CORE] = {0} |
| void * | int_table [] |
| static const char * | exception_messages [] |
| boolean_t | is_running_program = 0 |
| boolean_t | g__scheduler__is__running |
| boolean_t | elf_has_running |
| uintptr_t | rip_before_run_elf |
| spinlock_t | int_lock |
| enum EXCEPTION_ID |
Definition at line 185 of file interrupt.c.
| __attribute__ | ( | (no_stack_protector) | ) |
Definition at line 223 of file interrupt.c.
References apic_eoi(), irq_entry_t::configured, exception_messages, fpu, get_current_core_data(), h, irq_entry_t::handler, INFLOOP, interrupt_per_core_data, LOG2_ERROR, irq_entry_t::mask, PAGE_FAULT, queue, rsp, sch_restore_to_next_thread(), serial2_printf(), THREAD_STATE_TERMINATED, UNUSED, irq_entry_t::use_default_isr, and vxSchedulerGetCurrentQueue().
| INIT | ( | Interrupt | ) |
Definition at line 145 of file interrupt.c.
References irq_setup(), and update_core_gs().
|
extern |
References g__scheduler__is__running.
|
static |
|
static |
Definition at line 23 of file interrupt.c.
References ICW1_ICW4, ICW1_INIT, ICW4_8086, interrupt_io_wait(), outb(), PIC1_COMMAND, PIC1_DATA, PIC2_COMMAND, and PIC2_DATA.
Referenced by irq_setup().
|
static |
Definition at line 50 of file interrupt.c.
References ist.
Referenced by irq_register(), and irq_setup().
|
static |
Definition at line 39 of file interrupt.c.
References MAX_INTERRUPTS, and ptr.
Referenced by irq_setup().
Definition at line 109 of file interrupt.c.
References irq_entry_t::allocated, core, interrupt_per_core_data, and MAX_INTERRUPTS.
Referenced by __attribute__().
| void irq_register | ( | uint8_t | core, |
| int | n, | ||
| void * | handler, | ||
| boolean_t | use_default_isr, | ||
| uint16_t | selector, | ||
| uint8_t | ist, | ||
| uint8_t | type_attr ) |
Definition at line 70 of file interrupt.c.
References irq_entry_t::configured, core, irq_entry_t::handler, int_table, interrupt_per_core_data, interrupt_register(), ist, irq_entry_t::mask, slot, and irq_entry_t::use_default_isr.
Referenced by __attribute__(), setup_timer_interrupt(), and vxStartScheduler().
| void irq_setup | ( | uint16_t | core | ) |
Definition at line 125 of file interrupt.c.
References core, int_table, INTERRUPT_ATTR_KERNEL, interrupt_per_core_data, interrupt_pic_remap(), interrupt_register(), interrupt_reload(), MAX_INTERRUPTS, and memset().
Referenced by __attribute__(), and INIT().
|
extern |
|
extern |
References elf_has_running, and rip_before_run_elf.
|
extern |
Definition at line 14 of file elf.c.
Referenced by virtio_irq().
|
static |
Definition at line 150 of file interrupt.c.
Referenced by __attribute__().
|
extern |
Definition at line 19 of file scheduler.c.
Referenced by init_runtime(), and usleep().
| spinlock_t int_lock |
Definition at line 221 of file interrupt.c.
|
extern |
Referenced by irq_register(), and irq_setup().
|
static |
Definition at line 19 of file interrupt.c.
Referenced by __attribute__(), irq_alloc_entry(), irq_register(), and irq_setup().
| boolean_t is_running_program = 0 |
Definition at line 212 of file interrupt.c.
|
extern |
Definition at line 15 of file elf.c.
Referenced by virtio_irq().