71 .
name =
"Local APIC IPI",
81 LOG_ERR(
"no MADT table found\n");
87 LOG_ERR(
"madt table too small\n");
93 LOG_ERR(
"madt has invalid lapic address\n");
101 LOG_ERR(
"failed to map local apic\n");
111 LOG_ERR(
"failed to register lapic ipi chip\n");
#define assert(expression)
@ 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_MAX
Maximum number of CPUs supported.
#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, void *physAddr, uint64_t length, pml_flags_t flags, space_callback_func_t func, void *private)
Maps physical memory to virtual memory in a given address space.
void * vmm_unmap(space_t *space, void *virtAddr, uint64_t length)
Unmaps virtual memory from a given address space.
#define PAGE_SIZE
The size of a memory page in bytes.
#define NULL
Pointer error value.
#define ERR
Integer error value.
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.
lapic_t * lapic_get(uint32_t cpuId)
Get the lapic data for the specified CPU.
void lapic_init(cpu_t *cpu)
Initialize the local APIC for a CPU.
#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)
Initialize the local APIC subsystem.
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
static void lapic_eoi(cpu_t *cpu)
static uintptr_t lapicBase
static void lapic_interrupt(cpu_t *cpu, irq_virt_t virt)
static ipi_chip_t lapicIpiChip
static lapic_t lapics[CPU_MAX]
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)