⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module iommu

Module iommu 

Source
Expand description

IOMMU (I/O Memory Management Unit) Foundation

Provides DMA address translation and device isolation via Intel VT-d (or equivalent on other architectures). This module handles:

  • DMAR table detection from ACPI
  • IOMMU unit discovery and capability reading
  • Identity mapping for known-safe devices
  • DMA coherency flags and scatter-gather list support

Full IOMMU page table management is deferred to a later phase; this module provides the foundation for safe DMA with identity mapping.

Structs§

DeviceScope
Device scope entry within DRHD or RMRR structures.
DmaMappedBuffer
A DMA-mapped buffer with coherency and direction tracking.
DmarInfo
Parsed DMAR (DMA Remapping) table information.
DrhdUnit
A DMA Remapping Hardware Unit discovered from the ACPI DMAR table.
IommuContextTable
IOMMU context table (256 entries per PCI bus, page-aligned).
IommuUnit
Represents a parsed IOMMU hardware unit with its capabilities.
RmrrRegion
A Reserved Memory Region Reporting entry.
ScatterGatherEntry
A single entry in a scatter-gather list.
ScatterGatherList
Scatter-gather list for multi-buffer DMA transfers.

Enums§

DmaCoherency
DMA coherency policy for buffer allocation.
DmaDirection
DMA direction hint for buffer mapping.
DmarStructureType
DMAR Remapping Structure types (per Intel VT-d specification).

Functions§

alloc_dma_buffer
Allocate a physically contiguous DMA buffer.
create_identity_domain
Create an identity domain for DMA address translation.
free_dma_buffer
Free a DMA-mapped buffer.
identity_map_dma
Create an identity mapping for a DMA region.
init
Initialize the IOMMU subsystem by parsing the ACPI DMAR table.
init_iommu_unit
Initialize an IOMMU hardware unit from a parsed DRHD entry.
is_initialized
Check whether IOMMU support has been initialized.
parse_dmar
Parse the ACPI DMAR table from raw bytes.
unmap_dma
Remove a DMA identity mapping.
with_dmar_info
Access parsed DMAR information.