drivers/dma-buf/heaps/cma_heap.c
Source file repositories/reference/linux-study-clean/drivers/dma-buf/heaps/cma_heap.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma-buf/heaps/cma_heap.c- Extension
.c- Size
- 9617 bytes
- Lines
- 426
- Domain
- Driver Families
- Bucket
- drivers/dma-buf
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/cma.hlinux/dma-buf.hlinux/dma-heap.hlinux/dma-map-ops.hlinux/err.hlinux/highmem.hlinux/io.hlinux/mm.hlinux/module.hlinux/of.hlinux/of_reserved_mem.hlinux/scatterlist.hlinux/slab.hlinux/vmalloc.h
Detected Declarations
struct cma_heapstruct cma_heap_bufferstruct dma_heap_attachmentfunction cma_heap_attachfunction cma_heap_detachfunction cma_heap_unmap_dma_buffunction cma_heap_dma_buf_begin_cpu_accessfunction list_for_each_entryfunction cma_heap_dma_buf_end_cpu_accessfunction list_for_each_entryfunction cma_heap_vm_faultfunction cma_heap_mmapfunction cma_heap_vmapfunction cma_heap_vunmapfunction cma_heap_dma_buf_releasefunction __add_cma_heapfunction add_cma_heapsmodule init add_cma_heaps
Annotated Snippet
module_init(add_cma_heaps);
MODULE_DESCRIPTION("DMA-BUF CMA Heap");
MODULE_LICENSE("GPL");
MODULE_IMPORT_NS("DMA_BUF");
MODULE_IMPORT_NS("DMA_BUF_HEAP");
Annotation
- Immediate include surface: `linux/cma.h`, `linux/dma-buf.h`, `linux/dma-heap.h`, `linux/dma-map-ops.h`, `linux/err.h`, `linux/highmem.h`, `linux/io.h`, `linux/mm.h`.
- Detected declarations: `struct cma_heap`, `struct cma_heap_buffer`, `struct dma_heap_attachment`, `function cma_heap_attach`, `function cma_heap_detach`, `function cma_heap_unmap_dma_buf`, `function cma_heap_dma_buf_begin_cpu_access`, `function list_for_each_entry`, `function cma_heap_dma_buf_end_cpu_access`, `function list_for_each_entry`.
- Atlas domain: Driver Families / drivers/dma-buf.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.