arch/x86/include/asm/apic.h
Source file repositories/reference/linux-study-clean/arch/x86/include/asm/apic.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/include/asm/apic.h- Extension
.h- Size
- 17114 bytes
- Lines
- 628
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpumask.hlinux/static_call.hasm/alternative.hasm/cpufeature.hasm/apicdef.hlinux/atomic.hasm/fixmap.hasm/mpspec.hasm/msr.hasm/hardirq.hasm/io.hasm/posted_intr.hasm/smp.h
Detected Declarations
struct irq_datastruct apicstruct apic_overridestruct msi_msgstruct irq_cfgenum apic_intr_mode_idfunction x86_32_probe_apicfunction tablefunction native_apic_mem_writefunction native_apic_mem_readfunction native_apic_mem_eoifunction apic_is_x2apic_enabledfunction apic_force_enablefunction apic_is_clustered_boxfunction lapic_shutdownfunction topology_apply_cmdline_limits_earlyfunction native_apic_msr_eoifunction native_apic_msr_readfunction native_x2apic_icr_writefunction native_x2apic_icr_readfunction x2apic_enabledfunction x2apic_setupfunction native_apic_msr_readfunction apic_readfunction apic_writefunction apic_eoifunction apic_native_eoifunction apic_icr_readfunction apic_icr_writefunction __apic_send_IPIfunction __apic_send_IPI_maskfunction __apic_send_IPI_mask_allbutselffunction __apic_send_IPI_allbutselffunction __apic_send_IPI_allfunction __apic_send_IPI_selffunction apic_wait_icr_idlefunction safe_apic_wait_icr_idlefunction apic_id_validfunction apic_update_vectorfunction apic_readfunction apic_writefunction apic_icr_writefunction apic_native_eoifunction apic_setup_apic_callsfunction lapic_vector_set_in_irrfunction is_vector_pendingfunction apic_find_highest_vectorfunction apic_get_reg
Annotated Snippet
struct apic {
/* Hotpath functions first */
void (*eoi)(void);
void (*native_eoi)(void);
void (*write)(u32 reg, u32 v);
u32 (*read)(u32 reg);
/* IPI related functions */
void (*wait_icr_idle)(void);
u32 (*safe_wait_icr_idle)(void);
void (*send_IPI)(int cpu, int vector);
void (*send_IPI_mask)(const struct cpumask *mask, int vector);
void (*send_IPI_mask_allbutself)(const struct cpumask *msk, int vec);
void (*send_IPI_allbutself)(int vector);
void (*send_IPI_all)(int vector);
void (*send_IPI_self)(int vector);
u32 disable_esr : 1,
dest_mode_logical : 1,
x2apic_set_max_apicid : 1,
nmi_to_offline_cpu : 1;
u32 (*calc_dest_apicid)(unsigned int cpu);
/* ICR related functions */
u64 (*icr_read)(void);
void (*icr_write)(u32 low, u32 high);
/* The limit of the APIC ID space. */
u32 max_apic_id;
/* Probe, setup and smpboot functions */
int (*probe)(void);
void (*setup)(void);
void (*teardown)(void);
int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
void (*init_apic_ldr)(void);
u32 (*cpu_present_to_apicid)(int mps_cpu);
u32 (*get_apic_id)(u32 id);
/* wakeup_secondary_cpu */
int (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip, unsigned int cpu);
/* wakeup secondary CPU using 64-bit wakeup point */
int (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip, unsigned int cpu);
void (*update_vector)(unsigned int cpu, unsigned int vector, bool set);
char *name;
};
struct apic_override {
void (*eoi)(void);
void (*native_eoi)(void);
void (*write)(u32 reg, u32 v);
u32 (*read)(u32 reg);
void (*send_IPI)(int cpu, int vector);
void (*send_IPI_mask)(const struct cpumask *mask, int vector);
void (*send_IPI_mask_allbutself)(const struct cpumask *msk, int vec);
void (*send_IPI_allbutself)(int vector);
void (*send_IPI_all)(int vector);
void (*send_IPI_self)(int vector);
u64 (*icr_read)(void);
void (*icr_write)(u32 low, u32 high);
int (*wakeup_secondary_cpu)(u32 apicid, unsigned long start_eip, unsigned int cpu);
int (*wakeup_secondary_cpu_64)(u32 apicid, unsigned long start_eip, unsigned int cpu);
};
/*
* Pointer to the local APIC driver in use on this system (there's
* always just one such driver in use - the kernel decides via an
* early probing process which one it picks - and then sticks to it):
*/
extern struct apic *apic;
/*
* APIC drivers are probed based on how they are listed in the .apicdrivers
* section. So the order is important and enforced by the ordering
* of different apic driver files in the Makefile.
*/
#define apic_driver(sym) \
static const struct apic *__apicdrivers_##sym __used \
__aligned(sizeof(struct apic *)) \
__section(".apicdrivers") = { &sym }
extern struct apic *__apicdrivers[], *__apicdrivers_end[];
/*
Annotation
- Immediate include surface: `linux/cpumask.h`, `linux/static_call.h`, `asm/alternative.h`, `asm/cpufeature.h`, `asm/apicdef.h`, `linux/atomic.h`, `asm/fixmap.h`, `asm/mpspec.h`.
- Detected declarations: `struct irq_data`, `struct apic`, `struct apic_override`, `struct msi_msg`, `struct irq_cfg`, `enum apic_intr_mode_id`, `function x86_32_probe_apic`, `function table`, `function native_apic_mem_write`, `function native_apic_mem_read`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.