RtMapMemory
RtMapMemory maps a range of physical memory addresses into the user's virtual address space.
Syntax
PVOID RtMapMemory( LARGE_INTEGER physAddr, ULONG Length, MEMORY_CACHING_TYPE CacheType );
Parameters
physAddr
A LARGE_INTEGER specifying the base of the physical address range to map.
Length
An unsigned 32-bit value representing the length, in bytes, of the address range to map.
CacheType
Specifies a MEMORY_CACHING_TYPE value, which indicates the cache attribute to use to map the physical address range.
Return Value
- A virtual address in the system address space if the function succeeds
- A NULL virtual address if the function fails
NOTE: No access checks are performed on these addresses or the ranges requested. Use this function with care to avoid memory corruption.
Remarks
RtMapMemory creates a map between a range of user virtual addresses and a range of physical memory addresses, giving the user direct access to physical memory locations on the system. Typically, this is used to access peripheral registers or buffers mapped into the physical address space of the machine. The largest address must be a legal value on the machine.
Requirements
Minimum Supported Version | RTX64 2013 |
Header | Rtapi.h |
Library | RtApi.lib (Windows), Rtx_Rtss.lib (RTSS) |
See Also: