arch/powerpc/kernel/dma-iommu.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/dma-iommu.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/dma-iommu.c- Extension
.c- Size
- 6192 bytes
- Lines
- 230
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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/dma-direct.hlinux/pci.hasm/iommu.h
Detected Declarations
function Copyrightfunction arch_dma_unmap_phys_directfunction arch_dma_map_sg_directfunction for_each_sgfunction arch_dma_unmap_sg_directfunction for_each_sgfunction arch_dma_alloc_directfunction arch_dma_free_directfunction addressfunction dma_iommu_free_coherentfunction storagefunction dma_iommu_unmap_physfunction dma_iommu_map_sgfunction dma_iommu_unmap_sgfunction dma_iommu_bypass_supportedfunction dma_iommu_dma_supportedfunction dma_iommu_get_required_mask
Annotated Snippet
if (dma_iommu_dma_supported(dev, bypass_mask)) {
dev_info(dev, "%s: returning bypass mask 0x%llx\n", __func__, bypass_mask);
return bypass_mask;
}
}
if (!tbl)
return 0;
mask = 1ULL << (fls_long(tbl->it_offset + tbl->it_size) +
tbl->it_page_shift - 1);
mask += mask - 1;
return mask;
}
const struct dma_map_ops dma_iommu_ops = {
.alloc = dma_iommu_alloc_coherent,
.free = dma_iommu_free_coherent,
.map_sg = dma_iommu_map_sg,
.unmap_sg = dma_iommu_unmap_sg,
.dma_supported = dma_iommu_dma_supported,
.map_phys = dma_iommu_map_phys,
.unmap_phys = dma_iommu_unmap_phys,
.get_required_mask = dma_iommu_get_required_mask,
.mmap = dma_common_mmap,
.get_sgtable = dma_common_get_sgtable,
.alloc_pages_op = dma_common_alloc_pages,
.free_pages = dma_common_free_pages,
};
Annotation
- Immediate include surface: `linux/dma-direct.h`, `linux/pci.h`, `asm/iommu.h`.
- Detected declarations: `function Copyright`, `function arch_dma_unmap_phys_direct`, `function arch_dma_map_sg_direct`, `function for_each_sg`, `function arch_dma_unmap_sg_direct`, `function for_each_sg`, `function arch_dma_alloc_direct`, `function arch_dma_free_direct`, `function address`, `function dma_iommu_free_coherent`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source implementation candidate.
- 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.