|
PatchworkOS
|
#include <kernel/drivers/apic.h>#include <kernel/acpi/tables.h>#include <kernel/cpu/cpu.h>#include <kernel/cpu/smp.h>#include <kernel/drivers/hpet.h>#include <kernel/drivers/pic.h>#include <kernel/log/log.h>#include <kernel/log/panic.h>#include <kernel/mem/vmm.h>#include <kernel/sched/timer.h>#include <kernel/utils/utils.h>#include <assert.h>#include <kernel/defs.h>Go to the source code of this file.
Functions | |
| static uint64_t | lapic_init (void) |
| static uint64_t | ioapic_all_init (void) |
| static uint64_t | apic_init (sdt_header_t *table) |
| ACPI_SDT_HANDLER_REGISTER (MADT_SIGNATURE, apic_init) | |
| void | apic_timer_one_shot (interrupt_t vector, uint32_t ticks) |
| Configure the apic timer in one-shot mode. | |
| uint64_t | apic_timer_ticks_per_ns (void) |
| Apic timer ticks per nanosecond. | |
| void | lapic_cpu_init (void) |
| Initialize the local apic for the current cpu. | |
| lapic_id_t | lapic_self_id (void) |
| Get the lapic id of the current cpu. | |
| void | lapic_write (lapic_register_t reg, uint32_t value) |
| Write to a local apic register. | |
| uint32_t | lapic_read (lapic_register_t reg) |
| Read from a local apic register. | |
| void | lapic_send_init (lapic_id_t id) |
| Send an INIT IPI to a local apic. | |
| void | lapic_send_sipi (lapic_id_t id, void *entryPoint) |
| Send a Startup IPI to a local apic. | |
| void | lapic_send_ipi (lapic_id_t id, interrupt_t vector) |
| Send an Inter-Processor Interrupt (IPI) to a local apic. | |
| void | lapic_eoi (void) |
| Send an End Of Interrupt (EOI) signal to the local apic. | |
| uint32_t | ioapic_read (ioapic_t *ioapic, ioapic_register_t reg) |
| Read from an IOAPIC register. | |
| void | ioapic_write (ioapic_t *ioapic, ioapic_register_t reg, uint32_t value) |
| Write to an IOAPIC register. | |
| ioapic_version_t | ioapic_get_version (ioapic_t *ioapic) |
| Get the IOAPIC version. | |
| ioapic_t * | ioapic_from_gsi (ioapic_gsi_t gsi) |
| Get the IOAPIC id responsible for a given GSI. | |
| void | ioapic_set_redirect (interrupt_t vector, ioapic_gsi_t gsi, ioapic_delivery_mode_t deliveryMode, ioapic_polarity_t polarity, ioapic_trigger_mode_t triggerMode, cpu_t *cpu, bool enable) |
| Set an IOAPIC redirection entry. | |
Variables | |
| static bool | initialized = false |
| static madt_t * | madt |
| static uintptr_t | lapicBase |
| ACPI_SDT_HANDLER_REGISTER | ( | MADT_SIGNATURE | , |
| apic_init | |||
| ) |
|
static |
Definition at line 78 of file apic.c.
References ERR, initialized, ioapic_all_init(), lapic_init(), LOG_ERR, and madt.
|
static |
Definition at line 42 of file apic.c.
References ERR, ioapic_t::globalSystemInterruptBase, ioapic_t::header, ioapic_redirect_entry_t::PACKED::high, INTERRUPT_CONTROLLER_IO_APIC, ioapic_get_version(), IOAPIC_REG_REDIRECTION, ioapic_write(), ioapic_t::ioApicAddress, LOG_ERR, LOG_INFO, ioapic_redirect_entry_t::PACKED::low, madt, MADT_FOR_EACH, ioapic_version_t::maxRedirs, NULL, PAGE_SIZE, pic_disable(), PML_GLOBAL, PML_LOWER_TO_HIGHER, PML_PRESENT, PML_WRITE, ioapic_redirect_entry_t::raw, interrupt_controller_header_t::type, and vmm_map().
Referenced by apic_init().
|
static |
Definition at line 21 of file apic.c.
References ERR, lapicBase, madt_t::localInterruptControllerAddress, LOG_ERR, LOG_INFO, madt, NULL, PAGE_SIZE, PML_GLOBAL, PML_LOWER_TO_HIGHER, PML_PRESENT, PML_WRITE, and vmm_map().
Referenced by apic_init().
Definition at line 17 of file apic.c.
Referenced by apic_init(), apic_timer_one_shot(), apic_timer_ticks_per_ns(), ioapic_from_gsi(), ioapic_get_version(), ioapic_read(), ioapic_set_redirect(), ioapic_write(), lapic_cpu_init(), lapic_eoi(), lapic_read(), lapic_self_id(), lapic_send_init(), lapic_send_ipi(), lapic_send_sipi(), and lapic_write().
|
static |
Definition at line 19 of file apic.c.
Referenced by lapic_init(), lapic_read(), and lapic_write().
|
static |
Definition at line 18 of file apic.c.
Referenced by apic_init(), ioapic_all_init(), ioapic_from_gsi(), lapic_init(), and smp_others_init().