drivers/iommu/omap-iommu-debug.c
Source file repositories/reference/linux-study-clean/drivers/iommu/omap-iommu-debug.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/iommu/omap-iommu-debug.c- Extension
.c- Size
- 5566 bytes
- Lines
- 275
- Domain
- Driver Families
- Bucket
- drivers/iommu
- 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.
- 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/err.hlinux/io.hlinux/slab.hlinux/uaccess.hlinux/pm_runtime.hlinux/debugfs.hlinux/platform_data/iommu-omap.homap-iopgtable.homap-iommu.h
Detected Declarations
function is_omap_iommu_detachedfunction omap2_iommu_dump_ctxfunction omap_iommu_dump_ctxfunction debug_read_regsfunction __dump_tlb_entriesfunction for_each_iotlb_crfunction iotlb_dump_crfunction omap_dump_tlb_entriesfunction tlb_showfunction dump_ioptablefunction pagetable_showfunction omap_iommu_debugfs_addfunction omap_iommu_debugfs_removefunction omap_iommu_debugfs_initfunction omap_iommu_debugfs_exit
Annotated Snippet
static const struct file_operations name##_fops = { \
.open = simple_open, \
.read = debug_read_##name, \
.llseek = generic_file_llseek, \
}
DEBUG_FOPS_RO(regs);
DEFINE_SHOW_ATTRIBUTE(tlb);
DEFINE_SHOW_ATTRIBUTE(pagetable);
void omap_iommu_debugfs_add(struct omap_iommu *obj)
{
struct dentry *d;
if (!iommu_debug_root)
return;
d = debugfs_create_dir(obj->name, iommu_debug_root);
obj->debug_dir = d;
debugfs_create_u32("nr_tlb_entries", 0400, d, &obj->nr_tlb_entries);
debugfs_create_file("regs", 0400, d, obj, ®s_fops);
debugfs_create_file("tlb", 0400, d, obj, &tlb_fops);
debugfs_create_file("pagetable", 0400, d, obj, &pagetable_fops);
}
void omap_iommu_debugfs_remove(struct omap_iommu *obj)
{
if (!obj->debug_dir)
return;
debugfs_remove_recursive(obj->debug_dir);
}
void __init omap_iommu_debugfs_init(void)
{
iommu_debug_root = debugfs_create_dir("omap_iommu", NULL);
}
void __exit omap_iommu_debugfs_exit(void)
{
debugfs_remove(iommu_debug_root);
}
Annotation
- Immediate include surface: `linux/err.h`, `linux/io.h`, `linux/slab.h`, `linux/uaccess.h`, `linux/pm_runtime.h`, `linux/debugfs.h`, `linux/platform_data/iommu-omap.h`, `omap-iopgtable.h`.
- Detected declarations: `function is_omap_iommu_detached`, `function omap2_iommu_dump_ctx`, `function omap_iommu_dump_ctx`, `function debug_read_regs`, `function __dump_tlb_entries`, `function for_each_iotlb_cr`, `function iotlb_dump_cr`, `function omap_dump_tlb_entries`, `function tlb_show`, `function dump_ioptable`.
- Atlas domain: Driver Families / drivers/iommu.
- Implementation status: pattern 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.