Memory #

Memory capabilities represent a range of conventional physical memory available for the allocation of pages and kernel objects. The allocation of most other capabilities requires the use of a memory capability in order to store the state associated with its respective kernel object.

Only the following capabilities support allocation via this interface:

  • CSpace
  • Endpoint
  • Notification
  • Page
  • Task
  • VSpace
  • PDPT, PD, PT (x86_64)
  • L1PT, L2PT, L3PT (aarch64)

Operations #

Memory::ALLOCATE #

Allocates new kernel objects.

This operation is atomic; if insufficient memory is available then no objects will be allocated. However, the value of the out parameter in the caller’s IPC buffer is undefined in such cases.

Parameters #

The meaning of the size parameter, if provided, is specific to each capability type.

Register Details
r0 Capability type
r1 Size (optional)

Capabilities #

CSlot Usage Type Details
Out CAddr Capability slots to store the new capabilities in

Results #

Error code Meaning
NONE Success
NOMEM Insufficient memory to allocate objects
INVALID_PARAM Invalid combination of capability type and size paramter
INVALID_PARAM Attempted to allocate zero capabilities
INVALID_CTYPE Attempted to allocate an invalid capability type
INVALID_CSLOT Attempted to allocate a capability in a non-null cslot

Semantics #

Memory::ALLOCATE #

The user may allocate new memory capabilities using a subset of the parent capability’s physical memory by providing r0 = ctype::MEMORY and setting r1 to the desired number of pages of memory to use for the new capability.

Destroy #

Destroying a memory capability will destroy all objects allocated from that capability.