drivers/watchdog/shwdt.c
Source file repositories/reference/linux-study-clean/drivers/watchdog/shwdt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/watchdog/shwdt.c- Extension
.c- Size
- 9026 bytes
- Lines
- 343
- Domain
- Driver Families
- Bucket
- drivers/watchdog
- 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.
- 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/module.hlinux/moduleparam.hlinux/platform_device.hlinux/init.hlinux/types.hlinux/spinlock.hlinux/watchdog.hlinux/pm_runtime.hlinux/fs.hlinux/mm.hlinux/slab.hlinux/io.hlinux/clk.hlinux/err.hasm/watchdog.h
Detected Declarations
struct sh_wdtfunction sh_wdt_startfunction sh_wdt_stopfunction sh_wdt_keepalivefunction sh_wdt_set_heartbeatfunction sh_wdt_pingfunction sh_wdt_probefunction sh_wdt_removefunction sh_wdt_shutdownfunction sh_wdt_initfunction sh_wdt_exitmodule init sh_wdt_init
Annotated Snippet
module_init(sh_wdt_init);
module_exit(sh_wdt_exit);
MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>");
MODULE_DESCRIPTION("SuperH watchdog driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" DRV_NAME);
module_param(clock_division_ratio, int, 0);
MODULE_PARM_DESC(clock_division_ratio,
"Clock division ratio. Valid ranges are from 0x5 (1.31ms) "
"to 0x7 (5.25ms). (default=" __MODULE_STRING(WTCSR_CKS_4096) ")");
module_param(heartbeat, int, 0);
MODULE_PARM_DESC(heartbeat,
"Watchdog heartbeat in seconds. (1 <= heartbeat <= 3600, default="
__MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/platform_device.h`, `linux/init.h`, `linux/types.h`, `linux/spinlock.h`, `linux/watchdog.h`, `linux/pm_runtime.h`.
- Detected declarations: `struct sh_wdt`, `function sh_wdt_start`, `function sh_wdt_stop`, `function sh_wdt_keepalive`, `function sh_wdt_set_heartbeat`, `function sh_wdt_ping`, `function sh_wdt_probe`, `function sh_wdt_remove`, `function sh_wdt_shutdown`, `function sh_wdt_init`.
- Atlas domain: Driver Families / drivers/watchdog.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.