drivers/virt/coco/tsm-core.c
Source file repositories/reference/linux-study-clean/drivers/virt/coco/tsm-core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/virt/coco/tsm-core.c- Extension
.c- Size
- 2852 bytes
- Lines
- 133
- Domain
- Driver Families
- Bucket
- drivers/virt
- 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.
- 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/tsm.hlinux/device.hlinux/module.hlinux/cleanup.hlinux/pci-tsm.h
Detected Declarations
function match_idfunction tsm_unregisterfunction tsm_releasefunction tsm_initfunction tsm_exitmodule init tsm_initexport tsm_registerexport tsm_unregister
Annotated Snippet
rc = device_add(dev);
if (rc)
return ERR_PTR(rc);
return tsm_register_pci_or_reset(no_free_ptr(tsm_dev), pci_ops);
}
EXPORT_SYMBOL_GPL(tsm_register);
void tsm_unregister(struct tsm_dev *tsm_dev)
{
if (tsm_dev->pci_ops)
pci_tsm_unregister(tsm_dev);
device_unregister(&tsm_dev->dev);
}
EXPORT_SYMBOL_GPL(tsm_unregister);
static void tsm_release(struct device *dev)
{
struct tsm_dev *tsm_dev = container_of(dev, typeof(*tsm_dev), dev);
ida_free(&tsm_ida, tsm_dev->id);
kfree(tsm_dev);
}
static int __init tsm_init(void)
{
return class_register(&tsm_class);
}
module_init(tsm_init)
static void __exit tsm_exit(void)
{
class_unregister(&tsm_class);
}
module_exit(tsm_exit)
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("TEE Security Manager Class Device");
Annotation
- Immediate include surface: `linux/tsm.h`, `linux/device.h`, `linux/module.h`, `linux/cleanup.h`, `linux/pci-tsm.h`.
- Detected declarations: `function match_id`, `function tsm_unregister`, `function tsm_release`, `function tsm_init`, `function tsm_exit`, `module init tsm_init`, `export tsm_register`, `export tsm_unregister`.
- Atlas domain: Driver Families / drivers/virt.
- Implementation status: integration implementation candidate.
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.