drivers/misc/amd-sbi/rmi-core.c
Source file repositories/reference/linux-study-clean/drivers/misc/amd-sbi/rmi-core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/amd-sbi/rmi-core.c- Extension
.c- Size
- 14790 bytes
- Lines
- 595
- Domain
- Driver Families
- Bucket
- drivers/misc
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/err.hlinux/fs.hlinux/i2c.hlinux/miscdevice.hlinux/module.hlinux/mutex.hlinux/regmap.hrmi-core.h
Detected Declarations
struct cpu_msr_indatastruct cpu_msr_indata_extstruct cpu_msr_outdatafunction prepare_cpuid_input_messagefunction prepare_cpuid_input_message_extfunction prepare_mca_msr_input_messagefunction prepare_mca_msr_input_message_extfunction sbrmi_get_revfunction rmi_cpuid_inputfunction rmi_cpuid_input_extfunction rmi_cpuid_readfunction rmi_mcamsr_inputfunction rmi_mcamsr_input_extfunction rmi_mca_msr_readfunction rmi_mailbox_xferfunction apml_rmi_reg_xferfunction apml_mailbox_xferfunction apml_cpuid_xferfunction apml_mcamsr_xferfunction sbrmi_ioctlfunction create_misc_rmi_device
Annotated Snippet
static const struct file_operations sbrmi_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = sbrmi_ioctl,
.compat_ioctl = compat_ptr_ioctl,
};
int create_misc_rmi_device(struct sbrmi_data *data,
struct device *dev)
{
data->sbrmi_misc_dev.name = devm_kasprintf(dev,
GFP_KERNEL,
"sbrmi-%x",
data->dev_static_addr);
data->sbrmi_misc_dev.minor = MISC_DYNAMIC_MINOR;
data->sbrmi_misc_dev.fops = &sbrmi_fops;
data->sbrmi_misc_dev.parent = dev;
data->sbrmi_misc_dev.nodename = devm_kasprintf(dev,
GFP_KERNEL,
"sbrmi-%x",
data->dev_static_addr);
data->sbrmi_misc_dev.mode = 0600;
return misc_register(&data->sbrmi_misc_dev);
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/err.h`, `linux/fs.h`, `linux/i2c.h`, `linux/miscdevice.h`, `linux/module.h`, `linux/mutex.h`, `linux/regmap.h`.
- Detected declarations: `struct cpu_msr_indata`, `struct cpu_msr_indata_ext`, `struct cpu_msr_outdata`, `function prepare_cpuid_input_message`, `function prepare_cpuid_input_message_ext`, `function prepare_mca_msr_input_message`, `function prepare_mca_msr_input_message_ext`, `function sbrmi_get_rev`, `function rmi_cpuid_input`, `function rmi_cpuid_input_ext`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.