coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
lapic.h File Reference
#include <arch/mmio.h>
#include <arch/cpu.h>
#include <cpu/x86/lapic_def.h>
#include <cpu/x86/msr.h>
#include <halt.h>
#include <stdint.h>
Include dependency graph for lapic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static __always_inline uint32_t xapic_read (unsigned int reg)
 
static __always_inline void xapic_write (unsigned int reg, uint32_t v)
 
static __always_inline void xapic_send_ipi (uint32_t icrlow, uint32_t icrhi)
 
static __always_inline int xapic_busy (void)
 
static __always_inline uint32_t x2apic_read (unsigned int reg)
 
static __always_inline void x2apic_write (unsigned int reg, uint32_t v)
 
static __always_inline void x2apic_send_ipi (uint32_t icrlow, uint32_t icrhi)
 
static __always_inline bool is_x2apic_mode (void)
 
static __always_inline uint32_t lapic_read (unsigned int reg)
 
static __always_inline void lapic_write (unsigned int reg, uint32_t v)
 
static __always_inline void lapic_update32 (unsigned int reg, uint32_t mask, uint32_t or)
 
static __always_inline void lapic_send_ipi (uint32_t icrlow, uint32_t apicid)
 
static __always_inline int lapic_busy (void)
 
static __always_inline unsigned int initial_lapicid (void)
 
static __always_inline unsigned int lapicid (void)
 
static __always_inline void lapic_send_ipi_self (uint32_t icrlow)
 
static __always_inline void lapic_send_ipi_others (uint32_t icrlow)
 
static __always_inline void stop_this_cpu (void)
 
void enable_lapic (void)
 
void disable_lapic (void)
 
void setup_lapic_interrupts (void)
 

Function Documentation

◆ disable_lapic()

void disable_lapic ( void  )

Definition at line 55 of file lapic.c.

References LAPIC_BASE_MSR, LAPIC_BASE_MSR_ENABLE, LAPIC_BASE_MSR_X2APIC_MODE, msr_struct::lo, rdmsr(), and wrmsr().

Referenced by initialize_cpus().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enable_lapic()

◆ initial_lapicid()

static __always_inline unsigned int initial_lapicid ( void  )
static

Definition at line 126 of file lapic.h.

References cpuid_ebx(), cpuid_ext(), cpuid_get_max_func(), cpuid_result::edx, is_x2apic_mode(), and lapicid().

Referenced by agesa_state_on_entry(), cpu_add_map_entry(), cpu_index(), intel_ht_sibling(), mca_print_error(), romstage_main(), and update_save_state().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_x2apic_mode()

static __always_inline bool is_x2apic_mode ( void  )
static

Definition at line 62 of file lapic.h.

References CONFIG, LAPIC_BASE_MSR, LAPIC_BASE_X2APIC_ENABLED, msr_struct::lo, and rdmsr().

Referenced by acpi_madt_irq_overrides(), initial_lapicid(), lapic_busy(), lapic_read(), lapic_send_ipi(), lapic_update32(), lapic_write(), and lapicid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lapic_busy()

static __always_inline int lapic_busy ( void  )
static

Definition at line 118 of file lapic.h.

References is_x2apic_mode(), and xapic_busy().

Referenced by smm_initiate_relocation_parallel(), wait_for_ipi_completion(), and wait_for_ipi_completion_without_printk().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lapic_read()

static __always_inline uint32_t lapic_read ( unsigned int  reg)
static

Definition at line 75 of file lapic.h.

References is_x2apic_mode(), x2apic_read(), and xapic_read().

Referenced by lapic_start_cpu(), lapicid(), smp_write_processors(), and udelay().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lapic_send_ipi()

static __always_inline void lapic_send_ipi ( uint32_t  icrlow,
uint32_t  apicid 
)
static

Definition at line 110 of file lapic.h.

References is_x2apic_mode(), SET_LAPIC_DEST_FIELD, x2apic_send_ipi(), and xapic_send_ipi().

Referenced by lapic_send_ipi_others(), lapic_send_ipi_self(), and lapic_start_cpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lapic_send_ipi_others()

static __always_inline void lapic_send_ipi_others ( uint32_t  icrlow)
static

Definition at line 160 of file lapic.h.

References LAPIC_DEST_ALLBUT, and lapic_send_ipi().

Here is the call graph for this function:

◆ lapic_send_ipi_self()

static __always_inline void lapic_send_ipi_self ( uint32_t  icrlow)
static

Definition at line 146 of file lapic.h.

References CONFIG, cpu_relax(), lapic_send_ipi(), and lapicid().

Referenced by smm_initiate_relocation_parallel(), and stop_this_cpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lapic_update32()

static __always_inline void lapic_update32 ( unsigned int  reg,
uint32_t  mask,
uint32_t  or 
)
static

Definition at line 91 of file lapic.h.

References is_x2apic_mode(), msr_struct::lo, mask, rdmsr(), value, wrmsr(), X2APIC_MSR_BASE_ADDRESS, xapic_read(), and xapic_write().

Referenced by setup_lapic_interrupts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lapic_write()

static __always_inline void lapic_write ( unsigned int  reg,
uint32_t  v 
)
static

Definition at line 83 of file lapic.h.

References is_x2apic_mode(), x2apic_write(), and xapic_write().

Referenced by init_timer(), and lapic_start_cpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lapicid()

static __always_inline unsigned int lapicid ( void  )
static

◆ setup_lapic_interrupts()

void setup_lapic_interrupts ( void  )

◆ stop_this_cpu()

static __always_inline void stop_this_cpu ( void  )
static

Definition at line 169 of file lapic.h.

References halt().

Here is the call graph for this function:

◆ x2apic_read()

static __always_inline uint32_t x2apic_read ( unsigned int  reg)
static

Definition at line 32 of file lapic.h.

References msr_struct::lo, rdmsr(), value, and X2APIC_MSR_BASE_ADDRESS.

Referenced by lapic_read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x2apic_send_ipi()

static __always_inline void x2apic_send_ipi ( uint32_t  icrlow,
uint32_t  icrhi 
)
static

Definition at line 54 of file lapic.h.

References msr_struct::hi, msr_struct::lo, wrmsr(), and X2APIC_MSR_ICR_ADDRESS.

Referenced by lapic_send_ipi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x2apic_write()

static __always_inline void x2apic_write ( unsigned int  reg,
uint32_t  v 
)
static

Definition at line 43 of file lapic.h.

References msr_struct::hi, msr_struct::lo, wrmsr(), and X2APIC_MSR_BASE_ADDRESS.

Referenced by lapic_write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xapic_busy()

static __always_inline int xapic_busy ( void  )
static

Definition at line 27 of file lapic.h.

References LAPIC_ICR, LAPIC_ICR_BUSY, and xapic_read().

Referenced by lapic_busy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xapic_read()

static __always_inline uint32_t xapic_read ( unsigned int  reg)
static

Definition at line 11 of file lapic.h.

References LAPIC_DEFAULT_BASE, and read32().

Referenced by lapic_read(), lapic_update32(), and xapic_busy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xapic_send_ipi()

static __always_inline void xapic_send_ipi ( uint32_t  icrlow,
uint32_t  icrhi 
)
static

Definition at line 21 of file lapic.h.

References LAPIC_ICR, LAPIC_ICR2, and xapic_write().

Referenced by lapic_send_ipi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xapic_write()

static __always_inline void xapic_write ( unsigned int  reg,
uint32_t  v 
)
static

Definition at line 16 of file lapic.h.

References LAPIC_DEFAULT_BASE, and write32().

Referenced by lapic_update32(), lapic_write(), and xapic_send_ipi().

Here is the call graph for this function:
Here is the caller graph for this function: