drivers/clocksource/acpi_pm.c
Source file repositories/reference/linux-study-clean/drivers/clocksource/acpi_pm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clocksource/acpi_pm.c- Extension
.c- Size
- 7336 bytes
- Lines
- 276
- Domain
- Driver Families
- Bucket
- drivers/clocksource
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi_pmtmr.hlinux/clocksource.hlinux/timex.hlinux/errno.hlinux/init.hlinux/pci.hlinux/delay.hasm/io.hasm/time.hasm/mach_timer.h
Detected Declarations
function read_pmtmrfunction acpi_pm_read_verifiedfunction acpi_pmtmr_register_suspend_resume_callbackfunction acpi_pmtmr_unregister_suspend_resume_callbackfunction acpi_pm_suspendfunction acpi_pm_resumefunction acpi_pm_readfunction acpi_pm_good_setupfunction acpi_pm_read_slowfunction acpi_pm_need_workaroundfunction indeterminatefunction acpi_pm_check_graylistfunction verify_pmtmr_ratefunction init_acpi_pm_clocksourcefunction parse_pmtmrmodule init init_acpi_pm_clocksourceexport acpi_pmtmr_register_suspend_resume_callbackexport acpi_pmtmr_unregister_suspend_resume_callback
Annotated Snippet
if (i == ACPI_PM_READ_CHECKS) {
pr_info("PM-Timer failed consistency check (%#llx) - aborting.\n",
value1);
pmtmr_ioport = 0;
return -ENODEV;
}
}
if (verify_pmtmr_rate() != 0){
pmtmr_ioport = 0;
return -ENODEV;
}
return clocksource_register_hz(&clocksource_acpi_pm, PMTMR_TICKS_PER_SEC);
}
/* We use fs_initcall because we want the PCI fixups to have run
* but we still need to load before device_initcall
*/
fs_initcall(init_acpi_pm_clocksource);
/*
* Allow an override of the IOPort. Stupid BIOSes do not tell us about
* the PMTimer, but we might know where it is.
*/
static int __init parse_pmtmr(char *arg)
{
unsigned int base;
int ret;
ret = kstrtouint(arg, 16, &base);
if (ret) {
pr_warn("PMTMR: invalid 'pmtmr=' value: '%s'\n", arg);
return 1;
}
pr_info("PMTMR IOPort override: 0x%04x -> 0x%04x\n", pmtmr_ioport,
base);
pmtmr_ioport = base;
return 1;
}
__setup("pmtmr=", parse_pmtmr);
Annotation
- Immediate include surface: `linux/acpi_pmtmr.h`, `linux/clocksource.h`, `linux/timex.h`, `linux/errno.h`, `linux/init.h`, `linux/pci.h`, `linux/delay.h`, `asm/io.h`.
- Detected declarations: `function read_pmtmr`, `function acpi_pm_read_verified`, `function acpi_pmtmr_register_suspend_resume_callback`, `function acpi_pmtmr_unregister_suspend_resume_callback`, `function acpi_pm_suspend`, `function acpi_pm_resume`, `function acpi_pm_read`, `function acpi_pm_good_setup`, `function acpi_pm_read_slow`, `function acpi_pm_need_workaround`.
- Atlas domain: Driver Families / drivers/clocksource.
- 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.