drivers/thermal/testing/command.c
Source file repositories/reference/linux-study-clean/drivers/thermal/testing/command.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/thermal/testing/command.c- Extension
.c- Size
- 5634 bytes
- Lines
- 224
- Domain
- Driver Families
- Bucket
- drivers/thermal
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/module.hthermal_testing.h
Detected Declarations
enum tt_commandsfunction tt_command_execfunction tt_command_processfunction tt_command_writefunction thermal_testing_initfunction thermal_testing_exitmodule init thermal_testing_init
Annotated Snippet
static const struct file_operations tt_command_fops = {
.write = tt_command_write,
.open = simple_open,
.llseek = default_llseek,
};
static int __init thermal_testing_init(void)
{
d_testing = debugfs_create_dir("thermal-testing", NULL);
if (!IS_ERR(d_testing))
debugfs_create_file("command", 0200, d_testing, NULL,
&tt_command_fops);
return 0;
}
module_init(thermal_testing_init);
static void __exit thermal_testing_exit(void)
{
debugfs_remove(d_testing);
tt_zone_cleanup();
}
module_exit(thermal_testing_exit);
MODULE_DESCRIPTION("Thermal core testing facility");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/module.h`, `thermal_testing.h`.
- Detected declarations: `enum tt_commands`, `function tt_command_exec`, `function tt_command_process`, `function tt_command_write`, `function thermal_testing_init`, `function thermal_testing_exit`, `module init thermal_testing_init`.
- Atlas domain: Driver Families / drivers/thermal.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
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.