IOMMU_RESERVE_LOGICAL_ADDRESS_RANGE callback function (wdm.h)

Preallocates logical address space that can be used for future mappings. This grants a driver the ability to ensure forward progress for future map/unmap calls.

Syntax

IOMMU_RESERVE_LOGICAL_ADDRESS_RANGE IommuReserveLogicalAddressRange;

NTSTATUS IommuReserveLogicalAddressRange(
  [in]           PIOMMU_DMA_DOMAIN Domain,
  [in]           SIZE_T Size,
  [in, optional] PIOMMU_DMA_LOGICAL_ADDRESS ExplicitLogicalAddress,
  [in, optional] PIOMMU_DMA_LOGICAL_ADDRESS MinLogicalAddress,
  [in, optional] PIOMMU_DMA_LOGICAL_ADDRESS MaxLogicalAddress,
  [out]          PIOMMU_DMA_LOGICAL_ADDRESS_TOKEN *LogicalAddressToken
)
{...}

Parameters

[in] Domain

A pointer to the IOMMU_DMA_DOMAIN that the reserved logical address will belong to. The domain must be of type DomainTypeTranslate. For more information about domain types, see IOMMU_DMA_DOMAIN_TYPE.

[in] Size

The size, in bytes, of the logical address range to reserve. This value must represent a whole number of pages.

[in, optional] ExplicitLogicalAddress

The domain logical address that should be reserved. If the domain was not created with a registered logical allocator, then this field is required. If the domain was created with a registered logical allocator that does not support explicit logical address allocation, then this field must be NULL.

[in, optional] MinLogicalAddress

The minimum (inclusive) allowable logical address that can be reserved. If the domain was not created with a registered logical allocator, then this field will be ignored.

[in, optional] MaxLogicalAddress

The maximum (inclusive) allowable logical address that can be reserved. If the domain was not created with a registered logical allocator, then this field will be ignored.

[out] LogicalAddressToken

Returns a IOMMU_DMA_LOGICAL_ADDRESS_TOKEN representing the reserved logical address range.

Return value

STATUS_SUCCESS if the operation is successful. Possible error return values include the following status codes.

Return code Description
STATUS_INVALID_PARAMETER_1 The domain provided is not of type DomainTypeTranslate.
STATUS_INVALID_PARAMETER_2 The size provided is not a multiple of PAGE_SIZE.
STATUS_INVALID_PARAMETER_3 The ExplicitLogicalAddress provided is not page-aligned.
STATUS_INVALID_PARAMETER_MIX The min and max logical addresses provided could not be satisfied.
STATUS_IN_USE The ExplicitLogicalAddress is already mapped or partially mapped.
STATUS_NOT_SUPPORTED An ExplicitLogicalAddress was provided for a domain with a logical allocator that does not allow explicit logical address allocation. Or an ExplicitLogicalAddress was not provided for a domain with no logical allocator.

For more information, see NTSTATUS Values.

Remarks

Logical Address tokens can be freed via IOMMU_FREE_RESERVED_LOGICAL_ADDRESS_RANGE.

Logical Address tokens should have portions of their logical address ranges mapped to and unmapped from physical addresses via IOMMU_MAP_RESERVED_LOGICAL_RANGE and IOMMU_UNMAP_RESERVED_LOGICAL_RANGE.

Requirements

Requirement Value
Minimum supported server Windows Server 2022
Header wdm.h (include Wdm.h)

See also

IOMMU_DMA_LOGICAL_ADDRESS_TOKEN

IOMMU_FREE_RESERVED_LOGICAL_ADDRESS_RANGE

IOMMU_MAP_RESERVED_LOGICAL_RANGE

IOMMU_UNMAP_RESERVED_LOGICAL_RANGE