14#define HEL_C_LINKAGE extern "C"
27 kHelCallSubmitAsyncNop = 3,
29 kHelCallCreateUniverse = 62,
30 kHelCallTransferDescriptor = 66,
31 kHelCallDescriptorInfo = 32,
32 kHelCallGetCredentials = 84,
33 kHelCallCloseDescriptor = 21,
35 kHelCallCreateQueue = 89,
36 kHelCallCancelAsync = 92,
38 kHelCallAllocateMemory = 51,
39 kHelCallResizeMemory = 83,
40 kHelCallCreateManagedMemory = 64,
41 kHelCallCopyOnWrite = 39,
42 kHelCallAccessPhysical = 30,
43 kHelCallCreateSliceView = 88,
44 kHelCallForkMemory = 40,
45 kHelCallCreateSpace = 27,
46 kHelCallCreateIndirectMemory = 45,
47 kHelCallAlterMemoryIndirection = 52,
48 kHelCallMapMemory = 44,
49 kHelCallSubmitProtectMemory = 99,
50 kHelCallSubmitSynchronizeSpace = 53,
51 kHelCallUnmapMemory = 36,
52 kHelCallPointerPhysical = 43,
53 kHelCallSubmitReadMemory = 77,
54 kHelCallSubmitWriteMemory = 78,
55 kHelCallMemoryInfo = 26,
56 kHelCallSubmitManageMemory = 46,
57 kHelCallUpdateMemory = 47,
58 kHelCallSubmitLockMemoryView = 48,
59 kHelCallLoadahead = 49,
60 kHelCallCreateVirtualizedSpace = 50,
62 kHelCallCreateThread = 67,
63 kHelCallQueryThreadStats = 95,
64 kHelCallSetPriority = 85,
66 kHelCallSubmitObserve = 74,
67 kHelCallKillThread = 87,
68 kHelCallInterruptThread = 86,
70 kHelCallLoadRegisters = 75,
71 kHelCallStoreRegisters = 76,
72 kHelCallQueryRegisterInfo = 102,
73 kHelCallWriteFsBase = 41,
74 kHelCallGetClock = 42,
75 kHelCallSubmitAwaitClock = 80,
76 kHelCallCreateVirtualizedCpu = 37,
77 kHelCallRunVirtualizedCpu = 38,
78 kHelCallGetRandomBytes = 101,
79 kHelCallWriteGsBase = 54,
80 kHelCallReadFsBase = 55,
81 kHelCallReadGsBase = 56,
82 kHelCallGetCurrentCpu = 57,
84 kHelCallCreateStream = 68,
85 kHelCallSubmitAsync = 79,
86 kHelCallShutdownLane = 91,
88 kHelCallFutexWait = 73,
89 kHelCallFutexWake = 71,
91 kHelCallCreateOneshotEvent = 96,
92 kHelCallCreateBitsetEvent = 97,
93 kHelCallRaiseEvent = 98,
94 kHelCallAccessIrq = 14,
95 kHelCallAcknowledgeIrq = 81,
96 kHelCallSubmitAwaitEvent = 82,
97 kHelCallAutomateIrq = 94,
99 kHelCallAccessIo = 11,
100 kHelCallEnableIo = 12,
101 kHelCallEnableFullIo = 35,
103 kHelCallBindKernlet = 93,
105 kHelCallGetAffinity = 103,
106 kHelCallSetAffinity = 100,
108 kHelCallCreateToken = 104,
110 kHelCallSuper = 0x80000000
115 kHelErrIllegalSyscall = 5,
116 kHelErrIllegalArgs = 7,
117 kHelErrIllegalState = 15,
118 kHelErrUnsupportedOperation = 18,
119 kHelErrOutOfBounds = 19,
120 kHelErrQueueTooSmall = 14,
121 kHelErrCancelled = 12,
122 kHelErrNoDescriptor = 4,
123 kHelErrBadDescriptor = 2,
124 kHelErrThreadTerminated = 11,
125 kHelErrTransmissionMismatch = 13,
126 kHelErrLaneShutdown = 8,
127 kHelErrEndOfLane = 9,
128 kHelErrDismissed = 20,
129 kHelErrBufferTooSmall = 1,
131 kHelErrRemoteFault = 21,
132 kHelErrNoHardwareSupport = 16,
133 kHelErrNoMemory = 17,
134 kHelErrAlreadyExists = 22
137struct HelX86SegmentRegister {
141 uint8_t type, present, dpl, db, s, l, g, avl;
144struct HelX86DescriptorTable {
149struct HelX86VirtualizationRegs {
170 struct HelX86SegmentRegister cs, ds, es, fs, gs, ss;
171 struct HelX86SegmentRegister tr, ldt;
172 struct HelX86DescriptorTable gdt, idt;
174 uint64_t cr0, cr2, cr3, cr4, cr8;
181 kHelThisUniverse = -1,
187 kHelWaitInfinite = -1
195 kHelActionDismiss = 11,
197 kHelActionAccept = 6,
198 kHelActionImbueCredentials = 8,
199 kHelActionExtractCredentials = 9,
200 kHelActionSendFromBuffer = 1,
201 kHelActionSendFromBufferSg = 10,
202 kHelActionRecvInline = 7,
203 kHelActionRecvToBuffer = 3,
204 kHelActionPushDescriptor = 2,
205 kHelActionPullDescriptor = 4
210 kHelItemAncillary = 2,
211 kHelItemWantLane = (1 << 16),
228struct HelDescriptorInfo {
233 kHelAllocContinuous = 4,
234 kHelAllocOnDemand = 1,
237struct HelAllocRestrictions {
241enum HelManagedFlags {
242 kHelManagedReadahead = 1
245enum HelManageRequests {
246 kHelManageInitialize = 1,
247 kHelManageWriteback = 2
252 kHelMapProtRead = 256,
253 kHelMapProtWrite = 512,
254 kHelMapProtExecute = 1024,
255 kHelMapDontRequireBacking = 128,
257 kHelMapFixedNoReplace = 4096
261 kHelThreadStopped = 1
266 kHelObserveInterrupt = 4,
267 kHelObservePanic = 3,
268 kHelObserveBreakpoint = 1,
269 kHelObservePageFault = 2,
270 kHelObserveGeneralFault = 5,
271 kHelObserveIllegalInstruction = 6,
272 kHelObserveDivByZero = 7,
273 kHelObserveSuperCall = 0x80000000
276enum HelRegisterSets {
281 kHelRegsVirtualization = 5,
292#if defined(__x86_64__)
293enum HelRegisterIndex {
317 kHelRegNumber = kHelRegRdi,
318 kHelRegError = kHelRegRdi,
320 kHelRegArg0 = kHelRegRsi,
321 kHelRegArg1 = kHelRegRdx,
322 kHelRegArg2 = kHelRegRax,
323 kHelRegArg3 = kHelRegR8,
324 kHelRegArg4 = kHelRegR9,
325 kHelRegArg5 = kHelRegR10,
326 kHelRegArg6 = kHelRegR12,
327 kHelRegArg7 = kHelRegR13,
328 kHelRegArg8 = kHelRegR14,
330 kHelRegOut0 = kHelRegRsi,
331 kHelRegOut1 = kHelRegRdx
334#elif defined(__aarch64__)
335enum HelRegisterIndex {
375 kHelRegNumber = kHelRegX0,
376 kHelRegError = kHelRegX0,
378 kHelRegArg0 = kHelRegX1,
379 kHelRegArg1 = kHelRegX2,
380 kHelRegArg2 = kHelRegX3,
381 kHelRegArg3 = kHelRegX4,
382 kHelRegArg4 = kHelRegX5,
383 kHelRegArg5 = kHelRegX6,
384 kHelRegArg6 = kHelRegX7,
385 kHelRegArg7 = kHelRegX8,
386 kHelRegArg8 = kHelRegX9,
388 kHelRegOut0 = kHelRegX1,
389 kHelRegOut1 = kHelRegX2
392#elif defined(__riscv) && __riscv_xlen == 64
393enum HelRegisterIndex {
429 kHelRegNumber = kHelRegA0,
430 kHelRegError = kHelRegA0,
431 kHelRegArg0 = kHelRegA1,
432 kHelRegArg1 = kHelRegA2,
433 kHelRegArg2 = kHelRegA3,
434 kHelRegArg3 = kHelRegA4,
435 kHelRegArg4 = kHelRegA5,
436 kHelRegArg5 = kHelRegA6,
437 kHelRegArg6 = kHelRegA7,
438 kHelRegArg7 = kHelRegS2,
439 kHelRegArg8 = kHelRegS3,
440 kHelRegOut0 = kHelRegA1,
441 kHelRegOut1 = kHelRegA2
446struct HelQueueParameters {
448 unsigned int ringShift;
449 unsigned int numChunks;
495 unsigned int reserved;
500struct HelSimpleResult {
505struct HelCredentialsResult {
508 char credentials[16];
511struct HelManageResult {
518struct HelObserveResult {
520 unsigned int observation;
524struct HelInlineResult {
531struct HelInlineResultNoFlex {
537struct HelLengthResult {
543struct HelHandleResult {
549struct HelEventResult {
556 kHelAckAcknowledge = 2,
559 kHelAckClear = 0x100,
562union HelKernletData {
566struct HelThreadStats {
572 kHelVmexitTranslationFault = 1,
573 kHelVmexitError = -1,
574 kHelVmexitUnknownPlatformSpecificExitCode = -2,
577struct HelVmexitReason {
586 kHelLogSeverityEmergency,
587 kHelLogSeverityAlert,
588 kHelLogSeverityCritical,
589 kHelLogSeverityError,
590 kHelLogSeverityWarning,
591 kHelLogSeverityNotice,
593 kHelLogSeverityDebug,
606HEL_C_LINKAGE HelError
helLog(
const HelLogSeverity severity,
const char *
string,
size_t length);
613HEL_C_LINKAGE
void helPanic(
const char *
string,
size_t length)
614 __attribute__ (( noreturn ));
645 HelHandle *outHandle);
647HEL_C_LINKAGE HelError helDescriptorInfo(HelHandle handle,
struct HelDescriptorInfo *info);
693 struct HelAllocRestrictions *restrictions, HelHandle *handle);
715 HelHandle *backingHandle, HelHandle *frontalHandle);
728 uintptr_t offset,
size_t size, HelHandle *handle);
730HEL_C_LINKAGE HelError helAccessPhysical(uintptr_t physical,
731 size_t size, HelHandle *handle);
757 HelHandle memoryHandle, uintptr_t offset,
size_t size);
759HEL_C_LINKAGE HelError helCreateSliceView(HelHandle bundle, uintptr_t offset,
size_t size,
760 uint32_t flags, HelHandle *handle);
769HEL_C_LINKAGE HelError
helForkMemory(HelHandle handle, HelHandle *forkedHandle);
793HEL_C_LINKAGE HelError
helMapMemory(HelHandle memoryHandle, HelHandle spaceHandle,
794 void *pointer, uintptr_t offset,
size_t size, uint32_t flags,
void **actualPointer);
808 void *pointer,
size_t size, uint32_t flags,
809 HelHandle queueHandle, uintptr_t context);
827 void *pointer,
size_t size,
828 HelHandle queueHandle, uintptr_t context);
840HEL_C_LINKAGE HelError
helUnmapMemory(HelHandle spaceHandle,
void *pointer,
size_t size);
842HEL_C_LINKAGE HelError helPointerPhysical(
const void *pointer, uintptr_t *physical);
856 size_t length,
void *buffer,
857 HelHandle queue, uintptr_t context);
871 size_t length,
const void *buffer,
872 HelHandle queue, uintptr_t context);
874HEL_C_LINKAGE HelError helMemoryInfo(HelHandle handle,
877HEL_C_LINKAGE HelError helSubmitManageMemory(HelHandle handle,
878 HelHandle queue, uintptr_t context);
880HEL_C_LINKAGE HelError helUpdateMemory(HelHandle handle,
int type, uintptr_t offset,
size_t length);
882HEL_C_LINKAGE HelError helSubmitLockMemoryView(HelHandle handle, uintptr_t offset,
size_t size,
883 HelHandle queue, uintptr_t context);
895HEL_C_LINKAGE HelError
helLoadahead(HelHandle handle, uintptr_t offset,
size_t length);
897HEL_C_LINKAGE HelError helCreateVirtualizedSpace(HelHandle *handle);
917 HelAbi abi,
void *ip,
void *sp, uint32_t flags, HelHandle *handle);
947 HelHandle queue, uintptr_t context);
995HEL_C_LINKAGE HelError helWriteFsBase(
void *pointer);
997HEL_C_LINKAGE HelError helReadFsBase(
void **pointer);
999HEL_C_LINKAGE HelError helWriteGsBase(
void *pointer);
1001HEL_C_LINKAGE HelError helReadGsBase(
void **pointer);
1020 HelHandle queue, uintptr_t context, uint64_t *asyncId);
1022HEL_C_LINKAGE HelError helCreateVirtualizedCpu(HelHandle handle, HelHandle *out_handle);
1024HEL_C_LINKAGE HelError helRunVirtualizedCpu(HelHandle handle,
struct HelVmexitReason *reason);
1026HEL_C_LINKAGE HelError helGetRandomBytes(
void *buffer,
size_t wantedSize,
size_t *actualSize);
1037HEL_C_LINKAGE HelError
helGetAffinity(HelHandle handle, uint8_t *mask,
size_t size,
size_t *actualSize);
1059HEL_C_LINKAGE HelError
helCreateStream(HelHandle *lane1, HelHandle *lane2, uint32_t attach_credentials);
1068HEL_C_LINKAGE HelError
helSubmitAsync(HelHandle handle,
const struct HelAction *actions,
1069 size_t count, HelHandle queue, uintptr_t context, uint32_t flags);
1071HEL_C_LINKAGE HelError helShutdownLane(HelHandle handle);
1094HEL_C_LINKAGE HelError
helFutexWait(
int *pointer,
int expected, int64_t deadline);
1120HEL_C_LINKAGE HelError helAccessIrq(
int number, HelHandle *handle);
1122HEL_C_LINKAGE HelError helAcknowledgeIrq(HelHandle handle, uint32_t flags, uint64_t sequence);
1132 HelHandle queue, uintptr_t context);
1134HEL_C_LINKAGE HelError helAutomateIrq(HelHandle handle, uint32_t flags, HelHandle kernlet);
1140HEL_C_LINKAGE HelError helAccessIo(uintptr_t *port_array,
size_t num_ports,
1148HEL_C_LINKAGE HelError helEnableFullIo();
1164 const union HelKernletData *data,
size_t numData, HelHandle *boundHandle);
1168extern inline __attribute__ (( always_inline ))
const char *_helErrorString(HelError code) {
1172 case kHelErrIllegalSyscall:
1173 return "Illegal syscall";
1174 case kHelErrIllegalArgs:
1175 return "Illegal arguments";
1176 case kHelErrIllegalState:
1177 return "Illegal state";
1178 case kHelErrUnsupportedOperation:
1179 return "Unsupported operation";
1180 case kHelErrNoDescriptor:
1181 return "No such descriptor";
1182 case kHelErrBadDescriptor:
1183 return "Illegal descriptor for this operation";
1184 case kHelErrThreadTerminated:
1185 return "Thread terminated already";
1186 case kHelErrLaneShutdown:
1187 return "Lane shutdown";
1188 case kHelErrEndOfLane:
1189 return "End of lane";
1190 case kHelErrDismissed:
1191 return "IPC item dismissed by remote";
1192 case kHelErrBufferTooSmall:
1193 return "Buffer too small";
1194 case kHelErrQueueTooSmall:
1195 return "Buffer too small";
1198 case kHelErrNoHardwareSupport:
1199 return "Missing hardware support for this feature";
1200 case kHelErrNoMemory:
1201 return "Out of memory";
1202 case kHelErrTransmissionMismatch:
1203 return "Transmission mismatch";
1204 case kHelErrCancelled:
1206 case kHelErrOutOfBounds:
1207 return "Out of bounds";
1208 case kHelErrAlreadyExists:
1209 return "Already exists";
1215extern inline __attribute__ (( always_inline ))
void _helCheckFailed(HelError err_code,
1216 const char *
string,
int fatal) {
1217 helLog(kHelLogSeverityError,
string, strlen(
string));
1219 const char *err_string = _helErrorString(err_code);
1221 err_string =
"(Unexpected error code)";
1222 helLog(kHelLogSeverityError, err_string, strlen(err_string));
1223 helLog(kHelLogSeverityError,
"\n", 1);
1229#define HEL_STRINGIFY_AUX(x) #x
1230#define HEL_STRINGIFY(x) HEL_STRINGIFY_AUX(x)
1232#define HEL_CHECK(expr) do { HelError __error = expr; if(__error != kHelErrNone) \
1233 _helCheckFailed(__error, "HEL_CHECK failed: " #expr "\n" \
1234 " In file " __FILE__ " on line " HEL_STRINGIFY(__LINE__) "\n", 1); } while(0)
1235#define HEL_SOFT_CHECK(expr) do { HelError __error = expr; if(__error != kHelErrNone) \
1236 _helCheckFailed(__error, "HEL_SOFT_CHECK failed: " #expr "\n" \
1237 " In file " __FILE__ " on line " HEL_STRINGIFY(__LINE__) "\n", 0); } while(0)
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 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 helCloseDescriptor(HelHandle universeHandle, HelHandle handle)
Closes a descriptor.
HEL_C_LINKAGE HelError helQueryRegisterInfo(int set, struct HelRegisterInfo *info)
Query register-related information.
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 helSetAffinity(HelHandle handle, uint8_t *mask, size_t size)
Set a thread's CPU affinity mask.
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 helSubmitAwaitEvent(HelHandle handle, uint64_t sequence, HelHandle queue, uintptr_t context)
Wait for an event.
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.
static const int kHelHeadMask
Mask to extract the current queue head.
Definition hel.h:454
HEL_C_LINKAGE HelError helQueryThreadStats(HelHandle handle, struct HelThreadStats *stats)
Query run-time statistics of a thread.
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 helCreateBitsetEvent(HelHandle *handle)
Create an event consisting of multiple bits that can fire independently.
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 helAllocateMemory(size_t size, uint32_t flags, struct HelAllocRestrictions *restrictions, HelHandle *handle)
Creates a memory object consisting of unmanaged RAM.
HEL_C_LINKAGE HelError helGetCredentials(HelHandle handle, uint32_t flags, char *credentials)
Returns the credentials associated with a given descriptor.
HEL_C_LINKAGE HelError helKillThread(HelHandle handle)
Kill (i.e., terminate) a thread.
HEL_C_LINKAGE HelError helCreateQueue(struct HelQueueParameters *params, HelHandle *handle)
Creates an IPC queue.
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 helGetClock(uint64_t *counter)
Read the system-wide monotone clock.
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.
HEL_C_LINKAGE HelError helLoadRegisters(HelHandle handle, int set, void *image)
Load a register image (e.g., from a thread).
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 void helPanic(const char *string, size_t length) __attribute__((noreturn))
Kills the current thread and writes an error message to the kernel's log.
HEL_C_LINKAGE HelError helUnmapMemory(HelHandle spaceHandle, void *pointer, size_t size)
Unmaps memory from an address space.
HEL_C_LINKAGE HelError helResizeMemory(HelHandle handle, size_t newSize)
Resizes a memory object.
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.
static const int kHelProgressMask
Mask to extract the number of valid bytes in the chunk.
Definition hel.h:472
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 helInterruptThread(HelHandle handle)
Interrupt a thread.
HEL_C_LINKAGE HelError helRaiseEvent(HelHandle handle)
Raise an event.
HEL_C_LINKAGE HelError helForkMemory(HelHandle handle, HelHandle *forkedHandle)
Forks memory objects, i.e., copies them using copy-on-write.
HEL_C_LINKAGE HelError helFutexWake(int *pointer)
Wakes up all waiters of a futex.
HEL_C_LINKAGE HelError helCreateToken(HelHandle *handle)
Create a token object.
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 helResume(HelHandle handle)
Resume a suspended thread.
HEL_C_LINKAGE HelError helSubmitAsyncNop(HelHandle queueHandle, uintptr_t context)
Does nothing, asynchronously (useful only for profiling).
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 helTransferDescriptor(HelHandle handle, HelHandle universeHandle, HelHandle *outHandle)
Copies descriptors from the current universe to another universe.
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 helCreateStream(HelHandle *lane1, HelHandle *lane2, uint32_t attach_credentials)
Create a stream (which always consists of two lanes).
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 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 helGetCurrentCpu(int *cpu)
Gets the index of the cpu which the calling thread is running on.
HEL_C_LINKAGE HelError helNop()
Does nothing (useful only for profiling).
HEL_C_LINKAGE HelError helFutexWait(int *pointer, int expected, int64_t deadline)
Waits on a futex.
static const int kHelHeadWaiters
Can be set by the kernel to request a FutexWake on update.
Definition hel.h:457
HEL_C_LINKAGE HelError helBindKernlet(HelHandle handle, const union HelKernletData *data, size_t numData, HelHandle *boundHandle)
Bind parameters to a kernlet.
HEL_C_LINKAGE HelError helCreateSpace(HelHandle *handle)
Creates a virtual address space that threads can run in.
HEL_C_LINKAGE HelError helCreateOneshotEvent(HelHandle *handle)
Create an event that fires at most once.
static const int kHelProgressWaiters
Can be set by userspace to request a FutexWake on update.
Definition hel.h:475
HEL_C_LINKAGE HelError helCreateUniverse(HelHandle *handle)
Creates a new universe descriptor.
static const int kHelProgressDone
Set by the kernel once it retires the chunk.
Definition hel.h:478
HEL_C_LINKAGE HelError helEnableIo(HelHandle handle)
Enable userspace access to hardware I/O resources.
HEL_C_LINKAGE HelError helCancelAsync(HelHandle queueHandle, uint64_t asyncId)
Cancels an ongoing asynchronous operation.
A single element of a HelQueue.
Definition hel.h:492
unsigned int length
Length of the element in bytes.
Definition hel.h:494
void * context
User-defined value.
Definition hel.h:497
In-memory kernel/user-space queue.
Definition hel.h:460
char padding[4]
Ensures that the buffer is 8-byte aligned.
Definition hel.h:465
int headFutex
Futex for kernel/user-space head synchronization.
Definition hel.h:462
int indexQueue[]
The actual queue.
Definition hel.h:468
Register-related information returned by helQueryRegisterInfo.
Definition hel.h:287
int setSize
Size of the selected register set.
Definition hel.h:289