ESMMapMemory

Maps a region of memory.

Library:LibC
Classification:NetWare OS
Service:NetWare Platform

Syntax

  #include <esm.h> 
   
  int ESMMapMemory (
     void      *windowAddress,
     addr64_t   memoryAddress,
     size_t     size);
  

Parameters

windowAddress

(IN) Points to the logical address of a window allocated with ESMAllocWindow.

memoryAddress

(IN) Specifies the address of the memory that is to be mapped into the window.

size

(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.

Return Values

If successful, returns 0. Otherwise, returns a nonzero error code.

Decimal

Name

Description

11

ERR_LOGICAL_SPACE

The size of logical space is not available.

For other possible values, see Section 30.3, Return Values for ESM Functions.

Remarks

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.

See Also