Remaps an existing mapping to a new physical memory area of the same size, with new attributes. The call may also be used to change the attributes on an existing memory allocation, without changing its physical address.
PVOID RemapRtPhysicalMemory( PVOID pCurrent, // existing mapping DWORD dwAbsoluteAddress, // absolute physical address of memory to be mapped DWORD dwFlags // properties of the mapped memory );
pCurrent
dwAbsoluteAddress
dwFlags
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. |
REMAP_KEEP_PA |
Keep physical address, but change the page attributes. Applies to mapped memory and allocated memory. |
REMAP_KEEP_ATTRIB |
Keep page attributes, but remap physical address. Does not apply to allocated memory. |
RemapRtPhysicalMemory can be used to remap an existing pointer to a new physical memory address starting at dwAbsoluteAddress
or to change the cache attributes. The pointer pCurrent must have previously been returned from a call to MapRtPhysicalMemory, MapRtPhysicalMemoryEx or MapRtPhysicalMemory64. The pointer (in fact an offset in the process' VSEG) is not changed if the remapping is successful. This is functionally equivalent to a call to FreeRtMemory followed by a call to one of the MapRtPhysical calls, but is more efficient because it does not have to reallocate a virtual memory range.
RemapRtPhysicalMemory can also be used to change the attributes of memory allocated with AllocateRtMemory, or AllocateRtMemoryEx, using the REMAP_KEEP_PA flag.
If the value of dwAbsoluteAddress
is not 4Kbyte-aligned, then the kernel will make adjustments so that the address is so aligned.
Use FreeRtMemory to delete the mapping created by this call and to free the virtual memory associated with it.
This call is limited to mapping memory from below 4 GiB. Use RemapRtPhysicalMemory64 to map physical memory from any physical address.
The address of the area mapped.
NULL
E_OK 0x0000
E_MEM 0x0002
E_VMEM 0x00F0
E_ALLOCATED 0x00F1
E_NOT_ALLOCATED 0x00F2
E_PARAM 0x8004
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 5.0 | intime/rt/include/rtbase.h | rt.h | rt.lib |