PVOID
MmMapIoSpace(
IN PHYSICAL_ADDRESS PhysicalAddress,
IN ULONG NumberOfBytes,
IN BOOLEAN CacheEnable
);
MmMapIoSpace maps the given physical address range to nonpaged system space.
MmMapIoSpace returns the base virtual address that maps the base physical address for the range. If space for mapping the range is insufficient, it returns NULL.
Device drivers call this routine during initialization to get a logical address for their device memory if a call to HalTranslateBusAddress indicates that the bus-relative device memory range has been mapped to system memory space.
For example, drivers of PIO devices that allocate long-term I/O buffers can call this routine to make such a buffer accessible or to make device memory accessible.
Callers of MmMapIoSpace must be running at IRQL = PASSIVE_LEVEL.
HalAllocateCommonBuffer, HalTranslateBusAddress, MmAllocateContiguousMemory, MmAllocateNonCachedMemory, MmMapLockedPages, MmUnmapIoSpace