INtime SDK Help
MapRtPhysicalMemoryEx
INtime SDK v6 > About INtime > INtime Kernel > Memory management > MapRtPhysicalMemoryEx

Maps a physical memory area, defined by its absolute physical address and contiguous length before any translation imposed by the paging system, into the current process' virtual address space.

PVOID MapRtPhysicalMemoryEx(
    DWORD dwAbsoluteAddress,    // absolute physical address of memory to be mapped
    DWORD cbSize                // size of area to be mapped
    DWORD dwFlags               // properties of the mapped memory
);

Parameters

dwAbsoluteAddress
The absolute, 32-bit, physical address of the area to be mapped.
Note: If physical memory from above 4 GBytes is required to be mapped, use the call MapRtPhysicalMemory64.
cbSize
The size in bytes of the area to be mapped.
dwFlags
Specifies the properties of the mapped memory. By default, the properties of the mapped view of the memory are read/write, cache enabled, write-back caching policy. This parameter allows modifying some of the default properties. Possible flags include:
PTE_WRITE_THRU Enables write-through caching policy for the mapped memory.
PTE_CACHE_DISABLE Disables caching for the mapped memory.
PTE_PAT Allows setting the PAT bit to index the desired PAT entry to select caching policy for the mapped memory.

Remarks

MapRtPhysicalMemoryEx maps physical memory starting at dwAbsoluteAddress for cbSize bytes into the virtual address space of the calling thread's process.

If the values of dwAbsoluteAddress and cbSize are not 4Kbyte-aligned, then the kernel will make adjustments so that the mapping is aligned. Thus the virtual memory consumed will be more than the value of cbSize.

Use FreeRtMemory to delete the mapping created by this call and to free the virtual memory associated with it.

Note: the cache type values set in dwFlags field do not change the cache type of the physical memory being mapped, but only the cache type of the mapping. If the physical memory is access through a different mapping then different caching policy may be applied.

Return Values

The address of the area mapped.
Success.
NULL
Failure. To determine the status, call GetLastRtError.

Status

E_OK 0x0000
No exceptional conditions occurred.
E_MEM 0x0002
Creating page table(s) for this request requires more available physical memory than is available to the process.
E_VMEM 0x00F0
Mapping the physical memory requires more virtual memory than is available to the process.
E_PARAM 0x8004
dwFlags specifies flags other than PTE_WRITE_THRU, PTE_CACHE_DISABLE and PTE_PAT; or cbSize is zero.

Requirements

Versions Defined in Include Link to
INtime 4.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also