drivers/clocksource/sh_cmt.c
Source file repositories/reference/linux-study-clean/drivers/clocksource/sh_cmt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clocksource/sh_cmt.c- Extension
.c- Size
- 29557 bytes
- Lines
- 1190
- 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.
- 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/clk.hlinux/clockchips.hlinux/clocksource.hlinux/delay.hlinux/err.hlinux/init.hlinux/interrupt.hlinux/io.hlinux/iopoll.hlinux/ioport.hlinux/irq.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_domain.hlinux/pm_runtime.hlinux/sh_timer.hlinux/slab.hlinux/spinlock.hasm/platform_early.h
Detected Declarations
struct sh_cmt_devicestruct sh_cmt_infostruct sh_cmt_channelstruct sh_cmt_deviceenum sh_cmt_modelfunction sh_cmt_read16function sh_cmt_read32function sh_cmt_write16function sh_cmt_write32function sh_cmt_read_cmstrfunction sh_cmt_write_cmstrfunction sh_cmt_read_cmcsrfunction sh_cmt_write_cmcsrfunction sh_cmt_read_cmcntfunction sh_cmt_write_cmcntfunction sh_cmt_write_cmcorfunction sh_cmt_get_counterfunction sh_cmt_start_stop_chfunction sh_cmt_enablefunction sh_cmt_disablefunction sh_cmt_clock_event_program_verifyfunction __sh_cmt_set_nextfunction sh_cmt_set_nextfunction sh_cmt_interruptfunction sh_cmt_start_clocksourcefunction sh_cmt_stop_clocksourcefunction sh_cmt_start_clockeventfunction sh_cmt_stop_clockeventfunction sh_cmt_clocksource_readfunction sh_cmt_clocksource_enablefunction sh_cmt_clocksource_disablefunction sh_cmt_clocksource_suspendfunction sh_cmt_clocksource_resumefunction sh_cmt_register_clocksourcefunction sh_cmt_clock_event_startfunction sh_cmt_clock_event_shutdownfunction sh_cmt_clock_event_set_statefunction sh_cmt_clock_event_set_oneshotfunction sh_cmt_clock_event_set_periodicfunction sh_cmt_clock_event_nextfunction sh_cmt_clock_event_suspendfunction sh_cmt_clock_event_resumefunction sh_cmt_register_clockeventfunction sh_cmt_registerfunction sh_cmt_setup_channelfunction sh_cmt_map_memoryfunction sh_cmt_setupfunction sh_cmt_probe
Annotated Snippet
subsys_initcall(sh_cmt_init);
module_exit(sh_cmt_exit);
MODULE_AUTHOR("Magnus Damm");
MODULE_DESCRIPTION("SuperH CMT Timer Driver");
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clockchips.h`, `linux/clocksource.h`, `linux/delay.h`, `linux/err.h`, `linux/init.h`, `linux/interrupt.h`, `linux/io.h`.
- Detected declarations: `struct sh_cmt_device`, `struct sh_cmt_info`, `struct sh_cmt_channel`, `struct sh_cmt_device`, `enum sh_cmt_model`, `function sh_cmt_read16`, `function sh_cmt_read32`, `function sh_cmt_write16`, `function sh_cmt_write32`, `function sh_cmt_read_cmstr`.
- Atlas domain: Driver Families / drivers/clocksource.
- 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.