arch/mips/mm/dma-noncoherent.c
Source file repositories/reference/linux-study-clean/arch/mips/mm/dma-noncoherent.c
File Facts
- System
- Linux kernel
- Corpus path
arch/mips/mm/dma-noncoherent.c- Extension
.c- Size
- 3597 bytes
- Lines
- 145
- Domain
- Architecture Layer
- Bucket
- arch/mips
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dma-direct.hlinux/dma-map-ops.hlinux/highmem.hasm/cache.hasm/cpu-type.hasm/io.h
Detected Declarations
function cpu_needs_post_dma_flushfunction arch_dma_prep_coherentfunction dma_sync_virt_for_devicefunction dma_sync_virt_for_cpufunction dma_sync_physfunction arch_sync_dma_for_devicefunction arch_sync_dma_for_cpufunction arch_setup_dma_ops
Annotated Snippet
if (PageHighMem(page)) {
if (offset + len > PAGE_SIZE)
len = PAGE_SIZE - offset;
}
addr = kmap_atomic(page);
if (for_device)
dma_sync_virt_for_device(addr + offset, len, dir);
else
dma_sync_virt_for_cpu(addr + offset, len, dir);
kunmap_atomic(addr);
offset = 0;
page++;
left -= len;
} while (left);
}
void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
enum dma_data_direction dir)
{
dma_sync_phys(paddr, size, dir, true);
}
#ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU
void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
enum dma_data_direction dir)
{
if (cpu_needs_post_dma_flush())
dma_sync_phys(paddr, size, dir, false);
}
#endif
#ifdef CONFIG_ARCH_HAS_SETUP_DMA_OPS
void arch_setup_dma_ops(struct device *dev, bool coherent)
{
dev_assign_dma_coherent(dev, coherent);
}
#endif
Annotation
- Immediate include surface: `linux/dma-direct.h`, `linux/dma-map-ops.h`, `linux/highmem.h`, `asm/cache.h`, `asm/cpu-type.h`, `asm/io.h`.
- Detected declarations: `function cpu_needs_post_dma_flush`, `function arch_dma_prep_coherent`, `function dma_sync_virt_for_device`, `function dma_sync_virt_for_cpu`, `function dma_sync_phys`, `function arch_sync_dma_for_device`, `function arch_sync_dma_for_cpu`, `function arch_setup_dma_ops`.
- Atlas domain: Architecture Layer / arch/mips.
- Implementation status: source 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.