arch/x86/kernel/apic/vector.c
Source file repositories/reference/linux-study-clean/arch/x86/kernel/apic/vector.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kernel/apic/vector.c- Extension
.c- Size
- 37615 bytes
- Lines
- 1388
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/interrupt.hlinux/irq.hlinux/seq_file.hlinux/init.hlinux/compiler.hlinux/slab.hasm/irqdomain.hasm/hw_irq.hasm/traps.hasm/apic.hasm/i8259.hasm/desc.hasm/irq_remapping.hasm/trace/irq_vectors.h
Detected Declarations
struct apic_chip_datastruct vector_cleanupfunction lock_vector_lockfunction unlock_vector_lockfunction init_irq_alloc_infofunction copy_irq_alloc_infofunction free_apic_chip_datafunction apic_update_irq_cfgfunction apic_free_vectorfunction chip_data_updatefunction vector_assign_managed_shutdownfunction reserve_managed_vectorfunction reserve_irq_vector_lockedfunction reserve_irq_vectorfunction assign_vector_lockedfunction assign_irq_vectorfunction assign_irq_vector_any_lockedfunction assign_irq_vector_policyfunction assign_managed_vectorfunction clear_irq_vectorfunction x86_vector_deactivatefunction activate_reservedfunction irq_data_get_affinity_maskfunction activate_managedfunction x86_vector_activatefunction vector_free_reserved_and_managedfunction x86_vector_free_irqsfunction vector_configure_legacyfunction x86_vector_alloc_irqsfunction check_timerfunction x86_vector_debug_showfunction x86_fwspec_is_ioapicfunction x86_fwspec_is_hpetfunction x86_vector_selectfunction arch_probe_nr_irqsfunction lapic_assign_legacy_vectorfunction lapic_update_legacy_vectorsfunction lapic_assign_system_vectorsfunction arch_early_irq_initfunction lapic_onlinefunction lapic_offlinefunction apic_set_affinityfunction free_moved_vectorfunction fixup_irqsfunction __irq_complete_movefunction apic_retrigger_irqfunction apic_ack_irqfunction apic_ack_edge
Annotated Snippet
struct apic_chip_data {
struct irq_cfg hw_irq_cfg;
unsigned int vector;
unsigned int prev_vector;
unsigned int cpu;
unsigned int prev_cpu;
unsigned int irq;
struct hlist_node clist;
unsigned int move_in_progress : 1,
is_managed : 1,
can_reserve : 1,
has_reserved : 1;
};
struct irq_domain *x86_vector_domain;
EXPORT_SYMBOL_GPL(x86_vector_domain);
static DEFINE_RAW_SPINLOCK(vector_lock);
static cpumask_var_t vector_searchmask;
static struct irq_chip lapic_controller;
static struct irq_matrix *vector_matrix;
#ifdef CONFIG_SMP
static void vector_cleanup_callback(struct timer_list *tmr);
struct vector_cleanup {
struct hlist_head head;
struct timer_list timer;
};
static DEFINE_PER_CPU(struct vector_cleanup, vector_cleanup) = {
.head = HLIST_HEAD_INIT,
.timer = __TIMER_INITIALIZER(vector_cleanup_callback, TIMER_PINNED),
};
#endif
void lock_vector_lock(void)
{
/* Used to the online set of cpus does not change
* during assign_irq_vector.
*/
raw_spin_lock(&vector_lock);
}
void unlock_vector_lock(void)
{
raw_spin_unlock(&vector_lock);
}
void init_irq_alloc_info(struct irq_alloc_info *info,
const struct cpumask *mask)
{
memset(info, 0, sizeof(*info));
info->mask = mask;
}
void copy_irq_alloc_info(struct irq_alloc_info *dst, struct irq_alloc_info *src)
{
if (src)
*dst = *src;
else
memset(dst, 0, sizeof(*dst));
}
static struct apic_chip_data *apic_chip_data(struct irq_data *irqd)
{
if (!irqd)
return NULL;
while (irqd->parent_data)
irqd = irqd->parent_data;
return irqd->chip_data;
}
struct irq_cfg *irqd_cfg(struct irq_data *irqd)
{
struct apic_chip_data *apicd = apic_chip_data(irqd);
return apicd ? &apicd->hw_irq_cfg : NULL;
}
EXPORT_SYMBOL_GPL(irqd_cfg);
struct irq_cfg *irq_cfg(unsigned int irq)
{
return irqd_cfg(irq_get_irq_data(irq));
}
static struct apic_chip_data *alloc_apic_chip_data(int node)
{
struct apic_chip_data *apicd;
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/irq.h`, `linux/seq_file.h`, `linux/init.h`, `linux/compiler.h`, `linux/slab.h`, `asm/irqdomain.h`, `asm/hw_irq.h`.
- Detected declarations: `struct apic_chip_data`, `struct vector_cleanup`, `function lock_vector_lock`, `function unlock_vector_lock`, `function init_irq_alloc_info`, `function copy_irq_alloc_info`, `function free_apic_chip_data`, `function apic_update_irq_cfg`, `function apic_free_vector`, `function chip_data_update`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.