drivers/acpi/acpi_processor.c
Source file repositories/reference/linux-study-clean/drivers/acpi/acpi_processor.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/acpi/acpi_processor.c- Extension
.c- Size
- 25862 bytes
- Lines
- 997
- Domain
- Driver Families
- Bucket
- drivers/acpi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/acpi.hlinux/cpu.hlinux/device.hlinux/dmi.hlinux/kernel.hlinux/module.hlinux/pci.hlinux/platform_device.hacpi/processor.hasm/cpu.hxen/xen.hinternal.h
Detected Declarations
function acpi_get_processor_handlefunction acpi_processor_errata_piix4function acpi_processor_erratafunction cpufreq_add_devicefunction acpi_pcc_cpufreq_initfunction acpi_pcc_cpufreq_initfunction acpi_processor_set_per_cpufunction per_cpufunction acpi_processor_hotadd_initfunction acpi_processor_hotadd_initfunction acpi_processor_get_infofunction usagefunction acpi_processor_addfunction acpi_processor_post_ejectfunction processor_physically_presentfunction acpi_processor_oscfunction acpi_early_processor_oscfunction acpi_early_processor_control_setupfunction acpi_processor_container_attachfunction processor_validated_ids_updatefunction acpi_processor_ids_walkfunction acpi_processor_check_duplicatesfunction acpi_duplicate_processor_idfunction acpi_processor_initfunction acpi_processor_claim_cst_controlfunction objectexport errata
Annotated Snippet
if (dev) {
errata.piix4.bmisx = pci_resource_start(dev, 4);
if (errata.piix4.bmisx)
dev_dbg(&dev->dev,
"Bus master activity detection (BM-IDE) erratum enabled\n");
pci_dev_put(dev);
}
/*
* Type-F DMA
* ----------
* Find the PIIX4 ISA Controller and read the Motherboard
* DMA controller's status to see if Type-F (Fast) DMA mode
* is enabled (bit 7) on either channel. Note that we'll
* disable C3 support if this is enabled, as some legacy
* devices won't operate well if fast DMA is disabled.
*/
dev = pci_get_subsys(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82371AB_0,
PCI_ANY_ID, PCI_ANY_ID, NULL);
if (dev) {
u8 value1 = 0, value2 = 0;
pci_read_config_byte(dev, 0x76, &value1);
pci_read_config_byte(dev, 0x77, &value2);
if ((value1 & 0x80) || (value2 & 0x80)) {
errata.piix4.fdma = 1;
dev_dbg(&dev->dev,
"Type-F DMA livelock erratum (C3 disabled)\n");
}
pci_dev_put(dev);
}
break;
}
return 0;
}
static int acpi_processor_errata(void)
{
int result = 0;
struct pci_dev *dev = NULL;
/*
* PIIX4
*/
dev = pci_get_subsys(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82371AB_3, PCI_ANY_ID,
PCI_ANY_ID, NULL);
if (dev) {
result = acpi_processor_errata_piix4(dev);
pci_dev_put(dev);
}
return result;
}
/* Create a platform device to represent a CPU frequency control mechanism. */
static void cpufreq_add_device(const char *name)
{
struct platform_device *pdev;
pdev = platform_device_register_simple(name, PLATFORM_DEVID_NONE, NULL, 0);
if (IS_ERR(pdev))
pr_info("%s device creation failed: %pe\n", name, pdev);
}
#ifdef CONFIG_X86
/* Check presence of Processor Clocking Control by searching for \_SB.PCCH. */
static void __init acpi_pcc_cpufreq_init(void)
{
acpi_status status;
acpi_handle handle;
status = acpi_get_handle(NULL, "\\_SB", &handle);
if (ACPI_FAILURE(status))
return;
if (acpi_has_method(handle, "PCCH"))
cpufreq_add_device("pcc-cpufreq");
}
#else
static void __init acpi_pcc_cpufreq_init(void) {}
#endif /* CONFIG_X86 */
/* Initialization */
static DEFINE_PER_CPU(void *, processor_device_array);
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/cpu.h`, `linux/device.h`, `linux/dmi.h`, `linux/kernel.h`, `linux/module.h`, `linux/pci.h`, `linux/platform_device.h`.
- Detected declarations: `function acpi_get_processor_handle`, `function acpi_processor_errata_piix4`, `function acpi_processor_errata`, `function cpufreq_add_device`, `function acpi_pcc_cpufreq_init`, `function acpi_pcc_cpufreq_init`, `function acpi_processor_set_per_cpu`, `function per_cpu`, `function acpi_processor_hotadd_init`, `function acpi_processor_hotadd_init`.
- Atlas domain: Driver Families / drivers/acpi.
- Implementation status: integration 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.