61 .
name =
"Local APIC IPI",
85 LOG_ERR(
"no MADT table found\n");
91 LOG_ERR(
"madt table too small\n");
97 LOG_ERR(
"madt has invalid lapic address\n");
105 LOG_ERR(
"failed to map local apic\n");
114 LOG_ERR(
"failed to register lapic ipi chip\n");
#define assert(expression)
sdt_header_t * acpi_tables_lookup(const char *signature, uint64_t minSize, uint64_t n)
Lookup the n'th table matching the signature.
#define MADT_SIGNATURE
MADT table signature.
@ VECTOR_SPURIOUS
Made available for any component to use as a sink for spurious interrupts.
uint64_t ipi_chip_register(ipi_chip_t *chip)
Register an IPI chip.
uint8_t irq_virt_t
Virtual IRQ numbers.
#define CPU_PTR(id, ptr)
Macro to get a pointer to a percpu variable on a specific CPU.
#define PERCPU_DEFINE_CTOR(type, name)
Macro to define a percpu variable with a constructor.
#define LAPIC_REG_ID_OFFSET
The offset at which the lapic id is stored in the LAPIC_REG_ID register.
void lapic_send_init(lapic_id_t id)
Send an INIT IPI to the specified local APIC.
void lapic_send_sipi(lapic_id_t id, void *entryPoint)
Send a Startup IPI (SIPI) to the specified local APIC.
uint32_t lapic_read(uint32_t reg)
Read from a local apic register.
uint64_t lapic_global_init(void)
Global initialization for the local APICs.
lapic_t PERCPU _pcpu_lapic
The per-CPU local APIC structure.
uint8_t lapic_id_t
Local APIC ID type.
void lapic_write(uint32_t reg, uint32_t value)
Write to a local apic register.
@ LAPIC_REG_TASK_PRIORITY
#define LOG_ERR(format,...)
#define LOG_INFO(format,...)
#define PML_LOWER_TO_HIGHER(addr)
Converts an address from the lower half to the higher half.
void * vmm_map(space_t *space, void *virtAddr, phys_addr_t physAddr, size_t length, pml_flags_t flags, space_callback_func_t func, void *data)
Maps physical memory to virtual memory in a given address space.
void * vmm_unmap(space_t *space, void *virtAddr, size_t length)
Unmaps virtual memory from a given address space.
#define NULL
Pointer error value.
#define ERR
Integer error value.
#define PAGE_SIZE
The size of a memory page in bytes.
static void lapic_eoi(void)
static uintptr_t lapicBase
static void lapic_interrupt(cpu_t *cpu, irq_virt_t virt)
static ipi_chip_t lapicIpiChip
static netfs_family_t local
static void msr_write(uint32_t msr, uint64_t value)
static uint64_t msr_read(uint32_t msr)
__UINTPTR_TYPE__ uintptr_t
Inter-Processor Interrupt (IPI) chip structure.
Multiple APIC Description Table.
uint32_t localInterruptControllerAddress
#define WRITE_32(address, value)