Index of constants
Threos System Calls
TimerObject
SignalMessage
Exception
Objects
Events
MsgPort
Virtual
Store
Memory
Semaphore
Other
Iteration
ISR
Tasking
CreateGroup
Handle CreateGroup(uintptr_t session, uintptr_t type);Description
Create a new task group.Return value
- Handle
Handle of the new group. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- uintptr_t session
Transparent session ID (its value can be anything). - uintptr_t type
Creation flags (GROUP_CR_*), such as GROUP_CR_LEADERDESTROY.
CreateTask
Handle CreateTask(Handle group, uintptr_t priority, uintptr_t type);Description
Create a new task.Return value
- Handle
Handle of the new task. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle group
Task group to create the task in. If 0 is passed, the current group will be used. A group can be created with CreateGroup. - uintptr_t priority
Task priority, integer ranging from TASK_MIN_PRIOR to TASK_MAX_PRIOR. - uintptr_t type
Task creation flags (TASK_CR_*), such as TASK_CR_SUPER.
CreateThread
Handle CreateThread(Handle task, PFN_THREADENTRY start, void* data, uintptr_t type, void* sp);Description
Create a new thread in a task.Return value
- Handle
Handle of the new thread. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - PFN_THREADENTRY start
Entry point of the new thread. The address shall be an executable address in the address space of task. - void* data
Transparent entry point data. This will be directly passed to the entry point. - uintptr_t type
Priority between THREAD_MIN_PRIOR and THREAD_MAX_PRIOR. - void* sp
Initial stack pointer. The value may be aligned down. The address shall be a readable and writable address in the address space of task.
Important! Keep in mind the stack is usually grows towards lower addresses.
CreateISR
Handle CreateISR(Handle task, uintptr_t irq_num, PFN_ISR pfn, void* data, uintptr_t type, void* sp);Description
Create a new Interrupt Service Routine in a task.Note that, an ISR function must return using the RetISR system call.
Return value
- Handle
Handle of the new ISR. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY). This task will be the owner of the new ISR, and the ISR function will be executed in the address space of this task.
Value 0 is a pseudo handle to the current task. - uintptr_t irq_num
IRQ number. - PFN_ISR pfn
Entry point of the ISR. The address shall be an executable address in the address space of task. - void* data
Transparent entry point data. This will be directly passed to the entry point. - uintptr_t type
Creation flags (ISR_CR_*), such as ISR_CR_ENABLE.
Priority between ISR_MIN_PRIOR and ISR_MAX_PRIOR. - void* sp
Initial stack pointer. The value may be aligned down. The address shall be a readable and writable address in the address space of task.
Important! Keep in mind the stack is usually grows towards lower addresses.
RetISR
Result RetISR(uintptr_t retval);Description
Return from an Interrupt Service Routine.The code must return from an ISR using this system call, otherwise, it causes an undefined behaviour, and the task will possibly crash.
Important! Call to this system call shall be from ISR code only.
Return value
- Result
This system call shall not return in normal usage.
Arguments
- uintptr_t retval
Must be one of the following:
CreateHandle
Handle CreateHandle(Handle task, Handle handle, uintptr_t perm);Description
Create a new handle for a specific task. Permissions can be revoked from the new handle compared to the original one.Return value
- Handle
The newly created Handle which is owned by task.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - Handle handle
A valid handle to a kernel object. Requires PERMBIT_MODIFY if not master handle. - uintptr_t perm
Permissions to set.
Important! Permissions cannot be extended, only those permissions can be set on the new handle that the handle already owned.
Example: Assume handle has PERMBIT_ACCESS, then the following permissions can be granted to the handle:- PERM_TASK_ACCESS: The owner task of the handle can perform operations that require PERMBIT_ACCESS.
- PERM_OTHER_ACCESS: Other tasks who has the handle can perform operations that require PERMBIT_ACCESS.
CheckPermissions
Result CheckPermissions(Handle obj, uintptr_t perm, uintptr_t* got);Description
Check which permissions the specified object has, using a permission mask.Return value
- Result
E_OK on success; other error code on error.
Arguments
- Handle obj
A valid handle to the kernel object to delete. - uintptr_t perm
Permission bits to check, i.e. PERMBIT_DELETE or PERMBIT_ACCESS.
See CreateHandle for details about the permission bits. - uintptr_t* got
The permissions the object has will be stored here after the successful system call.
DeleteObject
Result DeleteObject(Handle obj, uintptr_t param);Description
Delete a kernel object or a handle.Return value
- Result
E_OK on success; other error code on error.
In special cases (if the object is the current task or current thread) this system call will never return.
Arguments
- Handle obj
A valid handle to the kernel object to delete. - uintptr_t param
Additional flags.- DELETE_ORIGINAL: if obj is not a master handle then delete the original object, not just the handle. Requires PERMBIT_DELETE.
- MEMO_DEL_FORCE: only for memory objects
- MEMO_DEL_DELAY: only for memory objects
GetObjectInfo
Result GetObjectInfo(Handle obj, uintptr_t tag, uintptr_t* val);Description
Get information about a kernel object.Return value
- Result
E_OK on success; other error code on error.
Arguments
- Handle obj
A valid handle to the kernel object to query. Requires PERMBIT_INFO, except for tags with value below KTAGBOUNDARY_COMMONTAGS. - uintptr_t tag
Attribute to query, for example: KTAG_MASTER. - uintptr_t* val
The value of the queried attribute will be stored here after the successful system call.
ControlObject
Result ControlObject(Handle obj, uintptr_t cmd, uintptr_t param1, uintptr_t param2, uintptr_t param3, uintptr_t param4);Description
Perform a change on a kernel object or on the kernel itself.Return value
- Result
E_OK on success; other error code on error.
Arguments
- Handle obj
A valid handle to the kernel object to control. Requires PERMBIT_CONTROL.
This system call can perform changes in the kernel itself, for example memory segments can be added (KCO_CMD_ADD_MEMORY), or cache operations can be made (KCO_CMD_FLUSH_VIRTUAL). For these operations, use the KERNEL_HANDLE pseudo-handle. Also, some of these operations require TASK_CR_SUPER. - uintptr_t cmd
Command to perform, such as KCO_CMD_ADD_MEMORY.
Read the comment after the command in the header file (or see below) for information about the parameters. - uintptr_t param1
Command specific parameter 1. - uintptr_t param2
Command specific parameter 2. - uintptr_t param3
Command specific parameter 3. - uintptr_t param4
Command specific parameter 4.
CreateWatchObject
Handle CreateWatchObject(Handle task, Handle msgport, Handle obj, uintptr_t type);Description
Create a watch object that will wait for the specified event, and send a message when the event occurs.This call makes it possible to wait for events in the kernel. Once installed, the watch object persist until it is removed by a call to DeleteObject, by the parent task exiting or by the deletion of the object being watched.
An object can have a limited number of watch objects per slot. The limit is defined by WATCHSLOT_CAPACITY macro. A watch slot may share events. The slots are:
- object generic: KWATCH_OBJ_DELETED, KWATCH_OBJ_ERROR
- kernel only: KWATCH_KERNEL_NEWTASK
- memory object specific: KWATCH_MEMO_NEWVIEW, KWATCH_MEMO_DELVIEW KWATCH_MEMO_NEWCOPY, KWATCH_MEMO_DELCOPY
- task specific: KWATCH_TASK_NEWTHREAD, KWATCH_TASK_DELTHREAD
- event specific: KWATCH_EVENT_SET
Example: A MsgPort object has only one watch slot, the object generic, but an Event object has two watch slots: the object generic and the event specific.
Return value
- Handle
The newly created Handle which is owned by task.
Important! The returned handle will not be a master handle if the owner is not the current task.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
The newly created object will be made for the specified task. Value 0 pseudo handle can be used to refer to the current task. Requires PERMBIT_MODIFY. - Handle msgport
The message will be sent to this Message Port if the event occured. Requires PERMBIT_ACCESS. - Handle obj
A valid handle to the kernel object to watch on. Requires PERMBIT_ACCESS.
The KERNEL_HANDLE pseudo handle must be passed when trying to create watches in the kernel (for instance KWATCH_KERNEL_NEWTASK). - uintptr_t type
Watch type to create (with the mask of KWATCH_MASK), such as KWATCH_OBJ_DELETED or KWATCH_TASK_NEWTHREAD.
Further modifiers can be passed, for example WATCH_CR_MASTER.
CreateMemo
Handle CreateMemo(Handle task, void* location, uintptr_t size, uintptr_t type);Description
Create a new memory object.Direct access to a memory object is rarely possible. To get access to it use the AllocView system call.
Return value
- Handle
Handle of the new memory object. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - void* location
Address of the hardware register (MEMO_CR_HWREG only). - uintptr_t size
Number of octets to allocate. This value will be aligned up to pages. Cannot be zero. - uintptr_t type
Creation flags (MEMO_CR_*) and memory type.
MEMO_CR_TYPE0 allows to allocate from type#0 memory as well, not just the given one.
CreateMemoCopy
Handle CreateMemoCopy(Handle task, Handle memo, void* location, uintptr_t type);Description
Create a copy-on-write copy of a memory object. The parent memory object must not have any views.Return value
- Handle
Handle of the new memory object copy. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - Handle memo
A valid handle to a memory object (requires PERMBIT_MODIFY). - void* location
Reserved, must be zero. - uintptr_t type
Stored but not used; reserved, must be zero.
AllocView
void* AllocView(Handle task, Handle memo, const void* location, uintptr_t offset, uintptr_t size, uintptr_t type);Description
Allocate a view for the given memory object.Return value
- void*
Allocated virtual memory address.
NULL on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY). The view will be usable only in this task.
Value 0 is a pseudo handle to the current task. - Handle memo
A valid handle to a memory object (requires PERMBIT_ACCESS). The view will point to this memory object. - const void* location
Desired location of the new view. If this not NULL, it must be a valid, free virtual space with the necessary size in the virtual space of task. See VirtualAlloc system call. - uintptr_t offset
Offset in octets from the memory object start address. This will be rounded up to pages. - uintptr_t size
Size of the view in octets. This will be rounded up to pages. Value 0 is a special value, and means the size of the entire memory object. - uintptr_t type
View type (VIEW_CR_*), such as VIEW_CR_SHARED.
Access attributes (VIEW_AA_*), such as VIEW_AA_I.
FreeView
Result FreeView(Handle task, const void* location, uintptr_t param);Description
Free a previously allocated view created by AllocView.Note: the preallocated virtual spaces will not be freed as expected (see VirtualFree).
Return value
- Result
E_OK on success, and other error code can be returned.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - const void* location
An address from within the view. Does not need to be the address of the first byte of the view. - uintptr_t param
Type of the deletion. Currently reserved. TODO: introduce VIEW_DEL_PRESERVE.
GetAddressMemo
Handle GetAddressMemo(Handle task, const void* loc, uintptr_t addrtype);Description
Find a memory object by address.Return value
- Handle
Handle of the found memory object. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_ACCESS). This will define the search space.
Value 0 is a pseudo handle to the current task. - const void* loc
The location the search based on. - uintptr_t addrtype
The type of the address given in loc.- ADDRTYPE_PHYSICAL: the given address is a physical address.
- ADDRTYPE_VIRTUAL: the given address is a virtual address.
- ADDRTYPE_VIRTCONS: the given address is a virtual address, and must be constructed (can be read/written).
GetAddressView
Handle GetAddressView(Handle task, const void* loc, uintptr_t type);Description
Find a memory view by address.Return value
- Handle
Handle of the found memory view. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_ACCESS). This will define the search space.
Value 0 is a pseudo handle to the current task. - const void* loc
The location the search based on. Must be a virtual address in the virtual address space of task. If the address falls within the range of a view, the view is returned. - uintptr_t type
Alters the interpretation of the loc parameter. The following options can be ORd together:- GAV_EXIST: the given address belongs to a view.
- GAV_CONSTRUCTED: the given address is constructed (can be read/written).
VirtualAlloc
void* VirtualAlloc(Handle task, void* location, uintptr_t size, uintptr_t type);Description
Allocate virtual memory space to a task.Return value
- void*
The start address of the allocated virtual space.
NULL on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY). This task will be the owner of the virtual space.
Value 0 is a pseudo handle to the current task. - void* location
Desired virtual address. This argument shall be zero, so the kernel will allocate a new virtual space. - uintptr_t size
Desired virtual space size in ocetets. Will be rounded up to page size. - uintptr_t type
Virtual memory space type identification.
VirtualFree
Result VirtualFree(Handle task, void* location, uintptr_t type);Description
Free a previously allocated virtual space by VirtualAlloc.Return value
- Result
E_OK on success, and other error code can be returned.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - void* location
The address of the virtual space. This could be the start address of the virtual space, but it can be any address in the virtual space. - uintptr_t type
Reserved for future use, must be zero.
CreateMsgPort
Handle CreateMsgPort(Handle task, uintptr_t param);Description
Create a new Message Port. This is a synchronization object, and threads can wait on it.Return value
- Handle
Handle of the new Message Port. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY). This task will be the owner of the Message Port.
Value 0 is a pseudo handle to the current task. - uintptr_t param
Creation flags (MSGP_CR_*), such as MSGP_CR_OWNERSEND.
SendMsg
Result SendMsg(Hande mport, Handle sender, uintptr_t msg1, uintptr_t msg2, intptr_t timeout);Description
Send a message to a Message Port.Return value
- Result
E_OK on success,
E_MSGPORT_IS_FULL if the Message Port was full;
other error code can be returned.
Arguments
- Hande mport
A valid handle to a Message Port (requires PERMBIT_ACCESS). - Handle sender
The sender part of the message. This is not need to be a valid handle. - uintptr_t msg1
The message 1 part of the message. - uintptr_t msg2
The message 2 part of the message. - intptr_t timeout
Timeout in ticks (milliseconds). Negative timeout is interpreted as infinity. However, consider using MP_BLOCKING special constant to indicate an infinite wait. Shall not be greater than MAX_DELAY.
Special constants:- MP_NOW: send the message if possible, but return immediately if no more space available
- MP_BLOCKING: wait until the message is delivered, regardless how long it will take
RecvMsg
Result RecvMsg(Hande mport, Handle* sender, uintptr_t* msg1, uintptr_t* msg2, intptr_t timeout);Description
Receive a message from the Message Port.Return value
- Result
E_OK on success,
E_MSGPORT_IS_EMPTY if the Message Port was empty;
other error code can be returned.
Arguments
- Hande mport
A valid handle to a Message Port (requires PERMBIT_ACCESS). - Handle* sender
The sender part of the message will be stored here. May not be a valid handle. - uintptr_t* msg1
The message 1 part of the message will be stored here. - uintptr_t* msg2
The message 2 part of the message will be stored here. - intptr_t timeout
Timeout in ticks (milliseconds). Negative timeout is interpreted as infinity. However, consider using MP_BLOCKING special constant to indicate an infinite wait. Shall not be greater than MAX_DELAY.
Special constants:- MP_NOW: receive the message if any, and return immediately if no messages
- MP_BLOCKING: wait until a message is received, regardless of how long it will take
PeekMsg
Result PeekMsg(Hande mport, Handle* sender, uintptr_t* msg1, uintptr_t* msg2, intptr_t timeout);Description
Receive a message from the Message Port without removing it from the Message Port.Return value
- Result
Same as RecvMsg.
Arguments
- Hande mport
Same as RecvMsg. - Handle* sender
Same as RecvMsg. - uintptr_t* msg1
Same as RecvMsg. - uintptr_t* msg2
Same as RecvMsg. - intptr_t timeout
Same as RecvMsg.
RecvMsgPtr
Result RecvMsgPtr(Hande mport, uintptr_t* msg, intptr_t timeout);Description
An optimized version of the RecvMsg system call. It uses only 3 arguments instead of 5, which is more effective on armv7a an similar architectures. Instead of taking 3 pointers to store message content, it expects an array of at least 3 uintptr_t elements.Return value
- Result
Same as RecvMsg.
Arguments
- Hande mport
Same as RecvMsg. - uintptr_t* msg
An array to store the message content: msg[0] = sender, msg[1] = msg1 and msg[2] = msg2. - intptr_t timeout
Same as RecvMsg.
PeekMsgPtr
Result PeekMsgPtr(Hande mport, uintptr_t* msg, intptr_t timeout);Description
An optimized version of the PeekMsg system call. It uses only 3 arguments instead of 5, which is more effective on armv7a an similar architectures. Instead of taking 3 pointers to store message content, it expects an array of at least 3 uintptr_t elements.Return value
- Result
Same as RecvMsg.
Arguments
- Hande mport
Same as RecvMsg. - uintptr_t* msg
An array to store the message content: msg[0] = sender, msg[1] = msg1 and msg[2] = msg2. - intptr_t timeout
Same as RecvMsg.
CreateMsgPipe
Handle CreateMsgPipe(Handle task, Handle to, Handle from, uintptr_t param);Description
Create a Message Pipe that connects two Message Ports. This kernel object will automatically redirect messages from a Message Port to another.Message Pipe chains cannot be longer than 2 message port: only one Message Pipe per continuous chain. A Message Port may have multiple Message Pipes. Source and destination Message Port cannot be the same.
Return value
- Handle
Handle of the new Message Pipe. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY). This task will be the owner of the Message Pipe.
Value 0 is a pseudo handle to the current task. - Handle to
A valid handle to a Message Port (requires PERMBIT_MODIFY). This Message Port will be the destination, threads can call RecvMsg and PeekMsg on this. - Handle from
A valid handle to a Message Port (requires PERMBIT_MODIFY). This Message Port will be the source, threads cannot call RecvMsg and PeekMsg on this, but can call SendMsg. - uintptr_t param
Creation flags (MSGPIPE_CR_*), such as MSGPIPE_CR_FIXSENDER.
CreateSignalMsg
Handle CreateSignalMsg(Handle task, Hande msgport, Handle sender, uintptr_t msg1, uintptr_t msg2, uintptr_t type);Description
Create a new Signal Message. This Message can be sent anytime (at most restricted by SIGMSG_CR_WAITFORRESET, but not the Message Port), and the kernel will record each SendSignalMsg call. Therefore, the right amount of messages will be delivered.In Interrupt Service Routines this can be an important object.
Return value
- Handle
Handle of the new Signal Message. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY). This task will be the owner of the Signal Message.
Value 0 is a pseudo handle to the current task. - Hande msgport
A valid handle to a Message Port (requires PERMBIT_ACCESS). The Signal Message will be sent onto this Message Port. - Handle sender
The sender part of the message. This is not need to be a valid handle. - uintptr_t msg1
The message 1 part of the message. - uintptr_t msg2
The message 2 part of the message. - uintptr_t type
Creation flags (SIGMSG_CR_*), such as SIGMSG_CR_WAITFORRESET.
SendSignalMsg
Result SendSignalMsg(Hande sigmsg);Description
Send the Signal Message. The operation can fail only when the target Message Port is deleted, or the Signal Message is deleted. Also, it may fail if the Signal Message must be reset (SIGMSG_CR_WAITFORRESET in CreateSignalMsg).Return value
- Result
E_OK on success, other error code can be returned.
Arguments
- Hande sigmsg
A valid handle to a Signal Message (requires PERMBIT_ACCESS).
ResetSignalMsg
Result ResetSignalMsg(Hande sigmsg, uintptr_t param);Description
Reset the Signal Message.Return value
- Result
E_OK on success, other error code can be returned.
Arguments
- Hande sigmsg
A valid handle to a Signal Message (requires PERMBIT_ACCESS). - uintptr_t param
Reserved for future use, must be zero.
CreateSemaphore
Handle CreateSemaphore(Handle task, uintptr_t value, uintptr_t maxvalue, uintptr_t type);Description
Create a new semaphore. This is a synchronization object, and threads can wait on it.Return value
- Handle
Handle of the new semaphore. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - uintptr_t value
Initial value. - uintptr_t maxvalue
Maximal value of the semaphore. - uintptr_t type
Reserved for future use, must be zero.
WaitSemaphore
Result WaitSemaphore(Handle sema, uintptr_t value, intptr_t timeout);Description
Wait for a semaphore. The call will be successful when the semaphore counter has the specified amount. Then the amount will be taken from the semaphore. It is the callers responsibility to give the correct amount back to the semaphore using the SignalSemaphore system call.Return value
- Result
E_OK on success, and other error code can be returned.
Arguments
- Handle sema
A valid handle to the semaphore (requires PERMBIT_ACCESS). - uintptr_t value
The amount to take from the semaphore.
Value 0 is a special value, and it means the maximal value specified in CreateSemaphore. - intptr_t timeout
Timeout in ticks (milliseconds). Negative timeout is interpreted as infinity. However, consider using SEMA_BLOCKING special constant to indicate an infinite wait. Shall not be greater than MAX_DELAY.
Special constants:- SEMA_NOW: check whether the semaphore has the sufficient amount and return immediately, regardless whether the amount is taken or not
- SEMA_BLOCKING: wait until the semaphore has the sufficient amount, no matter how long it will take
SignalSemaphore
Result SignalSemaphore(Handle sema, uintptr_t value);Description
Signal a semaphore (give some amount back to the semaphore). This call may wake another thread up.Return value
- Result
E_OK on success, and other error code can be returned.
Arguments
- Handle sema
A valid handle to the semaphore (requires PERMBIT_ACCESS). - uintptr_t value
Amount to give back to the semaphore.
CreateEvent
Handle CreateEvent(Handle htask, uintptr_t type);Description
Create a new event. This is a synchronization object, and threads can wait on it.Return value
- Handle
Handle of the new event. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle htask
A valid task handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - uintptr_t type
Creation flags (EVENT_CR_*),
such as EVENT_CR_SET and EVENT_CR_AUTORESET.
WaitForEvent
Result WaitForEvent(Handle hev, Handle* sender, uintptr_t* msg1, uintptr_t* msg2, intptr_t timeout);Description
Wait until the set flag of the event is set. Retrieve the message parameters as well.Return value
- Result
E_OK on success,
E_EVENT_IS_NOT_SET if the timeout was EV_NOW and the event is not set,
E_INVALID_TIMEOUT if the timeout was greater then MAX_DELAY,
and other error code can be returned.
Arguments
- Handle hev
A valid handle to an event object (requires PERMBIT_ACCESS). - Handle* sender
The master handle of the event will be stored here. - uintptr_t* msg1
The message 1 will be stored here. - uintptr_t* msg2
The message 2 will be stored here. - intptr_t timeout
Timeout in ticks (milliseconds). Negative timeout is interpreted as infinity. However, consider using EV_BLOCKING special constant to indicate an infinite wait. Shall not be greater than MAX_DELAY.
Special constants:- EV_NOW: check whether the event is set and return immediately, regardless whether the event was set or not
- EV_BLOCKING: wait until the event is set, no matter how long it will take
WaitForEventPtr
Result WaitForEventPtr(Handle hev, uintptr_t* msg, intptr_t timeout);Description
An optimized version of the WaitForEvent system call. It uses only 3 arguments instead of 5, which is more effective on armv7a an similar architectures. Instead of taking 3 pointers to store message content, it expects an array of at least 3 uintptr_t elements.Return value
- Result
Same as WaitForEvent.
Arguments
- Handle hev
Same as WaitForEvent. - uintptr_t* msg
An array to store the message content: msg[0] = sender, msg[1] = msg1 and msg[2] = msg2. - intptr_t timeout
Same as WaitForEvent.
SetEvent
Result SetEvent(Handle hev, uintptr_t msg1, uintptr_t msg2, uintptr_t type);Description
Set the set flag of the event. Also, modify the message values.Return value
- Result
E_OK on success, and other error code can be returned.
Arguments
- Handle hev
A valid handle to an event object (requires PERMBIT_ACCESS). - uintptr_t msg1
New message 1 value of the event. - uintptr_t msg2
New message 2 value of the event. - uintptr_t type
Reserved, must be zero.
ResetEvent
Result ResetEvent(Handle hev, uintptr_t type);Description
Clear the set flag in the event.Return value
- Result
E_OK on success, and other error code can be returned.
Arguments
- Handle hev
A valid handle to an event object (requires PERMBIT_ACCESS). - uintptr_t type
Reserved, must be zero.
CreateTimerObj
Handle CreateTimerObj(Handle task, Hande msgport, uintptr_t msg1, uintptr_t msg2, uintptr_t timeout, uintptr_t type);Description
Create a new Timer Object.Return value
- Handle
Handle of the new Timer Object. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY). This task will be the owner of the Timer Object.
Value 0 is a pseudo handle to the current task. - Hande msgport
A valid handle to a Message Port (requires PERMBIT_ACCESS). The Timer Object will send its ticks onto this Message Port. The sender will be the master handle of the Timer Object.
This argument must be zero if TIMEROBJ_CR_EXCEPTION is set in type. - uintptr_t msg1
The message 1 part of the message.
This argument holds the exception ID if TIMEROBJ_CR_EXCEPTION is set in type. - uintptr_t msg2
The message 2 part of the message.
This argument must be zero if TIMEROBJ_CR_EXCEPTION is set and TIMEROBJ_CR_USEREXCPARAM is unset in type. - uintptr_t timeout
The timeout (or interval if TIMEROBJ_CR_AUTOREWIND is set) of the Timer Object in ticks (milliseconds). Can be zero (or below timeout limit) only when TIMEROBJ_CR_AUTOSTART is not set. Shall not be greater than MAX_DELAY. - uintptr_t type
Creation flags (TIMEROBJ_CR_*), such as TIMEROBJ_CR_AUTOSTART.
If TIMEROBJ_CR_EXCEPTION is set, then the Timer Object will raise a user exception when the timeout exceeds instead of sending a message to a Message Port. Exception ID will be the value set in msg1. Exception parameter will the master handle of the Timer Object; unless TIMEROBJ_CR_USEREXCPARAM is set, which sets the exception parameter to msg2.
RewindTimerObj
Result RewindTimerObj(Handle to, uintptr_t timeout, uintptr_t flags);Description
Rewind (or reconfigure) a Timer Object.Return value
- Result
E_OK on success,
E_INVALID_TIMEOUT if the timeout was zero, or too small;
E_INVALID_ARGUMENT if the flags holds an invalid combination
other error code can be returned.
Arguments
- Handle to
A valid handle to a Timer Object (requires PERMBIT_ACCESS). - uintptr_t timeout
The new timeout (or interval). If this is zero, and it was zero in CreateTimerObj as well, E_INVALID_TIMEOUT will be returned. Shall not be greater than MAX_DELAY. - uintptr_t flags
Rewind flags (TIMEROBJ_REWIND_*), such as TIMEROBJ_REWIND_KEEP (which equals to zero for ease of use).
TIMEROBJ_REWIND_ONESHOT will clear the TIMEROBJ_CR_AUTOREWIND flag;
TIMEROBJ_REWIND_INTERVAL will set the TIMEROBJ_CR_AUTOREWIND flag.
Note: TIMEROBJ_REWIND_ONESHOT and TIMEROBJ_REWIND_INTERVAL flags cannot be used in conjunction.
StopTimerObj
Result StopTimerObj(Handle to, uintptr_t param);Description
Stop a running Timer Object.Return value
- Result
E_OK on success,
E_TIMER_IS_INACTIVE if the Timer was not active;
E_INVALID_ARGUMENT if param is non-zero;
other error code can be returned.
Arguments
- Handle to
A valid handle to a Timer Object (requires PERMBIT_ACCESS). - uintptr_t param
Reserved, must be zero.
SetExceptionHandler
Result SetExceptionHandler(Handle obj, uintptr_t type, PFN_EXC func, void* data);Description
Set the exception handler of a task or a memory object.Every task has two exception handlers: one for the system exceptions and one for the user exceptions.
Memory objects can have an exception handler to handle the page fault exceptions. The arguments are a bit different than the exception handlers for tasks. The arguments meant to be:
- void* userdata: user data as expected
- uintptr_t exid: this argument holds the handle of the memory object
- uintptr_t param: the offset in octets of the page that caused the fault
Return value
- Result
E_OK on success; other error code on error.
Arguments
- Handle obj
A valid task handle (requires PERMBIT_MODIFY), or a valid memory object handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - uintptr_t type
The exception handler type:- EXHAN_FLAG_SYSTEM: handler for the system exceptions
- EXHAN_FLAG_USER: handler for the user exceptions
For memory objects this must be EXHAN_FLAG_SYSTEM. - PFN_EXC func
Entry point of the exception handler. The address shall be an executable address in the address space of the task (or the owner task of the memory object). - void* data
Transparent entry point data. This will be directly passed to the exception handler.
RaiseException
Result RaiseException(Handle task, Handle thread, uintptr_t exid, uintptr_t param, uintptr_t type);Description
Raise a user exception to the specified task (and thread, see below).Return value
- Result
E_OK on success; other error code on error.
Arguments
- Handle task
A valid task handle (requires PERMBIT_ACCESS).
Value 0 is a pseudo handle to the current task. - Handle thread
A valid task handle (requires PERMBIT_ACCESS).
Value 0 is a pseudo handle to one of the threads in the specified task. - uintptr_t exid
Exception ID. - uintptr_t param
Exception parameter. - uintptr_t type
Reserved for future use, must be zero.
RetException
Result RetException(uintptr_t result, void* pc);Description
Return from an exception handler.The code must return from an exception handler with this system call. Otherwise, it causes an undefined behaviour, and the task will possibly crash.
Important! Call to this system call shall be from exception handlers only.
Return value
- Result
This system call shall not return in normal usage.
Arguments
- uintptr_t result
Must be one of the following:- EXRES_OK: the exception successfully handled, the interrupted execution will continue
- EXRES_FAIL: failed to handle the exception, the execution shall not continue
- void* pc
The kernel will modify program counter (aka. instruction pointer) to the specified address. This is useful for emulation.
This argument can be NULL, and for this special case, the program counter will not be modified.
AllocStoreId
uintptr_t AllocStoreId();Description
Allocate a new Store ID. There are a few preallocated Store IDs, such as STOREID_RES1. The last preallocated Store ID is available under STOREID_MAX.Return value
- uintptr_t
The new Store ID.
0 indicates a failure, see GetLastError for details. The E_OUT_OF_STORE_KEYS error code indicates that all the valid store IDs were already allocated.
Arguments
- None.
CreateStore
Result CreateStore(Handle obj, uintptr_t id, uintptr_t val, uintptr_t type);Description
Create a new store in the specified kernel object.Currently, only tasks can have stores.
Return value
- Result
E_OK on success; other error code on error.
Arguments
- Handle obj
A valid handle to a kernel object (requires PERMBIT_MODIFY). - uintptr_t id
Store ID. Cannot be zero. Must be one of the reserved or allocated (AllocStoreId) ones. - uintptr_t val
The value to store in. - uintptr_t type
Access restrictions:- STORE_NOSET: the stored value cannot be modified by SetStore
- STORE_NOGET: the stored value cannot be read by GetStore
- STORE_NOREMOVE: the store cannot be removed by RemoveStore
SetStore
Result SetStore(Handle obj, uintptr_t id, uintptr_t val);Description
Set the value of the store in a kernel object.Return value
- Result
E_OK on success,
E_STORE_ACCESS_DENIED if STORE_NOSET was set in CreateStore;
other error code on error.
Arguments
- Handle obj
A valid handle to a kernel object (requires PERMBIT_MODIFY). - uintptr_t id
ID of the previously created store by CreateStore. - uintptr_t val
The new value to store.
GetStore
Result GetStore(Handle obj, uintptr_t id, uintptr_t* val);Description
Set the value of the store in a kernel object.Return value
- Result
E_OK on success,
E_STORE_ACCESS_DENIED if STORE_NOGET was set in CreateStore;
other error code on error.
Arguments
- Handle obj
A valid handle to a kernel object (requires PERMBIT_ACCESS). - uintptr_t id
ID of the previously created store by CreateStore. - uintptr_t* val
The stored value will be returned here.
RemoveStore
Result RemoveStore(Handle obj, uintptr_t id);Description
Remove a store from a kernel object.Return value
- Result
E_OK on success,
E_STORE_ACCESS_DENIED if STORE_NOREMOVE was set in CreateStore;
other error code on error.
Arguments
- Handle obj
A valid handle to a kernel object (requires PERMBIT_MODIFY). - uintptr_t id
ID of the previously created store by CreateStore.
CreateIterator
Handle CreateIterator(Handle task, uintptr_t type);Description
Create a new iterator object. This object can be used for multiple iteration, by calling the BeginIterator multiple times (this system call will start a new iteration regardless of the current state of the iterator).Quick guide how to use iterator objects:
- create iterator with CreateIterator
- begin a new iteration with BeginIterator
- if StepIterator returns E_ITERATION_HAS_ENDED, the iteration has ended, go to 6 (optionally go to 2)
- use GetIteratorInfo to acquire information about the current element
- goto 3
- delete the iterator with DeleteObject
Return value
- Handle
Handle of the new iterator. Not necessarily a master handle.
INVALID_HANDLE on error. Check GetLastError for details.
Arguments
- Handle task
A valid task handle (requires PERMBIT_MODIFY).
Value 0 is a pseudo handle to the current task. - uintptr_t type
Reserved, must be zero.
BeginIterator
Result BeginIterator(Handle iter, Handle obj, uintptr_t type);Description
Begin a new iteration. This system call will drop the current state of the iterator, and reinitializes it.After a successful call (E_OK was returned) the iterator does not hold any data. Use the StepIterator system call to access to the first and the subsequent elements.
Return value
- Result
E_OK on success, and other error code can be returned.
Arguments
- Handle iter
A valid iterator handle (requires PERMBIT_ACCESS). - Handle obj
The handle of the kernel object to investigate (requires PERMBIT_ITERATE).
The KERNEL_HANDLE pseudo handle must be used to begin i.e. an ITER_KERNEL_TASKS iteration. - uintptr_t type
Type of the iteration. The type must match with the type of the obj argument. See the iteration type names, such as ITER_KERNEL_TASKS and ITER_MEMO_VIEWS. The second part (KERNEL and MEMO in the examples) shows the object type.
StepIterator
Result StepIterator(Handle iter);Description
Step the iterator get acquire the first or the next element, depending on the iterator state. After a successful BeginIterator the first element (if any), after StepIterator the next element will be acquired.Return value
- Result
E_OK on success,
E_ITERATION_HAS_ENDED when iteration has ended,
other error code can be returned.
Arguments
- Handle iter
A valid iterator handle (requires PERMBIT_ACCESS).
GetIteratorInfo
Result GetIteratorInfo(Handle iter, uintptr_t tag, uintptr_t* val);Description
Get information about the acquired element by the StepIterator system call. This system call is similar to GetObjectInfo, except the required permissions, and the first argument is the iterator (that in turn will reference an object).Return value
- Result
Arguments
- Handle iter
A valid iterator handle (requires PERMBIT_ACCESS). - uintptr_t tag
Same as in GetObjectInfo. - uintptr_t* val
Same as in GetObjectInfo.
GetLastError
Result GetLastError();Description
Get the last error code of the current context (of the current thread).The error codes are stored per context per thread basis, so the execution will not loose its error code during handling an exception.
Return value
- Result
Last error code.
E_OK or other error code.
Arguments
- None.
GetState
uintptr_t GetState(uintptr_t ks);Description
Get kernel state, such as the current task, current thread, or the available memory.Return value
- uintptr_t
Value of the queried state.
Arguments
- uintptr_t ks
One of KST_* constants, i.e. KST_CURRENTTASK.
SetState
Result SetState(uintptr_t ks, uintptr_t s);Description
Set kernel state.Some states are read-only (RdOnly in the comment below), one-time writable (Once in the comment), architecture dependent (Arch in the command), or build dependent (Build in the command).
Note: KST_DEBUGCONSOLE seems to be writable, but actually no change will be made in the kernel. Only the debug console will be opened. Still, KST_DEBUGCONSOLE is build dependent.
Return value
- Result
E_OK on success; other error code on error.
Arguments
- uintptr_t ks
A KST_* value, such as KST_TIME. - uintptr_t s
The new value.
GetSystemData
Result GetSystemData(uintptr_t data_tag, uintptr_t index, uintptr_t* value);Description
Read an uintptr_t-sized slot from a special kernel data table.These tables can store trace data or any architecture dependent data.
Return value
- Result
E_OK on success;
E_INDEX_OUT_OF_RANGE if the index is out of range;
other error code on error.
Arguments
- uintptr_t data_tag
One of the KSYSTAG_* constants, i.e. KSYSTAG_KERNELTRACEINFO. This is the tag of the data table to query. - uintptr_t index
Index in the specified data tables.
Some data tables have many elements (for instance KSYSTAG_KERNELTRACEABSDATA), but some (KSYSTAG_KERNELTRACEINFO) has only a few.
Some tables (especially KSYSTAG_KERNELTRACEINFO) defines table indices as constants: KSYSIDX_KERNELTRACEINFO_BASE, KSYSIDX_KERNELTRACEINFO_SIZE, and so on.
Others, for example KSYSTAG_ARCHINFO and KSYSTAG_ARCHDATA are architecture dependent, and the number of slots vary. - uintptr_t* value
The indexth slot of the data table specified by data_tag will be stored here after the successful system call.
Delay
Result Delay(uintptr_t duration);Description
Suspend the execution of the current task for the specified duration.If the duration is zero, the thread is yield, and the next thread will be scheduled (if the current task has other threads on that priority; otherwise the current thread will be rescheduled).
The actual delay will be duration+1, because the scheduler can resume the thread in tick interrupts. Therefore, the expected error will be half of one tick (millisecond).
Return value
- Result
E_OK on success
E_NOT_IN_ISR if called in ISR
E_INVALID_ARGUMENT if the duration was too large
Arguments
- uintptr_t duration
Number of ticks (milliseconds) to delay the current thread. Shall not be greater than MAX_DELAY.
LibBase
void* LibBase();Description
This system call is reserved for future use.Return value
- void*
NULL
Arguments
- None.
Index of constants
- ADDRTYPE_PHYSICAL 1
given address is physical - ADDRTYPE_VIRTCONS 3
given address is virtual and constructed - ADDRTYPE_VIRTUAL 2
given address is virtual - CTXST_BLOCKED 4
waiting for a resource with infinite timeout - CTXST_READY 1
context is ready to run - CTXST_WAITPEEK 3
waiting in PeekMsg - CTXST_WAIT 2
waiting for a resource with definite timeout - CTXTY_BOTTOM 0x0B
nested context into the thread (exactly one per thread) - CTXTY_EXCEPTION 0x0E
exception handler context - CTXTY_ISR 0x01
interrupt handler context - DELETE_ORIGINAL 0x80000000
delete the original kernel object as well, not just the handle (implied for master handles) - E_64BIT_MODE_ONLY 0x0121
- E_ABORTED 0x0117
- E_ACCESS_DENIED 0x0102
- E_BAD_SENDER_TYPE 0x1104
- E_CANNOT_ALLOCATE_EXC_CONTEXT 0x0612
the exception context in the target task cannot be allocated (too many context or no memory) - E_CANNOT_EXPAND_SHARED_VIEW 0x0307
- E_CANNOT_MODIFY_STATE 0x0120
- E_CANNOT_PEEK 0x0503
- E_COULD_NOT_BE_INDESTRUCTIBLE 0x1701
- E_CURRENT_TASK_ONLY 0x0133
the operation can be performed only on the current task - E_DIFFERENT_SHARED_VIEW_OFFSET 0x0306
- E_EVENT_IS_NOT_SET 0x1501
- E_GROUP_IS_INDESTRUCTIBLE 0x1702
- E_GROUP_MISMATCH 0x0605
- E_HWREG_LOCATION_IS_NULL 0x0207
- E_HWREG_LOCATION_USED 0x0208
- E_IDLE_TASK 0x0610
the requested operation cannot be performed on idle task - E_INDEX_OUT_OF_RANGE 0x0132
- E_INITIALIZATION_FAILED 0x0122
- E_INVALID_ADDRESS_ALIGNMENT 0x0107
- E_INVALID_ADDRTYPE 0x0209
- E_INVALID_ARGUMENT 0x0104
- E_INVALID_COMMAND 0x0116
- E_INVALID_GROUP_TYPE 0x1703
- E_INVALID_HANDLE 0x0101
the given handle is invalid - E_INVALID_ITERATOR_TYPE 0x1402
- E_INVALID_MEM_FLAGS 0x0214
- E_INVALID_OBJECT 0x0110
- E_INVALID_PRIORITY 0x0105
- E_INVALID_SPACE_ADDRESS 0x0313
- E_INVALID_STATE 0x0118
- E_INVALID_STORE_ID 0x0901
- E_INVALID_SYSTEM_CALL 0x0114
- E_INVALID_TAG 0x0111
- E_INVALID_TIMEOUT 0x1001
- E_INVALID_VECTOR_NUMBER 0x1601
- E_INVALID_VECTOR_TYPE 0x1602
- E_ISR_NUM_OUT_OF_RANGE 0x0801
- E_ITERATION_HAS_ENDED 0x1401
- E_ITERATOR_INVALIDATED 0x1403
- E_MEMO_BTREE_INIT_FAILED 0x0201
- E_MEMO_HAS_COPIES 0x0203
- E_MEMO_HAS_VIEWS 0x0202
- E_MEMO_IS_DELETED 0x0204
- E_MEMO_IS_HARDWARE_REGISTER 0x0205
- E_MEMORY_ACCESS_VIOLATION 0x0115
- E_MEMORY_CHUNK_COLLISION 0x0213
- E_MEMORY_IS_USED 0x0109
- E_MEMO_STILL_ACCESS_PAGE 0x0211
- E_MISSING_PERMISSION 0x0129
- E_MSGPIPE_CHAIN_DETECTED 0x1101
- E_MSGPIPE_LOOPBACK_DETECTED 0x1102
- E_MSGPORT_IS_EMPTY 0x0501
- E_MSGPORT_IS_FULL 0x0502
- END_ISR_CHAIN 0
the interrupt is successfully handled - E_NO_EXCEPTION_HANDLER_THREAD 0x0611
the target task has no thread capable to handle the exception - E_NO_HWREG_ON_ADDRESS 0x0212
- E_NO_MEMO_ON_ADDRESS 0x0206
- E_NO_MEMORY_FOR_PAGEDESC 0x0401
- E_NO_MEMORY_ON_ADDRESS 0x0108
- E_NO_NEXT_ELEMENT 0x0127
- E_NO_SUCH_HANDLE 0x0131
- E_NO_SUCH_REGISTER 0x0606
the specified register does not exist - E_NOT_ALLOCATABLE_MEMORY 0x0215
- E_NO_THREAD_ON_OFFSET 0x0210
- E_NOT_IMPLEMENTED 0x0113
- E_NOT_IN_ISR 0x0106
- E_NOT_SUPPORTED 0x0126
- E_NO_VIEW_ON_ADDRESS 0x0304
- E_NO_VIRTSPACE_FOR_TYPE 0x0311
- E_OFFSET_IS_BEYOND_SIZE 0x0216
- E_OK 0x0
the system call was successful - E_ONWAIT_OBJ_DELETED 0x0124
- E_ONWAIT_OBJ_TIMEOUT 0x0125
- E_OPTION_NOT_SUPPORTED 0x0123
- E_OUT_OF_CHUNK_MEMORY 0x0400
- E_OUT_OF_ENVELOPE_MEMORY 0x0504
- E_OUT_OF_EVENT_MEMORY 0x1500
- E_OUT_OF_GROUP_MEMORY 0x1700
- E_OUT_OF_IRQ_VECTORS 0x1600
- E_OUT_OF_ISR_MEMORY 0x0800
- E_OUT_OF_ITER_MEMORY 0x1400
- E_OUT_OF_MEMNODE_MEMORY 0x0302
- E_OUT_OF_MEMO_MEMORY 0x0200
- E_OUT_OF_MEMORY 0x0100
ran out of memory while performing the system call - E_OUT_OF_MSGPIPE_MEMORY 0x1100
- E_OUT_OF_MSGPORT_MEMORY 0x0500
- E_OUT_OF_SEMA_MEMORY 0x0700
- E_OUT_OF_SIGNALMSG_MEMORY 0x1200
- E_OUT_OF_STORE_KEYS 0x0900
- E_OUT_OF_STORE_MEMORY 0x0903
- E_OUT_OF_TASK_MEMORY 0x0600
- E_OUT_OF_THREAD_MEMORY 0x0601
- E_OUT_OF_TIMEROBJ_MEMORY 0x1000
- E_OUT_OF_VIEW_MEMORY 0x0301
- E_OUT_OF_VIRTSPACE_MEMORY 0x0310
- E_OUT_OF_VIRTUAL_MEMORY_SPACE 0x0303
- E_OUT_OF_WATCH_MEMORY 0x1300
- E_OWNER_SEND_ONLY 0x0505
- E_PAGE_IS_NOT_LOADED 0x0217
- E_PGID_IS_SEALED 0x0604
- E_PREFETCH_VIEW_IS_BUSY 0x0314
- E_PROPERTY_IS_LOCKED 0x0128
- E_REGISTER_NO_READ 0x0607
the specified register cannot be read - E_REGISTER_NO_WRITE 0x0608
the specified register cannot be written - E_RESOURCE_SHORTAGE 0x0135
- E_RESTRICTED_MSGPORT 0x1103
- E_SEGMENT_IS_TOO_LARGE 0x0130
- E_SEMA_TOO_LOW 0x0702
- E_SEMA_VALUE_EXCEEDED 0x0701
- E_SESSION_MISMATCH 0x1704
- E_SIGNALMSG_ALREADY_DELETED 0x1204
- E_SIGNALMSG_ALREADY_IN_RESET 0x1203
- E_SIGNALMSG_IS_INVALID 0x1201
- E_SIGNALMSG_WAIT_FOR_RESET 0x1202
- E_SLABS_NOT_INITIALIZED 0x0112
- E_STATE_IS_READ_ONLY 0x0119
- E_STORE_ACCESS_DENIED 0x0905
- E_STORE_ALREADY_EXIST 0x0904
- E_STORE_NOT_FOUND 0x0902
- E_SUPER_TASK_ONLY 0x0134
only super task can perform the requested operation - E_SYSCALL_INTR 0x0136
the blocking system call was interrupted by an exception handler - E_TASK_IS_ZOMBIE 0x0603
the task entered the zombie state, and no further operations are allowed - E_THREAD_OWNER_MISMATCH 0x0602
- E_TIMER_IS_ACTIVE 0x1002
- E_TIMER_IS_INACTIVE 0x1003
- E_TOO_MANY_WATCH_ON_SLOT 0x1302
- E_TYPE_MISMATCH 0x0103
- E_UNAUTHORIZED_TASK_FLAG 0x0609
one of the specified task flags needs authorization, i.e. TASK_CR_KERNEL and TASK_CR_IDLE - E_UNKNOWN_WATCH_ID 0x1301
- EV_BLOCKING (-1)
block until the event is not set - EVENT_CR_AUTORESET 0x00000002
automatically reset the event - EVENT_CR_SET 0x00000001
the event is set - E_VIEW_IS_SHARED 0x0305
- E_VIEW_TOO_LARGE 0x0300
- E_VIRTUAL_ADDRESS_USED 0x0308
- E_VIRTUAL_SPACE_COLLISION 0x0312
- E_VIRTUAL_SPACE_TOO_SMALL 0x0309
- EV_NOW 0
always return immediately from WaitForEvent - EXHAN_FLAG_SYSTEM 0x10000000
system exceptions - EXHAN_FLAG_USER 0x20000000
user exceptions - EXHAN_MASK_EXID 0x0fffffff
mask for the exception ID - EXID_SYS_ALIGNMENT 11
- EXID_SYS_BREAKPOINT 3
- EXID_SYS_DEBUG 2
- EXID_SYS_DEVICE_NOT_AVAILABLE 6
- EXID_SYS_DIVIDE_ERROR 1
- EXID_SYS_FLOATING_POINT 7
- EXID_SYS_GENERAL_PROTECTION 9
- EXID_SYS_INVALID_ADDRESS 10
- EXID_SYS_INVALID_INSTRUCTION 5
- EXID_SYS_MACHINE_CHECK 12
- EXID_SYS_OVERFLOW 4
- EXID_SYS_RESERVED 0
- EXID_SYS_SIMD_FLOATING_POINT 8
- EXID_SYS_VIRTUALIZATION 13
- EXRES_FAIL 0xF
failed to handle the exception, stop execution - EXRES_INT 1
the exception was successfully handled, and interrupt the blocked system call below the exception context - EXRES_OK 0
the exception was successfully handled - GAV_CONSTRUCTED 1
the given address is constructed (can be read/written) - GAV_EXIST 0
the given address belongs to a view - GROUP_CR_INDESTRUCTIBLE 0x00000008
the group is indestructible (only the kernel can make such group) - GROUP_CR_INHERITSESSION 0x00000004
inherit session ID from the current group - GROUP_CR_KEEPEMPTY 0x00000002
do not destroy when it became empty - GROUP_CR_LEADERDESTROY 0x00000001
the group will be destroyed when the leader task has been deleted - ISR_CR_ENABLE 0x00000100
the ISR will be enabled (must be explicitly enabled otherwise) - ISR_MAX_PRIOR 0xff
- ISR_MIN_PRIOR 0
- ISR_NUM_PRIOR 0x100
- ISRS_DISABLED 0
the ISR is currently disabled - ISRS_ENABLED 1
the ISR is enabled, and processing the interrupts - ISRS_ERROR 2
the ISR in error state - ITER_GROUP_TASKS 0x01104001
iterate through all tasks in a task group - ITER_KERNEL_GROUPS 0x01100004
iterate through all groups (KERNEL_HANDLE) - ITER_KERNEL_SYSMEMS 0x01100002
iterate through all system memories (KERNEL_HANDLE) - ITER_KERNEL_SYSVIRTS 0x01100003
iterate through all system virtual memory spaces (KERNEL_HANDLE) - ITER_KERNEL_TASKS 0x01100001
iterate through all tasks in the kernel (KERNEL_HANDLE) - ITER_MEMO_COPIES 0x01102002
iterate through all copies of a memory object - ITER_MEMO_VIEWS 0x01102001
iterate through all views of a memory object - ITER_MSGPORT_MSGPIPES 0x01103001
iterate through all Message Pipes of a Message Port - ITER_TASK_EVENTS 0x0110100B
iterate through all Events of a task - ITER_TASK_ISRS 0x01101006
iterate through all ISRs of a task - ITER_TASK_MEMOS 0x01101001
iterate through all memory objects of a task - ITER_TASK_MSGPIPES 0x01101004
iterate through all Message Pipes of a task - ITER_TASK_MSGPORTS 0x01101003
iterate through all Message Ports of a task - ITER_TASK_SEMAS 0x01101005
iterate through all Semaphores of a task - ITER_TASK_SIGNALMSGS 0x01101008
iterate through all Signal Messages of a task - ITER_TASK_SYSVIRTS 0x01101050
iterate through all reserved virtual spaces of a task - ITER_TASK_THREADS 0x01101002
iterate through all threads of a task - ITER_TASK_TIMEROBJS 0x01101007
iterate through all Timer Objects of a task - ITER_TASK_VIEWS 0x0110100A
iterate through all Views of a task - ITER_TASK_WATCHES 0x01101009
iterate through all Watches of a task - KCO_CMD_ACTIVATE_KERNELTRACE 0x00001E03
kernel // params: boolean, MBZ, MBZ, MBZ - KCO_CMD_ADD_MEMORY 0x00001001
kernel // params: memory start, memory size, memory type, MBZ - KCO_CMD_ADD_VIRTUAL 0x00001003
kernel // params: virtual start, virtual size, virtual type, MBZ - KCO_CMD_ARCH_ALLOC_IOMAP 0x0A000001
- KCO_CMD_ARCH_ALLOC_IRQVECTOR 0x0A000003
arch // params: requested vector number (-1 means allocate first), number of vectors, vector TYPE, MBZ // TODO: refactor, make syscalls, add vector alignment (-1 only) - KCO_CMD_ARCH_FREE_IOMAP 0x0A000002
- KCO_CMD_ARCH_FREE_IRQVECTOR 0x0A000004
arch // params: vector, number of vectors, MBZ, MBZ // TODO: refactor - KCO_CMD_CHANGE_IRQ_NUMBER 0x00004006
ISR // params: new IRQ number, MBZ, MBZ, MBZ - KCO_CMD_CLEAR_KERNELTRACE 0x00001E04
kernel // params: MBZ, MBZ, MBZ, MBZ - KCO_CMD_CREATE_TASK_FOR 0x00001008
kernel // params: group handle, alternative parent task handle, priority spec, type spec // returns Handle - KCO_CMD_DISABLE_IRQ_EVENT 0x00004005
- KCO_CMD_DISABLE_ISR 0x00004003
ISR // params: MBZ, MBZ, MBZ, MBZ - KCO_CMD_DUMP_KERNELTRACE 0x00001E02
kernel // params: entry limit, flags (KCO_DKTF_*), type to filter, MBZ - KCO_CMD_EARLY_SERIAL_CLOSE 0x0E000003
kernel // params: MBZ, MBZ, MBZ, MBZ - KCO_CMD_EARLY_SERIAL_WRITEN 0x0E000002
kernel // params: num_chars+chars (host order), chars (host order), chars (host order), chars (host order) // union { char chars[sizeof(uintptr_t)]; uintptr_t data; } - KCO_CMD_EARLY_SERIAL_WRITEZ 0x0E000001
kernel // params: chars (host order), chars (host order), chars (host order), chars (host order) // union { char chars[sizeof(uintptr_t)]; uintptr_t data; } - KCO_CMD_ENABLE_IRQ_EVENT 0x00004004
- KCO_CMD_ENABLE_ISR 0x00004002
ISR // params: MBZ, MBZ, MBZ, MBZ - KCO_CMD_FLUSHD_INVI_VIRTUAL 0x00001007
kernel // params: address, size, MBZ, MBZ - KCO_CMD_FLUSH_VIRTUAL 0x00001005
kernel // params: address, size (max KST_FLUSHVIRTUALMAX), level, flags (MBZ) - KCO_CMD_INVALIDATE_VIRTUAL 0x00001006
kernel // params: address, size (max KST_INVALIDATEVIRTUALMAX), level, flags (MBZ) - KCO_CMD_MAKE_TASK_ZOMBIE 0x00005007
Task // params: MBZ, MBZ, MBZ, MBZ - KCO_CMD_NOTIFY_MEMO 0x00003001
Memo // params: sub-command (KCO_NMSC_*), offset, MBZ, MBZ - KCO_CMD_POP_COUNTERS 0x00001D02
kernel // params: MBZ, MBZ, MBZ, MBZ // pop the performance counters if enabled - KCO_CMD_PREFETCH_VIEW 0x00002001
params: address, flags (KCO_PVF_*), param (MBZ), MBZ // TODO: will be removed without notification - KCO_CMD_PUSH_COUNTERS 0x00001D01
kernel // params: MBZ, MBZ, MBZ, MBZ // push the performance counters if enabled - KCO_CMD_REMOVE_MEMORY 0x00001002
kernel // params: memory start, MBZ, MBZ, MBZ - KCO_CMD_REMOVE_VIRTUAL 0x00001004
kernel // params: virtual start, MBZ, MBZ, MBZ - KCO_CMD_RESUME_THREAD 0x00005004
- KCO_CMD_SELECT_READ_REGISTER 0x00005006
Thread // params: register id (KREG_*), context offset, octet offset, octet count - KCO_CMD_SELECT_REGISTER_INFO 0x00005005
Thread // params: register id (KREG_*), context offset, MBZ, MBZ - KCO_CMD_SET_ISR_AFFINITY 0x00004001
- KCO_CMD_SET_KERNELTRACE 0x00001E01
kernel // params: trace buffer size (0 will free the buffer), flags (KCO_SKTF_*), MBZ, MBZ - KCO_CMD_SET_TASK_GID 0x00005009
Task // params: new group ID, MBZ, MBZ, MBZ // only super task can do this - KCO_CMD_SET_TASK_GIDUID 0x0000500B
Task // params: new group ID, new user ID, MBZ, MBZ // only super task can do this - KCO_CMD_SET_TASK_GROUP 0x00005008
Task // params: handle of the new group, flags (KCO_STGF_*), MBZ, MBZ - KCO_CMD_SET_TASK_PROPERTY 0x00005001
Task // params: property (KCO_STKP_*), param, param, param - KCO_CMD_SET_TASK_UID 0x0000500A
Task // params: new user ID, MBZ, MBZ, MBZ // only super task can do this - KCO_CMD_SET_THREAD_PROPERTY 0x00005002
Thread // params: property (KCO_STHP_*), param, param, param - KCO_CMD_SUSPEND_THREAD 0x00005003
- KCO_CMD_TASK_SEAL_PGID 0x0000500D
Task // params: MBZ, MBZ, MBZ, MBZ // self only - KCO_CMD_TASK_SET_PGID 0x0000500C
Task // params: process group ID, MBZ, MBZ, MBZ // self or only super task can do this - KCO_DKTF_BEGINNING 0x00000001
dump the kernel trace from the beginning - KCO_DKTF_FILTERTYPE 0x00000004
enable type filtering mechanism - KCO_DKTF_OMITPARAMS 0x00000002
omit the parameters of the trace entries - KCO_NMSC_LOCK 0x00000002
set the page lock bit - KCO_NMSC_PURGE 0x00000003
purge the loaded page - KCO_NMSC_UNLOCK 0x00000001
clear the page lock bit - KCO_PVF_WAIT 0x00000001
wait for the previous operation to complete - KCO_SKTF_INACTIVE 0x00000002
start with inactive state - KCO_SKTF_MAIN 0x00000001
allocate the trace buffer in the main memory chunk - KCO_STGF_MATCHSESSION 0x00000001
the new task group must have the same session ID - KCO_STHP_PRIORITY 0x00000001
change the priority of the thread - KCO_STHP_STORE 0x00000002
overwrite the stored value in the thread - KCO_STKP_PRIORITY 0x00000001
change the priority of the task - KDATE_DAY(d) (((d)>>KDATE_DAY_SHIFT)
- KDATE_DAY_MASK 0x0000003f
- KDATE_DAY_SHIFT 0
- KDATE_MON(d) (((d)>>KDATE_MON_SHIFT)
- KDATE_MON_MASK 0x0000000f
- KDATE_MON_SHIFT 6
- KDATE_YEAR(d) (((d)>>KDATE_YEAR_SHIFT)
- KDATE_YEAR_MASK 0x003fffff
- KDATE(year,mon,day) (((year)<<KDATE_YEAR_SHIFT)
- KDATE_YEAR_SHIFT 10
- KERNEL_HANDLE (((Handle)0)-2)
kernel pseudo handle - KEVENT_EVENT_SET _MAKE_KEVENT(KWATCH_EVENT_SET)
- KEVENT_KERNEL_NEWTASK _MAKE_KEVENT(KWATCH_KERNEL_NEWTASK)
- KEVENT_KERNEL_TASKMETACHG _MAKE_KEVENT(KWATCH_KERNEL_TASKMETACHG)
- KEVENT_MEMO_DELCOPY _MAKE_KEVENT(KWATCH_MEMO_DELCOPY)
- KEVENT_MEMO_DELVIEW _MAKE_KEVENT(KWATCH_MEMO_DELVIEW)
- KEVENT_MEMO_NEWCOPY _MAKE_KEVENT(KWATCH_MEMO_NEWCOPY)
- KEVENT_MEMO_NEWVIEW _MAKE_KEVENT(KWATCH_MEMO_NEWVIEW)
- KEVENT_MSGPIPE_IMPLICITDEL _MAKE_KEVENT(0x1000)
fake watch ID above KWATCH_MASK - KEVENT_OBJ_DELETED _MAKE_KEVENT(KWATCH_OBJ_DELETED)
- KEVENT_OBJ_ERROR _MAKE_KEVENT(KWATCH_OBJ_ERROR)
- KEVENT_TASK_DELTHREAD _MAKE_KEVENT(KWATCH_TASK_DELTHREAD)
- KEVENT_TASK_NEWTHREAD _MAKE_KEVENT(KWATCH_TASK_NEWTHREAD)
- KPUBLICTAG 0x8000
tags with this bit are public, so they are accessable without permission - KREG_ARMV7_CPSR 0x0A320010
- KREG_ARMV7_LR 0x0A32000E
- KREG_ARMV7_PC 0x0A32000F
- KREG_ARMV7_R0 0x0A320000
APCS: a1 - KREG_ARMV7_R10 0x0A32000A
APCS: sl/v7 - KREG_ARMV7_R11 0x0A32000B
APCS: fp/v8 - KREG_ARMV7_R12 0x0A32000C
APCS: ip - KREG_ARMV7_R1 0x0A320001
APCS: a2 - KREG_ARMV7_R2 0x0A320002
APCS: a3 - KREG_ARMV7_R3 0x0A320003
APCS: a4 - KREG_ARMV7_R4 0x0A320004
APCS: v1 - KREG_ARMV7_R5 0x0A320005
APCS: v2 - KREG_ARMV7_R6 0x0A320006
APCS: v3 - KREG_ARMV7_R7 0x0A320007
APCS: v4 - KREG_ARMV7_R8 0x0A320008
APCS: v5 - KREG_ARMV7_R9 0x0A320009
APCS: sb/v6 - KREG_ARMV7_SP 0x0A32000D
- KREG_X86_64_CS 0x01640012
- KREG_X86_64_DS 0x01640014
- KREG_X86_64_ES 0x01640015
- KREG_X86_64_FS 0x01640016
- KREG_X86_64_GS 0x01640017
- KREG_X86_64_R10 0x0164000A
- KREG_X86_64_R11 0x0164000B
- KREG_X86_64_R12 0x0164000C
- KREG_X86_64_R13 0x0164000D
- KREG_X86_64_R14 0x0164000E
- KREG_X86_64_R15 0x0164000F
- KREG_X86_64_R8 0x01640008
- KREG_X86_64_R9 0x01640009
- KREG_X86_64_RAX 0x01640000
- KREG_X86_64_RBP 0x01640006
- KREG_X86_64_RBX 0x01640001
- KREG_X86_64_RCX 0x01640002
- KREG_X86_64_RDI 0x01640005
- KREG_X86_64_RDX 0x01640003
- KREG_X86_64_RFLAGS 0x01640011
- KREG_X86_64_RIP 0x01640010
- KREG_X86_64_RSI 0x01640004
- KREG_X86_64_RSP 0x01640007
- KREG_X86_64_SS 0x01640013
- KRF_READ 0x00000100
- KRF_WIDTH_MASK 0x000000FF
- KRF_WRITE 0x00000200
- KST_ARCHPRIVATE0 100
Arch // architecture private data 0 // not necessarily supported (refer to KST_NUMARCHPRIVATE) - KST_ARCHPRIVATE1 101
Arch // architecture private data 1 // not necessarily supported (refer to KST_NUMARCHPRIVATE) - KST_ARCHPRIVATE2 102
Arch // architecture private data 2 // not necessarily supported (refer to KST_NUMARCHPRIVATE) - KST_ARCHPRIVATE3 103
Arch // architecture private data 3 // not necessarily supported (refer to KST_NUMARCHPRIVATE) - KST_ARCHPRIVATE4 104
Arch // architecture private data 4 // not necessarily supported (refer to KST_NUMARCHPRIVATE) - KST_ARCHPRIVATE5 105
Arch // architecture private data 5 // not necessarily supported (refer to KST_NUMARCHPRIVATE) - KST_ARCHPRIVATE6 106
Arch // architecture private data 6 // not necessarily supported (refer to KST_NUMARCHPRIVATE) - KST_ARCHPRIVATE7 107
Arch // architecture private data 7 // not necessarily supported (refer to KST_NUMARCHPRIVATE) - _KST_COUNTER_BASE 0x1000
RdOnly // performance counter base - KST_CPUCOUNT 26
RdOnly // number of CPUs (cores) - KST_CURRENTTASK 2
RdOnly // currently running task - KST_CURRENTTHREAD 1
RdOnly // currently running thread - KST_DATETIME64 0x64000007
Arch // 64-bit only // date and time (bits: <date> <time>) // TODO: remove - KST_DATE 5
Arch // date (bits: YYYYYYYY YYYYYYYY YYYYYYMM MMDDDDDD) // TODO: remove - KST_DEBUGCONSOLE 0xDDEEBBCC
Build // enters to the FaultMonitor if set - KST_DEBUGSHOWSTR 0xDDEEBB67
Build // prints a string (passed as an integer) using the DebugPrint // suggest to use: union { char c[sizeof(uintptr_t)]; uintptr_t i; }; - KST_DEBUGSHOW 0xDDEEBB66
Build // prints a single integer using the DebugPrint - KST_DEBUGSTORE0 190
Build // debug store data 0 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DEBUGSTORE1 191
Build // debug store data 1 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DEBUGSTORE2 192
Build // debug store data 2 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DEBUGSTORE3 193
Build // debug store data 3 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DEBUGSTORE4 194
Build // debug store data 4 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DEBUGSTORE5 195
Build // debug store data 5 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DEBUGSTORE6 196
Build // debug store data 6 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DEBUGSTORE7 197
Build // debug store data 7 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DEBUGSTORE8 198
Build // debug store data 8 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DEBUGSTORE9 199
Build // debug store data 9 // not necessarily supported (refer to KST_NUMDEBUGSTORE) - KST_DUMP_COUNTERS 1100
Build - KST_FLUSHVIRTUALMAX 18
RdOnly // maximal size of the flush virtual - KST_HANDLEMANAGER 20
RdOnly // handle manager state (non-zero if enabled) - KST_INVALIDATEVIRTUALMAX 19
RdOnly // maximal size of the invalidate virtual - KST_ISRCOUNT 25
RdOnly // number of ISR channels - KST_KERNELTRACEACTIVE 28
RdOnly // kernel trace is active (can be inactivated runtime) - KST_KERNELTRACEENABLED 27
RdOnly // retrieves whether the kernel trace is enabled or not - KST_MAINCHUNKFREE 23
RdOnly // free space in the main memory chunk (pages) - KST_MAINCHUNKTOTAL 22
RdOnly // total size of the main memory chunk (pages) - KST_MAXREGISTERWIDTH 29
RdOnly // width of the widest register in octets supported by the kernel - KST_MEMAVAIL 11
RdOnly // number of available memory pages - KST_MEMTOTAL 12
RdOnly // total number of memory pages installed in the system - KST_MMFREECOUNT 34
RdOnly // number of cached free TLB page nodes - KST_MMLEAFBUDGET 33
RdOnly // number of pages available for TLB page nodes - KST_NOW64 0x64000005
RdOnly // 64-bit only // tick count - KST_NOWHI 4
RdOnly // tick count (upper 32 bits) - KST_NOWLO 3
RdOnly // tick count (lower 32 bits) - KST_NUMARCHPRIVATE 24
RdOnly // number of arch private states (KST_ARCHPRIVATE<n>) - KST_NUMDEBUGSTORE 31
RdOnly // number of debug stores (KST_DEBUGSTORE<n>) - KST_NUMHANDLES 21
RdOnly // total number of handles - KST_PAGESIZE 8
RdOnly // pagesize in octets (bytes) - KST_RANDOM 15
RdOnly // current random value - KST_REGISTRY 9
WrOnce // MsgPort of the registry - KST_SLABDEBUG 1017
Build - KST_SLABPEAK 17
Build // maximal number of used slabs - KST_SLABUSED 16
Build // total number of used slabs - KST_STACKGUARD 0x9000
Build // stack guard cime (only in M3 or similar; debug only) - KST_SYSTEMSERVICE 10
WrOnce // MsgPort of the system service - KST_TICKSPERSECOND 32
RdOnly // number of ticks (i.e. in task's ExeTime) per second - KST_TIME 6
Arch // time (bits: HHHHHHHH MMMMMMMM SSSSSSMM MMMMMMMM) // TODO: remove - KST_TIMEZONE 7
Arch // time zone in minutes // TODO: remove - KST_VIRTAVAIL 13
RdOnly // number of available virtual space pages - KST_VIRTTOTAL 14
RdOnly // total number of virtual space pages installed in the system - KST_VIRTUALALLOCSUPPORTED 30
RdOnly // test whether the VirtualAlloc system call is supported - KSYSIDX_KERNELSTATUS_HM_ACURRENT 0x00100007
currently allocating handles from this table - KSYSIDX_KERNELSTATUS_HM_AFIRST 0x00100008
first table index - KSYSIDX_KERNELSTATUS_HM_COUNT 0x00100001
number of currently used handles - KSYSIDX_KERNELSTATUS_HM_ENABLED 0x00100000
Handle Manager is enabled or not - KSYSIDX_KERNELSTATUS_HM_HANDLESPERPAGE 0x00100009
number of handles per page (handle table) - KSYSIDX_KERNELSTATUS_HM_INDEXBITS 0x00100004
number of bits used for index - KSYSIDX_KERNELSTATUS_HM_MASTERHANDLES 0x00100002
number of master handles - KSYSIDX_KERNELSTATUS_HM_MAXCOUNT 0x00100003
maximal number of handles - KSYSIDX_KERNELSTATUS_HM_PAGECOUNT 0x00100006
number of pages allocated for the handle tables - KSYSIDX_KERNELSTATUS_HM_ROOTPAGES 0x00100005
number of pages allocated for the root - KSYSIDX_KERNELTRACEINFO_BASE 1
base address of the trace buffers (use only for low-level debugging) - KSYSIDX_KERNELTRACEINFO_CURRENTBUFFER 6
index of the current buffer - KSYSIDX_KERNELTRACEINFO_MAXWORDS 7
maximal number of words per entry (including the entry header) - KSYSIDX_KERNELTRACEINFO_NUMBUFFERS 4
number of buffers - KSYSIDX_KERNELTRACEINFO_NUMWORDS 3
size of the whole trace buffer in words - KSYSIDX_KERNELTRACEINFO_SIZE 2
size of the whole trace buffer in octets (all buffers) - KSYSIDX_KERNELTRACEINFO_WORDSPERBUFFER 5
number of words per buffer - KSYSIDX_KERNELVERINFO_MACHINELENGTH 3
get the length of the kernel machine string in characters (4 or 8 characters per uintptr_t) - KSYSIDX_KERNELVERINFO_RELEASELENGTH 1
get the length of the kernel release string in characters (4 or 8 characters per uintptr_t) - KSYSIDX_KERNELVERINFO_VERSIONLENGTH 2
get the length of the kernel version string in characters (4 or 8 characters per uintptr_t) - KSYSIDX_REGISTERDATA_NAME(regidx,stride) ((regidx)*(stride)+2)
first word of the name - KSYSIDX_REGISTERDATA_TAG(regidx,stride) ((regidx)*(stride)+0)
- KSYSIDX_REGISTERDATA_TYPE(regidx,stride) ((regidx)*(stride)+1)
- KSYSIDX_REGISTERINFO_COUNT 1
get the number of registers stored in the register data array - KSYSIDX_REGISTERINFO_MAXNAMELEN 3
get the maximal length of the names in characters (some names might be shorter than this value) - KSYSIDX_REGISTERINFO_MAXWIDTH 4
get the maximal register width (some registers might be narrower than this value) - KSYSIDX_REGISTERINFO_STRIDE 2
get the stride size (number of uintptr_t per register) - KSYSTAG_ARCHDATA 0x5700A002
archictecture dependent data - KSYSTAG_ARCHINFO 0x5700A001
archictecture dependent info - KSYSTAG_KERNELMACHINE 0x57002003
get kernel machine string - KSYSTAG_KERNELRELEASE 0x57002001
get kernel release string - KSYSTAG_KERNELSTATUS 0x57002004
get extended kernel status (KSYSIDX_KERNELSTATUS_*) - KSYSTAG_KERNELTRACEABSDATA 0x57001002
get kernel trace data as is - KSYSTAG_KERNELTRACEINFO 0x57001001
get kernel trace info (KSYSIDX_KERNELTRACEINFO_*) - KSYSTAG_KERNELTRACERELDATA 0x57001003
get kernel trace data, but relative to the current buffer - KSYSTAG_KERNELVERINFO 0x57002000
get kernel version info (KSYSIDX_KERNELVERINFO_*) - KSYSTAG_KERNELVERSION 0x57002002
get kernel version string - KSYSTAG_REGISTERDATA 0x57002E01
register data array - KSYSTAG_REGISTERINFO 0x57002E00
get register data info - KTAGBOUNDARY_COMMONTAGS 0x0040
all tags below this value are accessable without permission - KTAG_EVENT_FLAGS 0x0C01
- KTAG_EVENT_LASTMSG1 0x0C02
- KTAG_EVENT_LASTMSG2 0x0C03
- KTAG_EVENT_SET 0x0C04
- KTAG_GROUP_LEADER (KPUBLICTAG|0x0E01)
- KTAG_GROUP_SESSION (KPUBLICTAG|0x0E02)
- KTAG_GROUP_TYPE 0x0E03
- KTAG_GSTATE 0x0002
global object state (TODO: obsolete, will be removed without notice) - KTAG_ISR_DATA 0x0D02
- KTAG_ISR_HANDLER 0x0D01
- KTAG_ISR_ISRTIMEHI 0x0D0C
- KTAG_ISR_ISRTIMELO 0x0D0D
- KTAG_ISR_NUMBER 0x0D04
- KTAG_ISR_PFNUMHI 0x0D0A
- KTAG_ISR_PFNUMLO 0x0D0B
- KTAG_ISR_PRIORITY 0x0D05
- KTAG_ISR_RUNNUMHI 0x0D06
- KTAG_ISR_RUNNUMLO 0x0D07
- KTAG_ISR_STACK 0x0D03
- KTAG_ISR_SYSCALLCNTHI 0x0D08
- KTAG_ISR_SYSCALLCNTLO 0x0D09
- KTAG_ISR_SYSTIMEHI 0x0D0E
- KTAG_ISR_SYSTIMELO 0x0D0F
- KTAG_ITER_ENDED 0x0B01
- KTAG_ITER_SUBJECT 0x0B02
- KTAG_MASTER 0x0006
tag of the master handle - KTAG_MEMO_ALLOCATED 0x0102
number of allocated pages - KTAG_MEMO_COPIES 0x0104
number of copies - KTAG_MEMO_DELETED 0x0105
lazily deleted, if non-zero no further views/copies can be allocated - KTAG_MEMO_EXCOUNT 0x010D
number of exceptions handled so far - KTAG_MEMO_EXDATA 0x010C
private data of the exception handler - KTAG_MEMO_EXFUNC 0x010B
exception handler function - KTAG_MEMO_FIX 0x0107
base address of the continuous memory (MEMO_CR_FIX only) - KTAG_MEMO_HWREG 0x0106
hardware register memory address (MEMO_CR_HWREG only) - KTAG_MEMO_PAGESIZE 0x0109
size of one page - KTAG_MEMO_PARENT 0x010A
parent memory object of this memory object (copy only) - KTAG_MEMO_SIZE 0x0101
size of the memory object in pages - KTAG_MEMO_TYPE 0x0108
memory object type (MEMO_CR_*) - KTAG_MEMO_VIEWS 0x0103
number of views - KTAG_MSGPIPE_FLAGS 0x0803
- KTAG_MSGPIPE_FROM 0x0802
- KTAG_MSGPIPE_TO 0x0801
- KTAG_MSGPORT_CAPACITY 0x0502
- KTAG_MSGPORT_COUNT 0x0501
- KTAG_MSGPORT_EVENTERRORS 0x0503
- KTAG_MSGPORT_FLAGS 0x0507
- KTAG_MSGPORT_NUMMSGPIPEIN 0x0508
number of MsgPipes brings messages to this MsgPort - KTAG_MSGPORT_NUMMSGPIPEOUT 0x0506
number of MsgPipes takes messages away from this MsgPort - KTAG_MSGPORT_NUMSIGMSG 0x0509
number of SignalMsgs connected to this MsgPort - KTAG_MSGPORT_POINTER 0x0505
- KTAG_MSGPORT_RECVWAIT 0x0504
- KTAG_OSTATE 0x0003
local object state (TKS_* for tasks, THS_* for threads, ISRS_* for ISRs, etc) - KTAG_OWNER 0x0004
owner of the object (usually a task) - KTAG_SELF 0x0005
applicable handle if any; master handle otherwise - KTAG_SEMA_COUNT 0x0701
- KTAG_SEMA_MAXVAL 0x0702
- KTAG_SIGNALMSG_COUNT 0x0906
- KTAG_SIGNALMSG_INSERTED 0x0907
- KTAG_SIGNALMSG_MESSAGE1 0x0903
- KTAG_SIGNALMSG_MESSAGE2 0x0904
- KTAG_SIGNALMSG_MSENDER 0x0905
- KTAG_SIGNALMSG_MSGPORT 0x0901
- KTAG_SIGNALMSG_TYPE 0x0902
- KTAG_SYSMEM_BASE 0x5003
- KTAG_SYSMEM_END 0x5002
- KTAG_SYSMEM_NUMFREE 0x5006
- KTAG_SYSMEM_SIZE 0x5004
- KTAG_SYSMEM_START 0x5001
- KTAG_SYSMEM_TYPE 0x5005
- KTAG_SYSVIRT_BEGIN 0x5101
- KTAG_SYSVIRT_GLOBAL 0x5104
- KTAG_SYSVIRT_SIZE 0x5102
- KTAG_SYSVIRT_TYPE 0x5103
- KTAG_TASK_AFFINITY 0x047E
- KTAG_TASK_CREATETICKHI 0x0424
- KTAG_TASK_CREATETICKLO 0x0423
- KTAG_TASK_DEFPRIOR 0x0402
- KTAG_TASK_EXCOUNT 0x0418
- KTAG_TASK_EXETIMEHI 0x0406
- KTAG_TASK_EXETIMELO 0x0407
- KTAG_TASK_EXSYSDATA 0x0415
- KTAG_TASK_EXSYSFUNC 0x0414
- KTAG_TASK_EXUSRDATA 0x0417
- KTAG_TASK_EXUSRFUNC 0x0416
- KTAG_TASK_GID (KPUBLICTAG|0x041E)
- KTAG_TASK_GIDUID (KPUBLICTAG|0x0420)
get both GID and UID in a single operation (TASK_GIDUID_GID, TASK_GIDUID_UID) - KTAG_TASK_GROUP (KPUBLICTAG|0x041D)
- KTAG_TASK_HWPROCID 0x0409
- KTAG_TASK_ISRTIMEHI 0x040C
- KTAG_TASK_ISRTIMELO 0x040D
- KTAG_TASK_MEMALLOC 0x0404
- KTAG_TASK_MEMOS 0x040B
- KTAG_TASK_MEMRESD 0x0403
- KTAG_TASK_NUMINVCTXSWHI 0x0428
number of involuntary context switches (upper 32 bits) - KTAG_TASK_NUMINVCTXSWLO 0x0427
number of involuntary context switches (lower 32 bits) - KTAG_TASK_NUMVOLCTXSWHI 0x0426
number of voluntary context switches (upper 32 bits) - KTAG_TASK_NUMVOLCTXSWLO 0x0425
number of voluntary context switches (lower 32 bits) - KTAG_TASK_PARENT (KPUBLICTAG|0x0422)
master handle of the creator task - KTAG_TASK_PFNUMHI 0x0412
- KTAG_TASK_PFNUMLO 0x0413
- KTAG_TASK_PGID (KPUBLICTAG|0x0421)
- KTAG_TASK_PRIORITY 0x0401
- KTAG_TASK_SLABPEAK 0x0411
- KTAG_TASK_SLABUSED 0x0410
- KTAG_TASK_SUSPENDABLE 0x047F
- KTAG_TASK_SYSCALLSHI 0x041C
- KTAG_TASK_SYSCALLSLO 0x041B
- KTAG_TASK_SYSTIMEHI 0x041A
- KTAG_TASK_SYSTIMELO 0x0419
- KTAG_TASK_THREADS 0x040A
- KTAG_TASK_TYPE 0x0408
- KTAG_TASK_UID (KPUBLICTAG|0x041F)
- KTAG_TASK_VIRTTOTAL 0x0405
- KTAG_THREAD_ACCREG 0x030F
- KTAG_THREAD_AFFINITY 0x0370
- KTAG_THREAD_CTXDEPTH 0x030C
- KTAG_THREAD_DEFPRIOR 0x0302
- KTAG_THREAD_EXCOUNT 0x030D
- KTAG_THREAD_EXETIME64 0x030B
- KTAG_THREAD_EXETIMEHI 0x0304
- KTAG_THREAD_EXETIMELO 0x0305
- KTAG_THREAD_LASTERROR 0x0303
- KTAG_THREAD_LOCALSTORE 0x030E
- KTAG_THREAD_NUMINVCTXSWHI 0x031A
number of involuntary context switches (upper 32 bits) - KTAG_THREAD_NUMINVCTXSWLO 0x0319
number of involuntary context switches (lower 32 bits) - KTAG_THREAD_NUMVOLCTXSWHI 0x0318
number of voluntary context switches (upper 32 bits) - KTAG_THREAD_NUMVOLCTXSWLO 0x0317
number of voluntary context switches (lower 32 bits) - KTAG_THREAD_PC 0x030A
- KTAG_THREAD_PFNUMHI 0x0313
- KTAG_THREAD_PFNUMLO 0x0314
- KTAG_THREAD_PRIORITY 0x0301
- KTAG_THREAD_RUNNUMHI 0x0308
- KTAG_THREAD_RUNNUMLO 0x0309
- KTAG_THREAD_STACKPTR 0x0310
- KTAG_THREAD_SUSPENDABLE 0x0371
- KTAG_THREAD_SYSCALLCNTHI 0x0315
- KTAG_THREAD_SYSCALLCNTLO 0x0316
- KTAG_THREAD_SYSTIMEHI 0x0306
- KTAG_THREAD_SYSTIMELO 0x0307
- KTAG_THREAD_WAITONMSTR 0x0312
same as KTAG_THREAD_WAITON, but returns always master handle - KTAG_THREAD_WAITON 0x0311
retrieve a (if possible) usable object handle on the thread (its top-level context) is waiting on (returns INVALID_HANDLE if the object is not waiting) - KTAG_TIMEROBJ_ACTIVE 0x0607
the 'active' status of the TimerObj - KTAG_TIMEROBJ_BEGINTICKHI 0x060B
tick number when the timer was last started (upper half) - KTAG_TIMEROBJ_BEGINTICKLO 0x060A
tick number when the timer was last started (lower half) - KTAG_TIMEROBJ_EXPIREIN 0x0609
compute the number of ticks remaining until the expiration (returns zero if the timer is not active) - KTAG_TIMEROBJ_FLAGS 0x0605
flags saved during TimerObj creation - KTAG_TIMEROBJ_MESSAGE1 0x0602
- KTAG_TIMEROBJ_MESSAGE2 0x0603
- KTAG_TIMEROBJ_MINTIMEOUT 0x0608
minimal timeout value per TimerObj instance (lower values cannot be set) - KTAG_TIMEROBJ_MSGPORT 0x0601
get the target MsgPort (if TIMEROBJ_CR_EXCEPTION is not set); might return INVALID_HANDLE - KTAG_TIMEROBJ_PENDING 0x0606
number of messages/exceptions are scheduled to be delivered - KTAG_TIMEROBJ_TIMEOUT 0x0604
current timeout value (can return zero and numbers greater or equal to the value returned by KTAG_TIMEROBJ_MINTIMEOUT) - KTAG_TYPE 0x0001
object type (TYPE_*) - KTAG_VIEW_ADDR 0x0202
start address of the view (in the owners virtual space) - KTAG_VIEW_FIXADDRDELTA 0x0208
- KTAG_VIEW_FLAGS 0x0209
view creation flags - KTAG_VIEW_ISLASTSHM 0x0207
indicates whether the view is the last shared memory - KTAG_VIEW_MEMO 0x0206
memory object the view maps - KTAG_VIEW_OFFS 0x0203
view allocation offset based to the original memo - KTAG_VIEW_PAGESIZE 0x020A
page size in octets - KTAG_VIEW_SHMADDR 0x0205
address of the shared memory - KTAG_VIEW_SHMSIZE 0x0204
size of the shared memory - KTAG_VIEW_SIZE 0x0201
size of the view in pages - KTAG_WATCH_DELETED 0x0A03
- KTAG_WATCH_INSERTED 0x0A02
- KTAG_WATCH_MSGPORT 0x0A04
- KTAG_WATCH_WATCHEDOBJ 0x0A01
- KTIME_HOUR_MASK 0x000000ff
- KTIME(hour,min,sec,msec) (((hour)<<KTIME_HOUR_SHIFT)
- KTIME_HOUR_SHIFT 24
- KTIME_HOUR(t) (((t)>>KTIME_HOUR_SHIFT)
- KTIME_MIN_MASK 0x000000ff
- KTIME_MIN_SHIFT 16
- KTIME_MIN(t) (((t)>>KTIME_MIN_SHIFT)
- KTIME_MSEC_MASK 0x000003ff
- KTIME_MSEC_SHIFT 0
- KTIME_MSEC(t) (((t)>>KTIME_MSEC_SHIFT)
- KTIME_SEC_MASK 0x0000003f
- KTIME_SEC_SHIFT 10
- KTIME_SEC(t) (((t)>>KTIME_SEC_SHIFT)
- KTRACE_BUFHEADER_SIZE 3
- KTRACE_FREEWORDS_IDX 1
- KTRACE_GET_PREVSIZE(_header_) (((_header_)>>KTRACE_SHIFT_PREVSIZE)&0xFF)
- KTRACE_GET_SIZE(_header_) (((_header_)>>KTRACE_SHIFT_SIZE)&0xFF)
- KTRACE_GET_TYPE(_header_) (((_header_)>>KTRACE_SHIFT_TYPE)&0xFF)
- KTRACE_GET_USER(_header_) (((_header_)>>KTRACE_SHIFT_USER)&0xFF)
- KTRACE_LASTENTRY_IDX 2
- KTRACE_MAKE_HEADER(_type_,_user_,_size_,_prev_size_) (...
- KTRACE_NUMENTRIES_IDX 0
- KTRACE_SHIFT_PREVSIZE 24
- KTRACE_SHIFT_SIZE 16
- KTRACE_SHIFT_TYPE 0
- KTRACE_SHIFT_USER 8
- KTRACE_TYPE_SYSCALL 0x5C
system call trace type - KWATCH_EVENT_SET 0x0A
the watched event was set - KWATCH_KERNEL_NEWTASK 0x03
special, msg2 will hold the master handle of the new task - KWATCH_KERNEL_TASKMETACHG 0x0B
special, msg2 will hold the master handle of the task that changed its group/PGID - KWATCH_MASK 0xFF
watch ID mask (8 bits) - KWATCH_MEMO_DELCOPY 0x07
a copy was deleted - KWATCH_MEMO_DELVIEW 0x05
a view was deleted - KWATCH_MEMO_NEWCOPY 0x06
a new copy was allocated to the memo - KWATCH_MEMO_NEWVIEW 0x04
a new view was allocated to the memo - KWATCH_OBJ_DELETED 0x01
the watched object has been deleted - KWATCH_OBJ_ERROR 0x02
the watched object entered an error state - KWATCH_TASK_DELTHREAD 0x09
a thread was deleted from the watch task - KWATCH_TASK_NEWTHREAD 0x08
a new thread was created in the watch task - _MAKE_KEVENT(_watch_id_) (0x0AE00000|(_watch_id_))
create a KEVENT from watch ID - MAVM_EXEC 3
- MAVM_READ 1
- MAVM_WRITE 2
- MAX_DELAY 0x7FFFFFFF
maximal delay value for all wait functions - MEM_AVAIL 0x00010000
add the memory to the allocatable memory - MEM_BACKWARD 0x08000000
- MEM_NOALLOC 0x00080000
the memory region is not allocatable (invalid with MEM_AVAIL) - MEMO_CR_FIX 0x00020000
create a fix sized memo - MEMO_CR_HWREG 0x00010000
create memo for hardware register - MEMO_CR_TYPE0 0x00040000
if set, allocator may use type#0 memories when not enough space in requested type - MEMO_DEL_DELAY 0x00010000
mark as deleted, but delete when last view freed - MEMO_DEL_FORCE 0x00020000
delete all involved views - MEM_PDINBASE 0x00040000
allocate page descriptors from the main memory - MEM_PDTOEND 0x00020000
allocate page descriptors at the end of its memory (at the beginning otherwise) - MEM_TYPEMASK 0x000000fe
type mask - MP_BLOCKING (-1)
- MPIPST_INVALID 3
invalid Message Pipe state (source and/or destination MsgPort was deleted) - MPIPST_RECVING 1
the Message Pipe is in receiving state (forwarded all messages) - MPIPST_SENDING 2
the Message Pipe is in sending state (forwarding messages to destination, but it is full) - MP_NOW 0
- MSGP_CR_NOMFROM 0x00000002
the MsgPort cannot be the 'from' parameter of a MsgPipe - MSGP_CR_NOMTO 0x00000001
the MsgPort cannot be the 'to' parameter of a MsgPipe - MSGP_CR_OWNERMFROM 0x00000008
the MsgPort can be the 'from' parameter only of a MsgPipe with the same owner - MSGP_CR_OWNERMTO 0x00000004
the MsgPort can be the 'to' parameter only of a MsgPipe with the same owner - MSGP_CR_OWNERSEND 0x00000010
only the MsgPort owner task can send messages - MSGPIPE_CR_FIXSENDER 0x00000001
the message pipe will replace the sender - NEXT_ISR_CHAIN 1
proceed to the next ISR handler - NUM_EXID_SYS 14
- PERM_ALL_ALL (PERM_ALL_TASK|PERM_ALL_OTHER)
- PERM_ALL_OTHER (PERM_OTHER_INFO|PERM_OTHER_ITERATE|PERM_OTHER_ACCESS|PERM_OTHER_MODIFY|PERM_OTHER_CONTROL|PERM_OTHER_DELETE)
- PERM_ALL_TASK (PERM_TASK_INFO|PERM_TASK_ITERATE|PERM_TASK_ACCESS|PERM_TASK_MODIFY|PERM_TASK_CONTROL|PERM_TASK_DELETE)
- PERMBIT_ACCESS 0x000004
- PERMBIT_CONTROL 0x000010
- PERMBIT_DELETE 0x000020
- PERMBIT_INFO 0x000001
- PERMBIT_ITERATE 0x000002
- PERMBIT_MODIFY 0x000008
- PERMMASK_ALL 0x00003f
- PERM_OTHER_ACCESS (PERMBIT_ACCESS<<_PERM_SHIFT_OTHER)
- PERM_OTHER_CONTROL (PERMBIT_CONTROL<<_PERM_SHIFT_OTHER)
- PERM_OTHER_DELETE (PERMBIT_DELETE<<_PERM_SHIFT_OTHER)
- PERM_OTHER_INFO (PERMBIT_INFO<<_PERM_SHIFT_OTHER)
- PERM_OTHER_ITERATE (PERMBIT_ITERATE<<_PERM_SHIFT_OTHER)
- PERM_OTHER_MODIFY (PERMBIT_MODIFY<<_PERM_SHIFT_OTHER)
- _PERM_SHIFT_OTHER 16
- _PERM_SHIFT_TASK 0
- PERM_TASK_ACCESS (PERMBIT_ACCESS<<_PERM_SHIFT_TASK)
- PERM_TASK_CONTROL (PERMBIT_CONTROL<<_PERM_SHIFT_TASK)
- PERM_TASK_DELETE (PERMBIT_DELETE<<_PERM_SHIFT_TASK)
- PERM_TASK_INFO (PERMBIT_INFO<<_PERM_SHIFT_TASK)
- PERM_TASK_ITERATE (PERMBIT_ITERATE<<_PERM_SHIFT_TASK)
- PERM_TASK_MODIFY (PERMBIT_MODIFY<<_PERM_SHIFT_TASK)
- PF_KRNL 0x10000000
page is used by kernel - PF_LOCK 0x08000000
page is locked (will not be mapped unless VIEW_CR_FORCEACCESS is specified) - PF_MAIN 0x40000000
alloc page in main memory - PF_RESERVED 0x00000001
don't use/test this bit (for internal use only) - PF_TYPE0 0x80000000
if set, allocator may use type#0 memories when not enough space in requested type - PF_USER 0x20000000
page is used by user (memo) - RUN_PRIVILEGED 0x80000000
privileged bit - SEMA_BLOCKING (-1)
- SEMA_NOW 0
- SIGMSG_CR_ALWAYSDELIVER 0x00000010
deliver all remaining messages after SignalMsg is deleted (cannot be combined with SIGMSG_CR_WAITFORRESET) - SIGMSG_CR_IGNOREMULTIRESET 0x00000008
do not report errors the already reseted and ResetSignalMsg() called - SIGMSG_CR_IGNOREUNTILRESET 0x00000004
ignore further sends when waiting for the ResetSignalMsg() call - SIGMSG_CR_UNRESETED 0x00000002
created SignalMsg needs a ResetSignalMsg() call - SIGMSG_CR_WAITFORRESET 0x00000001
after send wait for the ResetSignalMsg() call (cannot be combined with SIGMSG_CR_ALWAYSDELIVER) - SMS_NORMAL 0
the message is ready to send - SMS_WAITRESET 1
actually waiting for a ResetSignalMsg() call - STOREID_MAX STOREID_RES4
the largest preallocated (reserved) store ID - STOREID_RES1 1
- STOREID_RES2 2
- STOREID_RES3 3
- STOREID_RES4 4
- STORE_NOGET 0x00000002
the value cannot be read - STORE_NOREMOVE 0x00000004
the value cannot be removed - STORE_NOSET 0x00000001
the value cannot be modified - TASK_CR_IDLE 0x00000800
can be set if the task owns TASK_FL_INIT or TASK_CR_IDLE (TASK_CR_KERNEL will be set implicitly) - TASK_CR_KERNEL 0x00000400
kernel internal task (i.e. idle task), this flag can be inherited if set for the new task - TASK_CR_SETPGID 0x00000200
set PGID in the new task to the master handle of the new task - TASK_CR_SUPER 0x00000100
super task (privileged task) - TASK_FL_INIT 0x40000000
special kernel task: this is the one and only init task (however, it will be deleted shortly) - TASK_FL_SEALPGID 0x01000000
PGID is sealed - TASK_GID_MAX 0xFFFF
maximal value of a group ID (must be a power of two minus one) - TASK_GIDUID_GID(_giduid_) (TASK_GID_MAX&((_giduid_)>>TASK_GIDUID_GID_SHIFT))
decompose group ID from GIDUID - TASK_GIDUID_GID_SHIFT 16
shift value for the group ID - TASK_GIDUID_MAKE(_gid_,_uid_) (((((uint32_t)(_gid_))&TASK_GID_MAX)<<TASK_GIDUID_GID_SHIFT)|((((uint32_t)(_uid_))&TASK_UID_MAX)<<TASK_GIDUID_UID_SHIFT))
compose a GIDUID from group ID and user ID - TASK_GIDUID_UID(_giduid_) (TASK_UID_MAX&((_giduid_)>>TASK_GIDUID_UID_SHIFT))
decompose user ID from GIDUID - TASK_GIDUID_UID_SHIFT 0
shift value for the user ID - TASK_MAX_PRIOR 31
- TASK_MIN_PRIOR 0
- TASK_NUM_PRIOR 32
- TASK_UID_MAX 0xFFFF
maximal value of a user ID (must be a power of two minus one) - THREAD_MAX_PRIOR 0xff
- THREAD_MIN_PRIOR 0
- THREAD_NUM_PRIOR 0x100
- THS_BLOCKED 3
waiting for a resource with infinite timeout - THS_NOWHERE 4
unlinked from all schedulable lists - THS_READY 1
thread is ready to run - THS_RUN 0
thread is currently running - THS_WAIT 2
waiting for a resource with definite timeout - TIMEROBJ_CR_AUTOREWIND 0x00002000
if the timer expired (the tick is sent), restart the timer automatically - TIMEROBJ_CR_AUTOSTART 0x00001000
start the timer right after the creation - TIMEROBJ_CR_CONTINUEACTIVE 0x00008000
in case of restart and if already running, but no TIMEROBJ_CR_STOPONREWIND, then no error will be reported - TIMEROBJ_CR_ERRORDEACTIVATE 0x00040000
delivery error deactivates the timer (i.e. MsgPort is full or exception cannot be raised) - TIMEROBJ_CR_EXCEPTION 0x00010000
send an exception (ID will be 'msg1') to the owner instead of sending a message (the 'msgport' and 'msg2' arguments in CreateTimerObj must be zero) - TIMEROBJ_CR_REWINDUPDATE 0x00080000
always update the timeout in RewindTimerObj (especially if TIMEROBJ_CR_CONTINUEACTIVE is set) - TIMEROBJ_CR_STOPONREWIND 0x00004000
if the user restarts the timer, then the timer will be stopped (running timer cannot be started) - TIMEROBJ_CR_USEREXCPARAM 0x00020000
send the exception with user exception parameter ('msg2' in CreateTimerObj; this overrides the "msg2 must be zero" requirement) - TIMEROBJ_REWIND_INTERVAL 0x00000002
modify the timer to an interval timer (set TIMEROBJ_CR_AUTOREWIND flag); must not be used with TIMEROBJ_REWIND_ONESHOT - TIMEROBJ_REWIND_KEEP 0x00000000
keep all flags/mode as is - TIMEROBJ_REWIND_ONESHOT 0x00000001
modify the timer to a one-shot timer (clear TIMEROBJ_CR_AUTOREWIND flag); must not be used with TIMEROBJ_REWIND_INTERVAL - TKS_BLOCKED 2
blocked (all threads are blocked or waiting) - TKS_DELETED 3
task is under deletion - TKS_READY 1
task that ready to run (will be scheduled) - TKS_RUN 0
currently running task - TKS_ZOMBIE 4
task is died (will be deleted ASAP), but all allocated resources are still available (no thread of this task will be scheduled anymore) - TYPE_CONTEXT 0x13
- TYPE_EVENT 0x8E
- TYPE_GROUP 0x16
- TYPE_ISR 0x68
- TYPE_ITER 0x50
- TYPE_MEMO 0x20
- TYPE_MSGPIPE 0x72
- TYPE_MSGPORT 0x70
- TYPE_SEMA 0x80
- TYPE_SIGMSG 0x74
- TYPE_SYSMEM 0xE0
- TYPE_SYSVIRT 0xE1
- TYPE_TASK 0x11
- TYPE_THREAD 0x12
- TYPE_TIMEROBJ 0x90
- TYPE_VIEW 0x21
- TYPE_WATCH 0x7A
- VIEW_AA_G 0x00008000
Access Attribute: Guarded - VIEW_AA_I 0x00002000
Access Attribute: Cache-Inhibited (if not set: cacheable) - VIEW_AA_M 0x00004000
Access Attribute: Cache coherent - VIEW_AA_NR 0x00000100
Access Attribute: Non-Readable - VIEW_AA_NW 0x00000200
Access Attribute: Non-Writeable - VIEW_AA_NX 0x00000400
Access Attribute: Non-eXecutable - VIEW_AA_W 0x00001000
Access Attribute: Write-through (if not set: write-back) - VIEW_CR_FORCEACCESS 0x00020000
Force access (ignore page lock bit) - VIEW_CR_SHARED 0x00010000
Create a shared view (from scratch or reuse an existing one) - WATCH_CR_MASTER 0x10000
the master handle will be sent in the message instead of the specified handle - WATCHSLOT_CAPACITY 8
capacity of a watch slot
System call index
- AllocStoreId
- AllocView
- BeginIterator
- CheckPermissions
- ControlObject
- CreateEvent
- CreateGroup
- CreateHandle
- CreateISR
- CreateIterator
- CreateMemoCopy
- CreateMemo
- CreateMsgPipe
- CreateMsgPort
- CreateSemaphore
- CreateSignalMsg
- CreateStore
- CreateTask
- CreateThread
- CreateTimerObj
- CreateWatchObject
- Delay
- DeleteObject
- FreeView
- GetAddressMemo
- GetAddressView
- GetIteratorInfo
- GetLastError
- GetObjectInfo
- GetState
- GetStore
- GetSystemData
- LibBase
- PeekMsg
- PeekMsgPtr
- RaiseException
- RecvMsgPtr
- RecvMsg
- RemoveStore
- ResetEvent
- ResetSignalMsg
- RetException
- RetISR
- RewindTimerObj
- SendMsg
- SendSignalMsg
- SetEvent
- SetExceptionHandler
- SetState
- SetStore
- SignalSemaphore
- StepIterator
- StopTimerObj
- VirtualAlloc
- VirtualFree
- WaitForEventPtr
- WaitForEvent
- WaitSemaphore