INtime SDK Help
MapRtPhysicalMemory64
INtime SDK v7.1 > About INtime > INtime Kernel > Memory management > MapRtPhysicalMemory64

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 MapRtPhysicalMemory64(
    QWORD qwAbsoluteAddress,    // absolute physical address of memory to be mapped
    DWORD cbSize                // size of area to be mapped
    DWORD dwFlags               // properties of the mapped memory
);

Parameters

qwAbsoluteAddress
The absolute, 64-bit, physical address of the area to be mapped.
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

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

If the values of qwAbsoluteAddress 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 accessed 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 6.2 intime/rt/include/rtbase.h rt.h rt.lib
See Also