9#ifndef ZEPHYR_INCLUDE_DRIVERS_LOAPIC_H_
10#define ZEPHYR_INCLUDE_DRIVERS_LOAPIC_H_
18#define LOAPIC_ID 0x020
19#define LOAPIC_VER 0x030
20#define LOAPIC_TPR 0x080
21#define LOAPIC_APR 0x090
22#define LOAPIC_PPR 0x0a0
23#define LOAPIC_EOI 0x0b0
24#define LOAPIC_LDR 0x0d0
25#define LOAPIC_DFR 0x0e0
26#define LOAPIC_SVR 0x0f0
27#define LOAPIC_ISR 0x100
28#define LOAPIC_TMR 0x180
29#define LOAPIC_IRR 0x200
30#define LOAPIC_ESR 0x280
31#define LOAPIC_ICRLO 0x300
32#define LOAPIC_ICRHI 0x310
33#define LOAPIC_TIMER 0x320
34#define LOAPIC_THERMAL 0x330
35#define LOAPIC_PMC 0x340
36#define LOAPIC_LINT0 0x350
37#define LOAPIC_LINT1 0x360
38#define LOAPIC_ERROR 0x370
39#define LOAPIC_TIMER_ICR 0x380
40#define LOAPIC_TIMER_CCR 0x390
41#define LOAPIC_TIMER_CONFIG 0x3e0
42#define LOAPIC_SELF_IPI 0x3f0
44#define LOAPIC_ICR_BUSY 0x00001000
46#define LOAPIC_ICR_IPI_OTHERS 0x000C4000U
47#define LOAPIC_ICR_IPI_INIT 0x00004500U
48#define LOAPIC_ICR_IPI_STARTUP 0x00004600U
50#define LOAPIC_LVT_MASKED 0x00010000
53#define LOAPIC_REGS_STR loapic_regs
64void z_loapic_enable(
unsigned char cpu_number);
65void z_loapic_int_vec_set(
unsigned int irq,
unsigned int vector);
66void z_loapic_irq_enable(
unsigned int irq);
67void z_loapic_irq_disable(
unsigned int irq);
#define DEVICE_MMIO_TOPLEVEL_DECLARE(name)
Provide an extern reference to a top-level MMIO region.
Definition: device_mmio.h:638
#define DEVICE_MMIO_TOPLEVEL_GET(name)
Obtain the MMIO address for a device declared top-level.
Definition: device_mmio.h:734
static void x86_write_x2apic(unsigned int reg, uint64_t val)
Write 64-bit value to the local APIC in x2APIC mode.
Definition: loapic.h:117
#define LOAPIC_ICRLO
Definition: loapic.h:31
static uint32_t x86_read_xapic(unsigned int reg)
Read 32-bit value from the local APIC in xAPIC (MMIO) mode.
Definition: loapic.h:85
#define LOAPIC_ICRHI
Definition: loapic.h:32
static uint32_t x86_read_loapic(unsigned int reg)
Read value from the local APIC using the default mode.
Definition: loapic.h:102
static uint64_t x86_read_x2apic(unsigned int reg)
Read 64-bit value from the local APIC in x2APIC mode.
Definition: loapic.h:74
#define LOAPIC_ICR_BUSY
Definition: loapic.h:44
#define LOAPIC_REGS_STR
Definition: loapic.h:53
static void x86_write_loapic(unsigned int reg, uint32_t val)
Write 32-bit value to the local APIC using the default mode.
Definition: loapic.h:147
static void x86_write_xapic(unsigned int reg, uint32_t val)
Write 32-bit value to the local APIC in xAPIC (MMIO) mode.
Definition: loapic.h:129
#define X86_X2APIC_BASE_MSR
Definition: msr.h:25
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT64_TYPE__ uint64_t
Definition: stdint.h:91
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
static ALWAYS_INLINE void sys_write32(uint32_t data, mem_addr_t addr)
Definition: sys-io-common.h:70
static ALWAYS_INLINE uint32_t sys_read32(mem_addr_t addr)
Definition: sys-io-common.h:59
uintptr_t mm_reg_t
Definition: sys_io.h:20