managarm/hel
Loading...
Searching...
No Matches
Classes | Variables
hel.h File Reference
#include <stddef.h>
#include <string.h>
#include <stdint.h>
#include "hel-types.h"

Go to the source code of this file.

Classes

struct  HelRegisterInfo
 Register-related information returned by helQueryRegisterInfo. More...
 
struct  HelQueue
 In-memory kernel/user-space queue. More...
 
struct  HelElement
 A single element of a HelQueue. More...
 

Functions

Logging
HEL_C_LINKAGE HelError helLog (const HelLogSeverity severity, const char *string, size_t length)
 Writes a text message (e.g., a line of text) to the kernel's log.
 
HEL_C_LINKAGE void helPanic (const char *string, size_t length) __attribute__((noreturn))
 Kills the current thread and writes an error message to the kernel's log.
 
Debugging
HEL_C_LINKAGE HelError helNop ()
 Does nothing (useful only for profiling).
 
HEL_C_LINKAGE HelError helSubmitAsyncNop (HelHandle queueHandle, uintptr_t context)
 Does nothing, asynchronously (useful only for profiling).
 
Management of Descriptors and Universes
HEL_C_LINKAGE HelError helCreateUniverse (HelHandle *handle)
 Creates a new universe descriptor.
 
HEL_C_LINKAGE HelError helTransferDescriptor (HelHandle handle, HelHandle universeHandle, HelHandle *outHandle)
 Copies descriptors from the current universe to another universe.
 
HEL_C_LINKAGE HelError helGetCredentials (HelHandle handle, uint32_t flags, char *credentials)
 Returns the credentials associated with a given descriptor.
 
HEL_C_LINKAGE HelError helCloseDescriptor (HelHandle universeHandle, HelHandle handle)
 Closes a descriptor.
 
Management of IPC Queues
HEL_C_LINKAGE HelError helCreateQueue (struct HelQueueParameters *params, HelHandle *handle)
 Creates an IPC queue.
 
HEL_C_LINKAGE HelError helCancelAsync (HelHandle queueHandle, uint64_t asyncId)
 Cancels an ongoing asynchronous operation.
 
Memory Management
HEL_C_LINKAGE HelError helAllocateMemory (size_t size, uint32_t flags, struct HelAllocRestrictions *restrictions, HelHandle *handle)
 Creates a memory object consisting of unmanaged RAM.
 
HEL_C_LINKAGE HelError helResizeMemory (HelHandle handle, size_t newSize)
 Resizes a memory object.
 
HEL_C_LINKAGE HelError helCreateManagedMemory (size_t size, uint32_t flags, HelHandle *backingHandle, HelHandle *frontalHandle)
 Creates a memory object that is managed by userspace.
 
HEL_C_LINKAGE HelError helCopyOnWrite (HelHandle memory, uintptr_t offset, size_t size, HelHandle *handle)
 Creates memory object that obtains its memory by copy-on-write from another memory object.
 
HEL_C_LINKAGE HelError helCreateIndirectMemory (size_t numSlots, HelHandle *handle)
 Creates a memory object that obtains its memory by delegating to other memory objects.
 
HEL_C_LINKAGE HelError helAlterMemoryIndirection (HelHandle indirectHandle, size_t slotIndex, HelHandle memoryHandle, uintptr_t offset, size_t size)
 Modifies indirect memory objects.
 
HEL_C_LINKAGE HelError helForkMemory (HelHandle handle, HelHandle *forkedHandle)
 Forks memory objects, i.e., copies them using copy-on-write.
 
HEL_C_LINKAGE HelError helCreateSpace (HelHandle *handle)
 Creates a virtual address space that threads can run in.
 
HEL_C_LINKAGE HelError helMapMemory (HelHandle memoryHandle, HelHandle spaceHandle, void *pointer, uintptr_t offset, size_t size, uint32_t flags, void **actualPointer)
 Maps memory objects into an address space.
 
HEL_C_LINKAGE HelError helSubmitProtectMemory (HelHandle spaceHandle, void *pointer, size_t size, uint32_t flags, HelHandle queueHandle, uintptr_t context)
 Changes protection attributes of a memory mapping.
 
HEL_C_LINKAGE HelError helSubmitSynchronizeSpace (HelHandle spaceHandle, void *pointer, size_t size, HelHandle queueHandle, uintptr_t context)
 Notifies the kernel of dirty pages in a memory mapping.
 
HEL_C_LINKAGE HelError helUnmapMemory (HelHandle spaceHandle, void *pointer, size_t size)
 Unmaps memory from an address space.
 
HEL_C_LINKAGE HelError helSubmitReadMemory (HelHandle handle, uintptr_t address, size_t length, void *buffer, HelHandle queue, uintptr_t context)
 Load memory (i.e., bytes) from a descriptor.
 
HEL_C_LINKAGE HelError helSubmitWriteMemory (HelHandle handle, uintptr_t address, size_t length, const void *buffer, HelHandle queue, uintptr_t context)
 Store memory (i.e., bytes) to a descriptor.
 
HEL_C_LINKAGE HelError helLoadahead (HelHandle handle, uintptr_t offset, size_t length)
 Notifies the kernel that a certain range of memory should be preloaded.
 
Thread Management
HEL_C_LINKAGE HelError helCreateThread (HelHandle universe, HelHandle spaceHandle, HelAbi abi, void *ip, void *sp, uint32_t flags, HelHandle *handle)
 Create a new thread.
 
HEL_C_LINKAGE HelError helQueryThreadStats (HelHandle handle, struct HelThreadStats *stats)
 Query run-time statistics of a thread.
 
HEL_C_LINKAGE HelError helSetPriority (HelHandle handle, int priority)
 Set the priority of a thread.
 
HEL_C_LINKAGE HelError helYield ()
 Yields the current thread.
 
HEL_C_LINKAGE HelError helSubmitObserve (HelHandle handle, uint64_t sequence, HelHandle queue, uintptr_t context)
 Observe whether a thread changes its state.
 
HEL_C_LINKAGE HelError helKillThread (HelHandle handle)
 Kill (i.e., terminate) a thread.
 
HEL_C_LINKAGE HelError helInterruptThread (HelHandle handle)
 Interrupt a thread.
 
HEL_C_LINKAGE HelError helResume (HelHandle handle)
 Resume a suspended thread.
 
HEL_C_LINKAGE HelError helLoadRegisters (HelHandle handle, int set, void *image)
 Load a register image (e.g., from a thread).
 
HEL_C_LINKAGE HelError helStoreRegisters (HelHandle handle, int set, const void *image)
 Store a register image (e.g., to a thread).
 
HEL_C_LINKAGE HelError helQueryRegisterInfo (int set, struct HelRegisterInfo *info)
 Query register-related information.
 
HEL_C_LINKAGE HelError helGetCurrentCpu (int *cpu)
 Gets the index of the cpu which the calling thread is running on.
 
HEL_C_LINKAGE HelError helGetClock (uint64_t *counter)
 Read the system-wide monotone clock.
 
HEL_C_LINKAGE HelError helSubmitAwaitClock (uint64_t counter, HelHandle queue, uintptr_t context, uint64_t *asyncId)
 Wait until time passes.
 
HEL_C_LINKAGE HelError helGetAffinity (HelHandle handle, uint8_t *mask, size_t size, size_t *actualSize)
 Get a thread's CPU affinity mask.
 
HEL_C_LINKAGE HelError helSetAffinity (HelHandle handle, uint8_t *mask, size_t size)
 Set a thread's CPU affinity mask.
 
Message Passing
HEL_C_LINKAGE HelError helCreateStream (HelHandle *lane1, HelHandle *lane2, uint32_t attach_credentials)
 Create a stream (which always consists of two lanes).
 
HEL_C_LINKAGE HelError helSubmitAsync (HelHandle handle, const struct HelAction *actions, size_t count, HelHandle queue, uintptr_t context, uint32_t flags)
 Pass messages on a stream.
 
HEL_C_LINKAGE HelError helCreateToken (HelHandle *handle)
 Create a token object.
 
Inter-Thread Synchronization
HEL_C_LINKAGE HelError helFutexWait (int *pointer, int expected, int64_t deadline)
 Waits on a futex.
 
HEL_C_LINKAGE HelError helFutexWake (int *pointer)
 Wakes up all waiters of a futex.
 
Event Handling
HEL_C_LINKAGE HelError helCreateOneshotEvent (HelHandle *handle)
 Create an event that fires at most once.
 
HEL_C_LINKAGE HelError helCreateBitsetEvent (HelHandle *handle)
 Create an event consisting of multiple bits that can fire independently.
 
HEL_C_LINKAGE HelError helRaiseEvent (HelHandle handle)
 Raise an event.
 
HEL_C_LINKAGE HelError helSubmitAwaitEvent (HelHandle handle, uint64_t sequence, HelHandle queue, uintptr_t context)
 Wait for an event.
 
Input/Output
HEL_C_LINKAGE HelError helEnableIo (HelHandle handle)
 Enable userspace access to hardware I/O resources.
 
Kernlet Management
HEL_C_LINKAGE HelError helBindKernlet (HelHandle handle, const union HelKernletData *data, size_t numData, HelHandle *boundHandle)
 Bind parameters to a kernlet.
 

Variables

static const int kHelHeadMask = 0xFFFFFF
 Mask to extract the current queue head.
 
static const int kHelHeadWaiters = (1 << 24)
 Can be set by the kernel to request a FutexWake on update.
 
static const int kHelProgressMask = 0xFFFFFF
 Mask to extract the number of valid bytes in the chunk.
 
static const int kHelProgressWaiters = (1 << 24)
 Can be set by userspace to request a FutexWake on update.
 
static const int kHelProgressDone = (1 << 25)
 Set by the kernel once it retires the chunk.
 

Function Documentation

◆ helAllocateMemory()

HEL_C_LINKAGE HelError helAllocateMemory ( size_t  size,
uint32_t  flags,
struct HelAllocRestrictions *  restrictions,
HelHandle *  handle 
)

Creates a memory object consisting of unmanaged RAM.

Parameters
[in]sizeSize of the memory object in bytes. Must be aligned to the system's page size.
[in]restrictionsSpecifies restrictions for the kernel's memory allocator. May be NULL if there are no restrictions.
[out]handleHandle to the new memory object.

◆ helAlterMemoryIndirection()

HEL_C_LINKAGE HelError helAlterMemoryIndirection ( HelHandle  indirectHandle,
size_t  slotIndex,
HelHandle  memoryHandle,
uintptr_t  offset,
size_t  size 
)

Modifies indirect memory objects.

Parameters
[in]indirectHandleHandle to the indirect memory object to be modified. Must refer to a memory object created by helCreateIndirectMemory.
[in]slotIndexIndex of the slot to be modified. Must be a non-negative integer smaller than numSlots (see helCreateIndirectMemory).
[in]memoryHandleHandle to the memory object that indirectHandle should delegate to.
[in]offsetOffset in bytes, relative to memoryHandle. Must be aligned to the system's page size.
[in]sizeSize of the indirection in bytes. Must be aligned to the system's page size.

◆ helBindKernlet()

HEL_C_LINKAGE HelError helBindKernlet ( HelHandle  handle,
const union HelKernletData *  data,
size_t  numData,
HelHandle *  boundHandle 
)

Bind parameters to a kernlet.

Parameters
[in]handleHandle to the unbound kernlet.
[in]dataPointer to an array of binding parameters.
[in]numDataNumber of binding parameters in data.
[out]boundHandleHandle to the bound kernlet.

◆ helCancelAsync()

HEL_C_LINKAGE HelError helCancelAsync ( HelHandle  queueHandle,
uint64_t  asyncId 
)

Cancels an ongoing asynchronous operation.

Parameters
[in]queueHandleHandle to the queue that the operation was submitted to.
[in]asyncIdID identifying the operation.

◆ helCloseDescriptor()

HEL_C_LINKAGE HelError helCloseDescriptor ( HelHandle  universeHandle,
HelHandle  handle 
)

Closes a descriptor.

Parameters
[in]universeHandleHandle to the universe containing handle.
[in]handleHandle to be closed.

◆ helCopyOnWrite()

HEL_C_LINKAGE HelError helCopyOnWrite ( HelHandle  memory,
uintptr_t  offset,
size_t  size,
HelHandle *  handle 
)

Creates memory object that obtains its memory by copy-on-write from another memory object.

Parameters
[in]memoryHandle to the source memory object.
[in]offsetOffset in byte relative to memory.
[in]sizeSize of the memory object in bytes. Must be aligned to the system's page size.
[out]handleHandle to the new memory object.

◆ helCreateBitsetEvent()

HEL_C_LINKAGE HelError helCreateBitsetEvent ( HelHandle *  handle)

Create an event consisting of multiple bits that can fire independently.

Parameters
[out]handleHandle to the new event.

◆ helCreateIndirectMemory()

HEL_C_LINKAGE HelError helCreateIndirectMemory ( size_t  numSlots,
HelHandle *  handle 
)

Creates a memory object that obtains its memory by delegating to other memory objects.

Parameters
[in]numSlotsNumber of slots, i.e., other memory objects that the indirect memory object refers to.
[out]handleHandle to the new memory object.

◆ helCreateManagedMemory()

HEL_C_LINKAGE HelError helCreateManagedMemory ( size_t  size,
uint32_t  flags,
HelHandle *  backingHandle,
HelHandle *  frontalHandle 
)

Creates a memory object that is managed by userspace.

The backingHandle is used to manage the memory object, while the frontalHandle provides a view on the memory object for consumers.

Parameters
[in]sizeSize of the memory object in bytes. Must be aligned to the system's page size.
[out]backingHandleHandle to the new memory object (for management)
[out]frontalHandleHandle to the new memory object (for consumers).

◆ helCreateOneshotEvent()

HEL_C_LINKAGE HelError helCreateOneshotEvent ( HelHandle *  handle)

Create an event that fires at most once.

Parameters
[out]handleHandle to the new event.

◆ helCreateSpace()

HEL_C_LINKAGE HelError helCreateSpace ( HelHandle *  handle)

Creates a virtual address space that threads can run in.

Parameters
[out]handleHandle to the new address space.

◆ helCreateStream()

HEL_C_LINKAGE HelError helCreateStream ( HelHandle *  lane1,
HelHandle *  lane2,
uint32_t  attach_credentials 
)

Create a stream (which always consists of two lanes).

Parameters
[out]lane1Handle to the first lane of the new stream.
[out]lane2Handle to the second lane of the new stream.
[in]attach_credentialsEnable or disable credentials for the new stream.

◆ helCreateThread()

HEL_C_LINKAGE HelError helCreateThread ( HelHandle  universe,
HelHandle  spaceHandle,
HelAbi  abi,
void *  ip,
void *  sp,
uint32_t  flags,
HelHandle *  handle 
)

Create a new thread.

Parameters
[in]universeHandleHandle to universe of the new thread.
[in]spaceHandleHandle to universe of the new thread.
[in]abiABI that the new thread should adhere to.
[in]ipInstruction pointer of the new thread.
[in]spStack pointer of the new thread.
[out]handleHandle to the new thread.

◆ helCreateToken()

HEL_C_LINKAGE HelError helCreateToken ( HelHandle *  handle)

Create a token object.

A token object represents some unnamed credentials which can be shared. Token objects can be passed to ImbueCredentials to send the credentials they hold instead of the thread's credentials.

Parameters
[out]handleHandle to the token object

◆ helCreateUniverse()

HEL_C_LINKAGE HelError helCreateUniverse ( HelHandle *  handle)

Creates a new universe descriptor.

Parameters
[out]handleHandle to the new universe descriptor.

◆ helEnableIo()

HEL_C_LINKAGE HelError helEnableIo ( HelHandle  handle)

Enable userspace access to hardware I/O resources.

Parameters
[in]handleHandle to the hardware I/O resource.

◆ helForkMemory()

HEL_C_LINKAGE HelError helForkMemory ( HelHandle  handle,
HelHandle *  forkedHandle 
)

Forks memory objects, i.e., copies them using copy-on-write.

Parameters
[in]indirectHandleHandle to the memory object to be forked. Must refer to a memory object created by helCopyOnWrite.
[out]handleHandle to the new (i.e., forked) memory object.

◆ helFutexWait()

HEL_C_LINKAGE HelError helFutexWait ( int *  pointer,
int  expected,
int64_t  deadline 
)

Waits on a futex.

Parameters
[in]pointerPointer that identifies the futex.
[in]expectedExpected value of the futex. This function does nothing unless the futex pointed to by @pointer matches this value.
[in]deadlineTimeout (in absolute monotone time, see helGetClock).

◆ helFutexWake()

HEL_C_LINKAGE HelError helFutexWake ( int *  pointer)

Wakes up all waiters of a futex.

Parameters
[in]pointerPointer that identifies the futex.

◆ helGetAffinity()

HEL_C_LINKAGE HelError helGetAffinity ( HelHandle  handle,
uint8_t *  mask,
size_t  size,
size_t *  actualSize 
)

Get a thread's CPU affinity mask.

Parameters
[in]handleHandle to the thread.
[out]maskBuffer to write the affinity bitmask to.
[in]sizeSize of bit mask buffer.
[out]actual_sizeAmount of bytes actually written to mask.

◆ helGetClock()

HEL_C_LINKAGE HelError helGetClock ( uint64_t *  counter)

Read the system-wide monotone clock.

Parameters
[out]counterCurrent value of the system-wide clock in nanoseconds since boot.

◆ helGetCredentials()

HEL_C_LINKAGE HelError helGetCredentials ( HelHandle  handle,
uint32_t  flags,
char *  credentials 
)

Returns the credentials associated with a given descriptor.

Parameters
[in]handleHandle to the descriptor.
[out]credentialsCredentials, i.e., a 16-byte binary string.

◆ helInterruptThread()

HEL_C_LINKAGE HelError helInterruptThread ( HelHandle  handle)

Interrupt a thread.

This system call temporarily suspends a thread. The thread can later be resumed through the use of helResume.

Parameters
[in]handleHandle to the thread.

◆ helKillThread()

HEL_C_LINKAGE HelError helKillThread ( HelHandle  handle)

Kill (i.e., terminate) a thread.

Parameters
[in]handleHandle to the thread.

◆ helLoadahead()

HEL_C_LINKAGE HelError helLoadahead ( HelHandle  handle,
uintptr_t  offset,
size_t  length 
)

Notifies the kernel that a certain range of memory should be preloaded.

This acts as a hint to the kernel and is meant purely as a performance optimization. The kernel is free to ignore it.

Parameters
[in]handleHandle to the memory object.
[in]offsetOffset in bytes, relative to handle.
[in]lengthLength of the memory range that is preloaded.

◆ helLoadRegisters()

HEL_C_LINKAGE HelError helLoadRegisters ( HelHandle  handle,
int  set,
void *  image 
)

Load a register image (e.g., from a thread).

Parameters
[in]handleHandle to the thread.
[in]setRegister set that will be accessed.
[out]imageCopy of the register image.

◆ helLog()

HEL_C_LINKAGE HelError helLog ( const HelLogSeverity  severity,
const char *  string,
size_t  length 
)

Writes a text message (e.g., a line of text) to the kernel's log.

Parameters
[in]severityThe RFC 5424 priority of the log message.
[in]stringText to be written.
[in]lengthSize of the text in bytes.

◆ helMapMemory()

HEL_C_LINKAGE HelError helMapMemory ( HelHandle  memoryHandle,
HelHandle  spaceHandle,
void *  pointer,
uintptr_t  offset,
size_t  size,
uint32_t  flags,
void **  actualPointer 
)

Maps memory objects into an address space.

Parameters
[in]memoryHandleHandle to the memory object.
[in]spaceHandleHandle to the address space (see helCreateSpace).
[in]pointerPointer to which the memory is mapped. Can be specified as NULL to let the kernel pick a pointer.
[in]offsetOffset in bytes, relative to memoryHandle. Must be aligned to the system's page size.
[in]sizeSize of the mappping in bytes. Must be aligned to the system's page size.
[out]actualPointerPointer to which the memory is mapped. Differs from pointer only if pointer was specified as NULL.

◆ helPanic()

HEL_C_LINKAGE void helPanic ( const char *  string,
size_t  length 
)

Kills the current thread and writes an error message to the kernel's log.

Parameters
[in]stringText to be written.
[in]lengthSize of the text in bytes.

◆ helQueryRegisterInfo()

HEL_C_LINKAGE HelError helQueryRegisterInfo ( int  set,
struct HelRegisterInfo info 
)

Query register-related information.

Parameters
[in]set
[out]infoReturned information.

◆ helQueryThreadStats()

HEL_C_LINKAGE HelError helQueryThreadStats ( HelHandle  handle,
struct HelThreadStats *  stats 
)

Query run-time statistics of a thread.

Parameters
[in]handleHandle to the thread.
[out]statsStatistics related to the thread.

◆ helRaiseEvent()

HEL_C_LINKAGE HelError helRaiseEvent ( HelHandle  handle)

Raise an event.

Parameters
[in]handleHandle to the event that will be raised.

◆ helResizeMemory()

HEL_C_LINKAGE HelError helResizeMemory ( HelHandle  handle,
size_t  newSize 
)

Resizes a memory object.

Parameters
[in]handleHandle to the memory object. Must be aligned to the system's page size.
[in]newSizeNew size in bytes.

◆ helResume()

HEL_C_LINKAGE HelError helResume ( HelHandle  handle)

Resume a suspended thread.

Threads can explicitly be suspended through the use of helInterruptThread. They are also suspended on faults and supercalls.

Parameters
[in]handleHandle to the thread.

◆ helSetAffinity()

HEL_C_LINKAGE HelError helSetAffinity ( HelHandle  handle,
uint8_t *  mask,
size_t  size 
)

Set a thread's CPU affinity mask.

Parameters
[in]handleHandle to the thread.
[in]maskPointer to a bit mask of CPUs to schedule on.
[in]sizeSize of bit mask.

◆ helSetPriority()

HEL_C_LINKAGE HelError helSetPriority ( HelHandle  handle,
int  priority 
)

Set the priority of a thread.

Managarm always runs the runnable thread with highest priority. The default priority of a thread is zero.

Parameters
[in]handleHandle to the thread.
[in]priorityNew priority value of the thread.

◆ helStoreRegisters()

HEL_C_LINKAGE HelError helStoreRegisters ( HelHandle  handle,
int  set,
const void *  image 
)

Store a register image (e.g., to a thread).

Parameters
[in]handleHandle to the thread.
[in]setRegister set that will be accessed.
[in]imageCopy of the register image.

◆ helSubmitAsync()

HEL_C_LINKAGE HelError helSubmitAsync ( HelHandle  handle,
const struct HelAction *  actions,
size_t  count,
HelHandle  queue,
uintptr_t  context,
uint32_t  flags 
)

Pass messages on a stream.

Parameters
[in]handleHandle to the lane that messages will be passed to.
[in]actionsPointer to array of message items.
[in]countNumber of elements in actions.

◆ helSubmitAsyncNop()

HEL_C_LINKAGE HelError helSubmitAsyncNop ( HelHandle  queueHandle,
uintptr_t  context 
)

Does nothing, asynchronously (useful only for profiling).

This is an asynchronous operation.

◆ helSubmitAwaitClock()

HEL_C_LINKAGE HelError helSubmitAwaitClock ( uint64_t  counter,
HelHandle  queue,
uintptr_t  context,
uint64_t *  asyncId 
)

Wait until time passes.

This is an asynchronous operation.

Parameters
[in]counterDeadline (absolute, see helGetClock).
[out]asyncIdID to identify the asynchronous operation (absolute, see helCancelAsync).

◆ helSubmitAwaitEvent()

HEL_C_LINKAGE HelError helSubmitAwaitEvent ( HelHandle  handle,
uint64_t  sequence,
HelHandle  queue,
uintptr_t  context 
)

Wait for an event.

This is an asynchronous operation.

Parameters
[in]handleHandle to the event that will be awaited.
[in]sequencePrevious sequence number.

◆ helSubmitObserve()

HEL_C_LINKAGE HelError helSubmitObserve ( HelHandle  handle,
uint64_t  sequence,
HelHandle  queue,
uintptr_t  context 
)

Observe whether a thread changes its state.

This is an asynchronous operation.

Parameters
[in]handleHandle to the thread.
[in]sequencePrevious sequence number.

◆ helSubmitProtectMemory()

HEL_C_LINKAGE HelError helSubmitProtectMemory ( HelHandle  spaceHandle,
void *  pointer,
size_t  size,
uint32_t  flags,
HelHandle  queueHandle,
uintptr_t  context 
)

Changes protection attributes of a memory mapping.

This is an asynchronous operation.

Parameters
[in]spaceHandleHandle to the address space containing pointer.
[in]pointerPointer to the mapping that is modified. Must be aligned to the system's page size.
[in]sizeSize of the mapping that is modified. Must be aligned to the system's page size.

◆ helSubmitReadMemory()

HEL_C_LINKAGE HelError helSubmitReadMemory ( HelHandle  handle,
uintptr_t  address,
size_t  length,
void *  buffer,
HelHandle  queue,
uintptr_t  context 
)

Load memory (i.e., bytes) from a descriptor.

This is an asynchronous operation.

Parameters
[in]handleHandle to the descriptor. This system call supports address spaces (see ::helCreateAddressSpace) and virtualized spaces (see helCreateVirtualizedSpace).
[in]addressAddress that is accessed, relative to handle.
[in]lengthLength of the copied memory region.

◆ helSubmitSynchronizeSpace()

HEL_C_LINKAGE HelError helSubmitSynchronizeSpace ( HelHandle  spaceHandle,
void *  pointer,
size_t  size,
HelHandle  queueHandle,
uintptr_t  context 
)

Notifies the kernel of dirty pages in a memory mapping.

This system call returns after the kernel has scanned all specified pages and determined whether they are dirty or not. It does not wait until the pages are clean again.

This is an asynchronous operation.

Parameters
[in]spaceHandleHandle to the address space containing pointer.
[in]pointerPointer to the mapping that is synchronized. Must be aligned to the system's page size.
[in]sizeSize of the mapping that is synchronized. Must be aligned to the system's page size.

◆ helSubmitWriteMemory()

HEL_C_LINKAGE HelError helSubmitWriteMemory ( HelHandle  handle,
uintptr_t  address,
size_t  length,
const void *  buffer,
HelHandle  queue,
uintptr_t  context 
)

Store memory (i.e., bytes) to a descriptor.

This is an asynchronous operation.

Parameters
[in]handleHandle to the descriptor. This system call supports address spaces (see ::helCreateAddressSpace) and virtualized spaces (see helCreateVirtualizedSpace).
[in]addressAddress that is accessed, relative to handle.
[in]lengthLength of the copied memory region.

◆ helTransferDescriptor()

HEL_C_LINKAGE HelError helTransferDescriptor ( HelHandle  handle,
HelHandle  universeHandle,
HelHandle *  outHandle 
)

Copies descriptors from the current universe to another universe.

Parameters
[in]handleHandle the descriptor to transfer.
[in]universeHandleHandle to the destination universe.
[out]outHandleHandle to the copied descriptor (valid in the universe specified by universeHandle).

◆ helUnmapMemory()

HEL_C_LINKAGE HelError helUnmapMemory ( HelHandle  spaceHandle,
void *  pointer,
size_t  size 
)

Unmaps memory from an address space.

Parameters
[in]spaceHandleHandle to the address space containing pointer.
[in]pointerPointer to the mapping that is unmapped. Must be aligned to the system's page size.
[in]sizeSize of the mapping that is unmapped. Must be aligned to the system's page size.