arch/x86/kernel/mpparse.c
Source file repositories/reference/linux-study-clean/arch/x86/kernel/mpparse.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/kernel/mpparse.c- Extension
.c- Size
- 22440 bytes
- Lines
- 944
- 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/mm.hlinux/init.hlinux/delay.hlinux/memblock.hlinux/kernel_stat.hlinux/mc146818rtc.hlinux/bitops.hlinux/acpi.hlinux/smp.hlinux/pci.hasm/i8259.hasm/io_apic.hasm/acpi.hasm/irqdomain.hasm/mtrr.hasm/mpspec.hasm/proto.hasm/bios_ebda.hasm/e820/api.hasm/setup.hasm/smp.hasm/apic.h
Detected Declarations
function mpf_checksumfunction MP_processor_infofunction mpc_oem_bus_infofunction MP_bus_infofunction MP_ioapic_infofunction print_mp_irq_infofunction MP_bus_infofunction smp_check_mpcfunction skip_entryfunction smp_dump_mptablefunction smp_read_mpcfunction ELCR_triggerfunction construct_default_ioirq_mptablefunction construct_ioapic_tablefunction construct_ioapic_tablefunction get_mpc_sizefunction check_physptrfunction mpparse_get_smp_configfunction mpparse_parse_early_smp_configfunction mpparse_parse_smp_configfunction smp_reserve_memoryfunction smp_scan_configfunction mpparse_find_mptablefunction get_MP_intsrc_indexfunction check_irq_srcfunction check_slotfunction check_irq_srcfunction update_mptable_setupfunction parse_alloc_mptable_optfunction e820__memblock_alloc_reserved_mpc_newfunction update_mp_table
Annotated Snippet
static inline void __init MP_bus_info(struct mpc_bus *m) {}
static inline void __init MP_ioapic_info(struct mpc_ioapic *m) {}
#endif /* CONFIG_X86_IO_APIC */
static void __init MP_lintsrc_info(struct mpc_lintsrc *m)
{
apic_printk(APIC_VERBOSE,
"Lint: type %d, pol %d, trig %d, bus %02x, IRQ %02x, APIC ID %x, APIC LINT %02x\n",
m->irqtype, m->irqflag & 3, (m->irqflag >> 2) & 3, m->srcbusid,
m->srcbusirq, m->destapic, m->destapiclint);
}
/*
* Read/parse the MPC
*/
static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str)
{
if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) {
pr_err("MPTABLE: bad signature [%c%c%c%c]!\n",
mpc->signature[0], mpc->signature[1],
mpc->signature[2], mpc->signature[3]);
return 0;
}
if (mpf_checksum((unsigned char *)mpc, mpc->length)) {
pr_err("MPTABLE: checksum error!\n");
return 0;
}
if (mpc->spec != 0x01 && mpc->spec != 0x04) {
pr_err("MPTABLE: bad table version (%d)!!\n", mpc->spec);
return 0;
}
if (!mpc->lapic) {
pr_err("MPTABLE: null local APIC address!\n");
return 0;
}
memcpy(oem, mpc->oem, 8);
oem[8] = 0;
pr_info("MPTABLE: OEM ID: %s\n", oem);
memcpy(str, mpc->productid, 12);
str[12] = 0;
pr_info("MPTABLE: Product ID: %s\n", str);
pr_info("MPTABLE: APIC at: 0x%X\n", mpc->lapic);
return 1;
}
static void skip_entry(unsigned char **ptr, int *count, int size)
{
*ptr += size;
*count += size;
}
static void __init smp_dump_mptable(struct mpc_table *mpc, unsigned char *mpt)
{
pr_err("Your mptable is wrong, contact your HW vendor!\n");
pr_cont("type %x\n", *mpt);
print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
1, mpc, mpc->length, 1);
}
static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
{
char str[16];
char oem[10];
int count = sizeof(*mpc);
unsigned char *mpt = ((unsigned char *)mpc) + count;
if (!smp_check_mpc(mpc, oem, str))
return 0;
if (early) {
/* Initialize the lapic mapping */
if (!acpi_lapic)
register_lapic_address(mpc->lapic);
return 1;
}
/* Now process the configuration blocks. */
while (count < mpc->length) {
switch (*mpt) {
case MP_PROCESSOR:
/* ACPI may have already provided this data */
if (!acpi_lapic)
MP_processor_info((struct mpc_cpu *)mpt);
skip_entry(&mpt, &count, sizeof(struct mpc_cpu));
Annotation
- Immediate include surface: `linux/mm.h`, `linux/init.h`, `linux/delay.h`, `linux/memblock.h`, `linux/kernel_stat.h`, `linux/mc146818rtc.h`, `linux/bitops.h`, `linux/acpi.h`.
- Detected declarations: `function mpf_checksum`, `function MP_processor_info`, `function mpc_oem_bus_info`, `function MP_bus_info`, `function MP_ioapic_info`, `function print_mp_irq_info`, `function MP_bus_info`, `function smp_check_mpc`, `function skip_entry`, `function smp_dump_mptable`.
- 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.