Maps a region of memory.
#include <esm.h>
int ESMMapMemory (
void *windowAddress,
addr64_t memoryAddress,
size_t size);
(IN) Points to the logical address of a window allocated with ESMAllocWindow.
(IN) Specifies the address of the memory that is to be mapped into the window.
(IN) Specifies the size of the region of memory to map into the window. The size can be all of the memory or part. The value is rounded down to the nearest 4 MB size. If the specified size is larger than the window size, the window size is used.
If successful, returns 0. Otherwise, returns a nonzero error code.
For other possible values, see Section 30.3, Return Values for ESM Functions.
The ESMMapMemory function maps a region of memory allocated using ESMAlloc in a window allocated using ESMAllocWindow. This allows you to read and write memory through the allocated window.
When the window is freed, the memory backing the window is not freed. The allocator of the memory must also free the memory to ensure that memory resources are not lost.