drivers/hwmon/coretemp.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/coretemp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/coretemp.c- Extension
.c- Size
- 22364 bytes
- Lines
- 838
- Domain
- Driver Families
- Bucket
- drivers/hwmon
- 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/init.hlinux/slab.hlinux/jiffies.hlinux/hwmon.hlinux/sysfs.hlinux/hwmon-sysfs.hlinux/err.hlinux/mutex.hlinux/list.hlinux/platform_device.hlinux/cpu.hlinux/smp.hlinux/moduleparam.hlinux/pci.hasm/msr.hlinux/processor.hasm/cpu_device_id.hlinux/sched/isolation.h
Detected Declarations
struct temp_datastruct platform_datastruct tjmax_pcistruct tjmaxstruct tjmax_modelenum coretemp_attr_indexfunction is_pkg_temp_datafunction adjust_tjmaxfunction get_tjmaxfunction get_ttargetfunction show_labelfunction show_crit_alarmfunction show_tjmaxfunction show_ttargetfunction show_tempfunction create_core_attrsfunction chk_ucode_versionfunction D0function init_temp_datafunction destroy_temp_datafunction create_core_datafunction coretemp_add_corefunction coretemp_remove_corefunction coretemp_device_addfunction coretemp_device_removefunction coretemp_cpu_onlinefunction coretemp_cpu_offlinefunction coretemp_initfunction coretemp_exitmodule init coretemp_init
Annotated Snippet
module_init(coretemp_init)
static void __exit coretemp_exit(void)
{
int i;
cpuhp_remove_state(coretemp_hp_online);
for (i = 0; i < max_zones; i++)
coretemp_device_remove(i);
kfree(zone_devices);
}
module_exit(coretemp_exit)
MODULE_AUTHOR("Rudolf Marek <r.marek@assembler.cz>");
MODULE_DESCRIPTION("Intel Core temperature monitor");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/slab.h`, `linux/jiffies.h`, `linux/hwmon.h`, `linux/sysfs.h`, `linux/hwmon-sysfs.h`, `linux/err.h`.
- Detected declarations: `struct temp_data`, `struct platform_data`, `struct tjmax_pci`, `struct tjmax`, `struct tjmax_model`, `enum coretemp_attr_index`, `function is_pkg_temp_data`, `function adjust_tjmax`, `function get_tjmax`, `function get_ttarget`.
- Atlas domain: Driver Families / drivers/hwmon.
- 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.