The MEMR, MEMW and MEMU system calls are used to create the memory object corresponding to the part of memory attached to the current process', starting at virtual address addr and with length len, for reading only, writing only, or read-write (updating) correspondingly. The passive access to the new memory object is placed on top of the stack.
The MEMx system calls are not a part of the basic set of system calls, and are provided only for efficiency. The same effect can be achieved using process control protocol.
Note that created memory objects would belong to the system's memory manager, i.e. active access to those objects is not available. The following table lists the which requests of the memory protocol will be available:
| System Call | Request Codes |
|---|---|
| MEMR | MEM_READ, MEM_INFO, MEM_DUP, MEM_REMAP, MEM_FREESPACE |
| MEMW | MEM_WRITE, MEM_INFO, MEM_DUP, MEM_REMAP, MEM_FREESPACE |
| MEMU | MEM_READ, MEM_WRITE, MEM_INFO, MEM_DUP, MEM_REMAP, MEM_FREESPACE |
The typical usage of the accesses to memory objects is to allow sharing memory (or message passing) between processes. If a memory buffer is used more than once the access to corresponding memory object can be kept and reused too, reducing overhead on creation of memory objects and locating the memory segment by virtual address.
The access created by MEMx does not belong to any group, has null user pointer and is marked as temporary.
In case of successful execution MEMx does not change the result code.
If stack is already full MEMx returns error code ERR_STACK_OVERFLOW.
If address or length of the memory block are not valid MEMx returns error code ERR_INVALID_ADDRESS.
If attached memory segment at the specified address does not allow the requested kind of access (i.e. is read-only when MEMW is used, etc) MEMx returns error code ERR_NO_PERMISSIONS.
If there is no sufficient kernel memory for the new memory object, MEMx returns error code ERR_NO_KERNEL_MEMORY.