![]() |
Ultibo API
C/C++ API for Ultibo Core
|
#include "ultibo/globaltypes.h"#include "ultibo/globalconst.h"#include "ultibo/system.h"#include "ultibo/platform.h"#include "ultibo/locale.h"Go to the source code of this file.
Data Structures | |
| struct | _SPIN_ENTRY |
| struct | _MUTEX_ENTRY |
| struct | _CRITICAL_SECTION_ENTRY |
| struct | _SEMAPHORE_ENTRY |
| struct | _SYNCHRONIZER_ENTRY |
| struct | _CONDITION_ENTRY |
| struct | _COMPLETION_ENTRY |
| struct | _LIST_ENTRY |
| struct | _LIST_ELEMENT |
| struct | _QUEUE_ENTRY |
| struct | _QUEUE_ELEMENT |
| struct | _MESSAGE_LIST |
| struct | _THREAD_MESSAGE |
| struct | _THREAD_ENTRY |
| struct | _THREAD_SNAPSHOT |
| struct | _MESSAGESLOT_ENTRY |
| struct | _MAILSLOT_ENTRY |
| struct | _BUFFER_ENTRY |
| struct | _BUFFER_ITEM |
| struct | _EVENT_ENTRY |
| struct | _TIMER_LIST |
| struct | _TIMER_ITEM |
| struct | _TIMER_ENTRY |
| struct | _WORKER_REQUEST |
| struct | _TASKER_LIST |
| struct | _TASKER_TASK |
| struct | _TASKER_THREAD_SEND_MESSAGE |
| struct | _TASKER_MESSAGESLOT_SEND |
| struct | _TASKER_SEMAPHORE_SIGNAL |
| struct | _TASKER_SEMAPHORE_RESET |
| struct | _TASKER_SEMAPHORE_COMPLETE |
Macros | |
| #define | LOCK_FLAG_NONE 0x00000000 |
| #define | LOCK_FLAG_IRQ 0x00000001 |
| #define | LOCK_FLAG_FIQ 0x00000002 |
| #define | LOCK_FLAG_IRQFIQ 0x00000004 |
| #define | SPIN_SIGNATURE 0x0FEC3B82 |
| #define | SPIN_STATE_UNLOCKED 0 |
| #define | SPIN_STATE_LOCKED 1 |
| #define | MUTEX_SIGNATURE 0x1C5D7FA4 |
| #define | MUTEX_STATE_UNLOCKED 0 |
| #define | MUTEX_STATE_LOCKED 1 |
| #define | MUTEX_FLAG_NONE 0x00000000 |
| #define | MUTEX_FLAG_RECURSIVE 0x00000001 |
| Mutex can be locked multiple times by the same thread if set (Must be unlocked the same number of times). | |
| #define | MUTEX_FLAG_ERRORCHECK 0x00000002 |
| Mutex will perform a deadlock check if set, will return with an error if already owned by the same thread (and not recursive). | |
| #define | CRITICAL_SECTION_SIGNATURE 0x25F3AE01 |
| #define | CRITICAL_SECTION_STATE_UNLOCKED 0 |
| #define | CRITICAL_SECTION_STATE_LOCKED 1 |
| #define | SEMAPHORE_SIGNATURE 0x390A1EB4 |
| #define | SEMAPHORE_FLAG_NONE LOCK_FLAG_NONE |
| #define | SEMAPHORE_FLAG_IRQ LOCK_FLAG_IRQ |
| #define | SEMAPHORE_FLAG_FIQ LOCK_FLAG_FIQ |
| #define | SEMAPHORE_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
| #define | SYNCHRONIZER_SIGNATURE 0xC5D081FB |
| #define | SYNCHRONIZER_STATE_UNLOCKED 0 |
| #define | SYNCHRONIZER_STATE_READER_LOCKED 1 |
| #define | SYNCHRONIZER_STATE_WRITER_LOCKED 2 |
| #define | SYNCHRONIZER_FLAG_NONE 0x00000000 |
| #define | SYNCHRONIZER_FLAG_READ_PRIORITY 0x00000001 |
| Synchronizer prioritises readers over writers. | |
| #define | SYNCHRONIZER_FLAG_WRITE_PRIORITY 0x00000002 |
| Synchronizer prioritises writers over readers. | |
| #define | CONDITION_SIGNATURE 0xD14D3C0A |
| #define | CONDITION_FLAG_NONE 0x00000000 |
| #define | CONDITION_LOCK_FLAG_NONE 0x00000000 |
| #define | CONDITION_LOCK_FLAG_WRITER 0x00000001 |
| Condition should release and acquire the writer lock on a Synchronizer when ConditionWaitSynchronizer is called (otherwise release and acquire the reader lock). | |
| #define | COMPLETION_SIGNATURE 0xFCE24CA1 |
| #define | COMPLETION_STATE_RESET 0 |
| #define | COMPLETION_STATE_COMPLETE 1 |
| #define | COMPLETION_FLAG_NONE LOCK_FLAG_NONE |
| #define | COMPLETION_FLAG_IRQ LOCK_FLAG_IRQ |
| Disable IRQ during completion operations (Wait/Reset/Complete). | |
| #define | COMPLETION_FLAG_FIQ LOCK_FLAG_FIQ |
| Disable FIQ during completion operations (Wait/Reset/Complete). | |
| #define | COMPLETION_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
| Disable IRQ and FIQ during completion operations (Wait/Reset/Complete). | |
| #define | COMPLETION_FLAG_COUNTED 0x00000008 |
| Use a counted value instead of a single state (Affects behaviour of Wait and Complete). | |
| #define | LIST_SIGNATURE 0x4A98BE2A |
| #define | LIST_TYPE_NOT_SPECIFIED 0 |
| A generic thread list without a specific purpose. | |
| #define | LIST_TYPE_WAIT_SECTION 1 |
| A Critical Section Wait List. | |
| #define | LIST_TYPE_WAIT_SEMAPHORE 2 |
| A Semaphore Wait List. | |
| #define | LIST_TYPE_WAIT_SYNCHRONIZER 3 |
| A Synchronizer Wait List. | |
| #define | LIST_TYPE_WAIT_CONDITION 4 |
| A Condition Wait List. | |
| #define | LIST_TYPE_WAIT_COMPLETION 5 |
| A Condition Wait List. | |
| #define | LIST_TYPE_WAIT_EVENT 6 |
| An Event Wait List. | |
| #define | LIST_TYPE_WAIT_THREAD 7 |
| A Thread Wait List. | |
| #define | LIST_TYPE_WAIT_MESSAGESLOT 8 |
| A Messageslot Wait List. | |
| #define | LIST_TYPE_WAIT_OTHER 9 |
| Another type of Wait List (Suitable for passing to ThreadWait/ThreadWaitEx/ThreadWaitMultiple/ThreadRelease). | |
| #define | LIST_FLAG_NONE LOCK_FLAG_NONE |
| #define | LIST_FLAG_IRQ LOCK_FLAG_IRQ |
| #define | LIST_FLAG_FIQ LOCK_FLAG_FIQ |
| #define | LIST_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
| #define | QUEUE_SIGNATURE 0x57A3BF9E |
| #define | QUEUE_TYPE_NOT_SPECIFIED 0 |
| A generic thread queue without a specific purpose. | |
| #define | QUEUE_TYPE_SCHEDULE_SLEEP 1 |
| A Scheduler Sleep Queue. | |
| #define | QUEUE_TYPE_SCHEDULE_TIMEOUT 2 |
| A Scheduler Timeout Queue. | |
| #define | QUEUE_TYPE_SCHEDULE_TERMINATION 3 |
| A Scheduler Termination Queue (Threads are placed on termination queue when they exit or are terminated). | |
| #define | QUEUE_TYPE_SCHEDULE_NONE 4 |
| A Scheduler No Priority Queue (Only used for IRQ/FIQ threads which are never selected for scheduling). | |
| #define | QUEUE_TYPE_SCHEDULE_IDLE 5 |
| A Scheduler Idle Priority Queue. | |
| #define | QUEUE_TYPE_SCHEDULE_LOWEST 6 |
| A Scheduler Lowest Priority Queue. | |
| #define | QUEUE_TYPE_SCHEDULE_LOWER 7 |
| A Scheduler Lower Priority Queue. | |
| #define | QUEUE_TYPE_SCHEDULE_NORMAL 8 |
| A Scheduler Normal Priority Queue. | |
| #define | QUEUE_TYPE_SCHEDULE_HIGHER 9 |
| A Scheduler Higher Priority Queue. | |
| #define | QUEUE_TYPE_SCHEDULE_HIGHEST 10 |
| A Scheduler Highest Priority Queue. | |
| #define | QUEUE_TYPE_SCHEDULE_CRITICAL 11 |
| A Scheduler Critical Priority Queue. | |
| #define | QUEUE_FLAG_NONE LOCK_FLAG_NONE |
| #define | QUEUE_FLAG_IRQ LOCK_FLAG_IRQ |
| #define | QUEUE_FLAG_FIQ LOCK_FLAG_FIQ |
| #define | QUEUE_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
| #define | QUEUE_FLAG_DESCENDING 0x00000008 |
| #define | QUEUE_FLAG_DELTA 0x00000010 |
| #define | QUEUE_KEY_NONE (int32_t)0x7FFFFFFF |
| Null key value returned from an empty Queue. | |
| #define | QUEUE_KEY_MAX (int32_t)0x7FFFFFFE |
| Max key that can be ordered in a Queue. | |
| #define | QUEUE_KEY_MIN (int32_t)0x80000000 |
| Min key that can be ordered in a Queue. | |
| #define | THREAD_SIGNATURE 0x6C2BA10F |
| #define | THREAD_TYPE_NORMAL 0 |
| A Normal thread (No special case handling). | |
| #define | THREAD_TYPE_IDLE 1 |
| An Idle thread (Used to calculate ultilization and provide an always ready thread). | |
| #define | THREAD_TYPE_IRQ 2 |
| An IRQ thread (Used by the IRQ handler during interrupt time). | |
| #define | THREAD_TYPE_FIQ 3 |
| An FIQ thread (Used by the FIQ handler during interrupt time). | |
| #define | THREAD_TYPE_SWI 4 |
| A Software Interrupt (SWI) thread (Used by the SWI handler during a system call). | |
| #define | THREAD_FLAG_NONE 0x00000000 |
| #define | THREAD_FLAG_PERSIST 0x00000001 |
| If set thread handle will persist until explicitly destroyed (Otherwise destroyed after termination quantum has elapsed). | |
| #define | THREAD_FLAG_CANCELLED 0x00000002 |
| Indicates that thread has been cancelled, for support of external thread APIs (eg pThreads)(Not used internally by Ultibo). | |
| #define | THREAD_FLAG_CANCEL_DISABLE 0x00000004 |
| Indicates that thread cancellation is disabled for a thread, for support of external thread APIs (eg pThreads)(Not used internally by Ultibo). | |
| #define | THREAD_FLAG_CANCEL_ASYNCHRONOUS 0x00000008 |
| Indicates that asynchronous thread cancellation is enabled for a thread, for support of external thread APIs (eg pThreads)(Not used internally by Ultibo). | |
| #define | THREAD_FLAG_INTERNAL THREAD_FLAG_NONE + 0x80000000 |
| Note: Temporary value to avoid warning. | |
| #define | THREAD_STATE_RUNNING 1 |
| Thread is currently running. | |
| #define | THREAD_STATE_READY 2 |
| Thread is on ready queue. | |
| #define | THREAD_STATE_SLEEP 3 |
| Thread is sleeping. | |
| #define | THREAD_STATE_SUSPENDED 4 |
| Thread is suspended. | |
| #define | THREAD_STATE_WAIT 5 |
| Thread is on a wait list. | |
| #define | THREAD_STATE_WAIT_TIMEOUT 6 |
| Thread is on a wait list with timeout. | |
| #define | THREAD_STATE_RECEIVE 7 |
| Thread is waiting to receive a message. | |
| #define | THREAD_STATE_RECEIVE_TIMEOUT 8 |
| Thread is waiting to receive a message with timeout. | |
| #define | THREAD_STATE_HALTED 9 |
| Thread has been halted (Due to an unhandled exception etc). | |
| #define | THREAD_STATE_TERMINATED 10 |
| #define | THREAD_PRIORITY_NONE 0 |
| To Do THREAD_STATE_SEND / THREAD_STATE_SEND_TIMEOUT ? //Who would wake them up ? //Timeout is ok, but what about send only ? | |
| #define | THREAD_PRIORITY_IDLE 1 |
| #define | THREAD_PRIORITY_LOWEST 2 |
| #define | THREAD_PRIORITY_LOWER 3 |
| #define | THREAD_PRIORITY_NORMAL 4 |
| #define | THREAD_PRIORITY_HIGHER 5 |
| #define | THREAD_PRIORITY_HIGHEST 6 |
| #define | THREAD_PRIORITY_CRITICAL 7 |
| #define | THREAD_PRIORITY_DEFAULT THREAD_PRIORITY_NORMAL |
| Default thread priority. | |
| #define | THREAD_PRIORITY_MINIMUM THREAD_PRIORITY_IDLE |
| Minimum thread priority. | |
| #define | THREAD_PRIORITY_MAXIMUM THREAD_PRIORITY_CRITICAL |
| Maximum thread priority. | |
| #define | THREAD_PRIORITY_COUNT THREAD_PRIORITY_MAXIMUM + 1 |
| Number of thread priority levels. | |
| #define | THREAD_PRIORITY_BELOW_NORMAL THREAD_PRIORITY_LOWER |
| #define | THREAD_PRIORITY_ABOVE_NORMAL THREAD_PRIORITY_HIGHER |
| #define | THREAD_PRIORITY_TIME_CRITICAL THREAD_PRIORITY_CRITICAL |
| #define | THREAD_NAME_LENGTH SIZE_64 |
| Length of thread name. | |
| #define | IRQ_THREAD_NAME "IRQ" |
| #define | FIQ_THREAD_NAME "FIQ" |
| #define | SWI_THREAD_NAME "SWI" |
| #define | IDLE_THREAD_NAME "Idle" |
| #define | MAIN_THREAD_NAME "Main" |
| #define | TIMER_THREAD_NAME "Timer" |
| #define | WORKER_THREAD_NAME "Worker" |
| #define | TIMER_PRIORITY_THREAD_NAME "Priority Timer" |
| #define | WORKER_PRIORITY_THREAD_NAME "Priority Worker" |
| #define | RTL_THREAD_NAME "RTL Thread" |
| #define | TIMER_THREAD_PRIORITY THREAD_PRIORITY_NORMAL |
| #define | WORKER_THREAD_PRIORITY THREAD_PRIORITY_NORMAL |
| #define | TIMER_PRIORITY_THREAD_PRIORITY THREAD_PRIORITY_HIGHEST |
| #define | WORKER_PRIORITY_THREAD_PRIORITY THREAD_PRIORITY_HIGHER |
| #define | THREAD_CREATE_NONE 0x00000000 |
| #define | THREAD_CREATE_SUSPENDED 0x00000004 |
| #define | THREAD_TLS_FREE 0x00000000 |
| #define | THREAD_TLS_USED 0x00000001 |
| #define | THREAD_TLS_INVALID 0xFFFFFFFF |
| #define | THREAD_TLS_MAXIMUM SIZE_64 |
| The maximum number TLS index slots available. | |
| #define | THREAD_TLS_FLAG_NONE 0x00000000 |
| #define | THREAD_TLS_FLAG_FREE 0x00000001 |
| If set then pointer in thread TLS index will be freed on ThreadReleaseTlsIndex or ThreadDestroy. | |
| #define | THREAD_LISTS_MAXIMUM SIZE_64 |
| Maximum number of lists a thread can wait on at the same time. | |
| #define | MESSAGESLOT_SIGNATURE 0xB631CE4B |
| #define | MESSAGESLOT_FLAG_NONE LOCK_FLAG_NONE |
| #define | MESSAGESLOT_FLAG_IRQ LOCK_FLAG_IRQ |
| #define | MESSAGESLOT_FLAG_FIQ LOCK_FLAG_FIQ |
| #define | MESSAGESLOT_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
| #define | MAILSLOT_SIGNATURE 0x7A409BF3 |
| #define | BUFFER_SIGNATURE 0x830BEA71 |
| #define | BUFFER_FLAG_NONE 0x00000000 |
| #define | BUFFER_FLAG_SHARED 0x00000001 |
| If set the buffer memory (Not the buffer entry itself) is allocated from shared memory. | |
| #define | EVENT_SIGNATURE 0x903BA69D |
| #define | EVENT_STATE_UNSIGNALED 0 |
| #define | EVENT_STATE_SIGNALED 1 |
| #define | EVENT_FLAG_NONE 0x00000000 |
| #define | EVENT_FLAG_INITIAL_STATE 0x00000001 |
| #define | EVENT_FLAG_MANUAL_RESET 0x00000002 |
| #define | TIMER_SIGNATURE 0xAB7E07FB |
| #define | TIMER_STATE_DISABLED 0 |
| #define | TIMER_STATE_ENABLED 1 |
| #define | TIMER_FLAG_NONE 0x00000000 |
| #define | TIMER_FLAG_RESCHEDULE 0x00000001 |
| Timer should be rescheduled each time the event completes. | |
| #define | TIMER_FLAG_IMMEDIATE 0x00000002 |
| Timer event should be executed immediately and then each interval milliseconds. | |
| #define | TIMER_FLAG_WORKER 0x00000004 |
| Timer event should be executed by a worker thread instead of a timer thread. | |
| #define | TIMER_FLAG_PRIORITY 0x00000008 |
| Timer event should be executed by a priority timer thread. | |
| #define | TIMER_KEY_NONE (int32_t)0x7FFFFFFF |
| Null key value returned from an empty Timer list. | |
| #define | TIMER_KEY_MAX (int32_t)0x7FFFFFFE |
| Max key that can be ordered in a Timer list. | |
| #define | TIMER_KEY_MIN (int32_t)0x80000000 |
| Min key that can be ordered in a Timer list. | |
| #define | WORKER_SIGNATURE 0xEF6A901B |
| #define | WORKER_FLAG_NONE 0x00000000 |
| #define | WORKER_FLAG_RESCHEDULE 0x00000001 |
| Worker task should be rescheduled each time the task completes. | |
| #define | WORKER_FLAG_IMMEDIATE 0x00000002 |
| Worker task should be executed immediately and then each interval milliseconds. | |
| #define | WORKER_FLAG_CANCEL 0x00000004 |
| Internal flag to indicate the worker task should be cancelled next time the interval expires. | |
| #define | WORKER_FLAG_NOFREE 0x00000008 |
| Internal flag to tell worker execute not to free the worker request when it is completed. | |
| #define | WORKER_FLAG_TERMINATE 0x00000010 |
| Internal flag to tell worker execute to terminate the worker thread. | |
| #define | WORKER_FLAG_IRQ 0x00000020 |
| Internal flag to tell worker execute to free IRQ memory when the request is completed. | |
| #define | WORKER_FLAG_FIQ 0x00000040 |
| Internal flag to tell worker execute to free FIQ memory when the request is completed. | |
| #define | WORKER_FLAG_PRIORITY 0x00000080 |
| Worker task should be executed by a priority worker thread. | |
| #define | WORKER_FLAG_INTERNAL WORKER_FLAG_CANCEL | WORKER_FLAG_NOFREE | WORKER_FLAG_TERMINATE | WORKER_FLAG_IRQ | WORKER_FLAG_FIQ |
| Internal only flags. | |
| #define | WORKER_FLAG_EXCLUDED_IRQ WORKER_FLAG_RESCHEDULE | WORKER_FLAG_IMMEDIATE |
| Excluded flags. | |
| #define | WORKER_FLAG_EXCLUDED_FIQ WORKER_FLAG_RESCHEDULE | WORKER_FLAG_IMMEDIATE |
| Excluded flags. | |
| #define | TASKER_TASK_THREADSENDMESSAGE 1 |
| Perform a ThreadSendMessage() function using the tasker list. | |
| #define | TASKER_TASK_MESSAGESLOTSEND 2 |
| Perform a MessageslotSend() function using the tasker list. | |
| #define | TASKER_TASK_SEMAPHORESIGNAL 3 |
| Perform a SemaphoreSignal() function using the tasker list. | |
| #define | TASKER_TASK_COMPLETIONRESET 4 |
| Perform a CompletionReset() function using the tasker list. | |
| #define | TASKER_TASK_COMPLETIONCOMPLETE 5 |
| Perform a CompletionComplete() or CompletionCompleteAll() function using the tasker list. | |
| #define | SCHEDULER_MIGRATION_DISABLED 0 |
| #define | SCHEDULER_MIGRATION_ENABLED 1 |
| #define | SCHEDULER_PREEMPT_DISABLED 0 |
| #define | SCHEDULER_PREEMPT_ENABLED 1 |
| #define | SCHEDULER_ALLOCATION_DISABLED 0 |
| #define | SCHEDULER_ALLOCATION_ENABLED 1 |
| #define | SCHEDULER_MASK_NONE (1 << THREAD_PRIORITY_NONE) |
| #define | SCHEDULER_MASK_IDLE (1 << THREAD_PRIORITY_IDLE) |
| #define | SCHEDULER_MASK_LOWEST (1 << THREAD_PRIORITY_LOWEST) |
| #define | SCHEDULER_MASK_LOWER (1 << THREAD_PRIORITY_LOWER) |
| #define | SCHEDULER_MASK_NORMAL (1 << THREAD_PRIORITY_NORMAL) |
| #define | SCHEDULER_MASK_HIGHER (1 << THREAD_PRIORITY_HIGHER) |
| #define | SCHEDULER_MASK_HIGHEST (1 << THREAD_PRIORITY_HIGHEST) |
| #define | SCHEDULER_MASK_CRITICAL (1 << THREAD_PRIORITY_CRITICAL) |
| #define | SCHEDULER_QUANTUM_NONE 0 |
| #define | SCHEDULER_QUANTUM_IDLE 0 |
| #define | SCHEDULER_QUANTUM_LOWEST 1 |
| #define | SCHEDULER_QUANTUM_LOWER 2 |
| #define | SCHEDULER_QUANTUM_NORMAL 4 |
| #define | SCHEDULER_QUANTUM_HIGHER 6 |
| #define | SCHEDULER_QUANTUM_HIGHEST 8 |
| #define | SCHEDULER_QUANTUM_CRITICAL 10 |
Functions | |
| SPIN_HANDLE STDCALL | spin_create (void) |
| Create and insert a new Spin entry. | |
| SPIN_HANDLE STDCALL | spin_create_ex (BOOL initialowner) |
| Create and insert a new Spin entry. | |
| uint32_t STDCALL | spin_destroy (SPIN_HANDLE spin) |
| Destroy and remove an existing Spin entry. | |
| THREAD_HANDLE STDCALL | spin_owner (SPIN_HANDLE spin) |
| Get the current owner of an existing Spin entry. | |
| uint32_t STDCALL | spin_lock (SPIN_HANDLE spin) |
| Lock an existing Spin entry. | |
| uint32_t STDCALL | spin_unlock (SPIN_HANDLE spin) |
| Unlock an existing Spin entry. | |
| uint32_t STDCALL | spin_lock_irq (SPIN_HANDLE spin) |
| Lock an existing Spin entry, disable IRQ and save the previous IRQ state. | |
| uint32_t STDCALL | spin_unlock_irq (SPIN_HANDLE spin) |
| Unlock an existing Spin entry and restore the previous IRQ state. | |
| uint32_t STDCALL | spin_lock_fiq (SPIN_HANDLE spin) |
| Lock an existing Spin entry, disable FIQ and save the previous FIQ state. | |
| uint32_t STDCALL | spin_unlock_fiq (SPIN_HANDLE spin) |
| Unlock an existing Spin entry and restore the previous FIQ state. | |
| uint32_t STDCALL | spin_lock_irq_fiq (SPIN_HANDLE spin) |
| Lock an existing Spin entry, disable IRQ and FIQ and save the previous IRQ and FIQ state. | |
| uint32_t STDCALL | spin_unlock_irq_fiq (SPIN_HANDLE spin) |
| Unlock an existing Spin entry and restore the previous IRQ and FIQ state. | |
| uint32_t STDCALL | spin_lock_preempt (SPIN_HANDLE spin) |
| Lock an existing Spin entry, disable IRQ or IRQ/FIQ and save the previous IRQ or IRQ/FIQ state. | |
| uint32_t STDCALL | spin_unlock_preempt (SPIN_HANDLE spin) |
| Unlock an existing Spin entry and restore the previous IRQ or IRQ/FIQ state. | |
| BOOL STDCALL | spin_check_irq (SPIN_HANDLE spin) |
| Check the mask that stores the previous IRQ state to determine if IRQ is enabled. | |
| BOOL STDCALL | spin_check_fiq (SPIN_HANDLE spin) |
| Check the mask that stores the previous FIQ state to determine if FIQ is enabled. | |
| uint32_t STDCALL | spin_exchange_irq (SPIN_HANDLE spin1, SPIN_HANDLE spin2) |
| Exchange the previous IRQ state between two Spin entries. | |
| uint32_t STDCALL | spin_exchange_fiq (SPIN_HANDLE spin1, SPIN_HANDLE spin2) |
| Exchange the previous FIQ state between two Spin entries. | |
| MUTEX_HANDLE STDCALL | mutex_create (void) |
| Create and insert a new Mutex entry. | |
| MUTEX_HANDLE STDCALL | mutex_create_ex (BOOL initialowner, uint32_t spincount, uint32_t flags) |
| Create and insert a new Mutex entry. | |
| uint32_t STDCALL | mutex_destroy (MUTEX_HANDLE mutex) |
| Destroy and remove an existing Mutex entry. | |
| uint32_t STDCALL | mutex_flags (MUTEX_HANDLE mutex) |
| Get the current flags of an existing Mutex entry. | |
| uint32_t STDCALL | mutex_count (MUTEX_HANDLE mutex) |
| Get the current lock count of an existing Mutex entry. | |
| THREAD_HANDLE STDCALL | mutex_owner (MUTEX_HANDLE mutex) |
| Get the current owner of an existing Mutex entry. | |
| uint32_t STDCALL | mutex_lock (MUTEX_HANDLE mutex) |
| Lock an existing Mutex entry. | |
| uint32_t STDCALL | mutex_unlock (MUTEX_HANDLE mutex) |
| Unlock an existing Mutex entry. | |
| uint32_t STDCALL | mutex_try_lock (MUTEX_HANDLE mutex) |
| Try to lock an existing Mutex entry. | |
| CRITICAL_SECTION_HANDLE STDCALL | critical_section_create (void) |
| Create and insert a new CriticalSection entry. | |
| CRITICAL_SECTION_HANDLE STDCALL | critical_section_create_ex (BOOL initialowner, uint32_t spincount) |
| Create and insert a new CriticalSection entry. | |
| uint32_t STDCALL | critical_section_destroy (CRITICAL_SECTION_HANDLE criticalsection) |
| Destroy and remove an existing CriticalSection entry. | |
| uint32_t STDCALL | critical_section_count (CRITICAL_SECTION_HANDLE criticalsection) |
| Get the current lock count of an existing CriticalSection entry. | |
| THREAD_HANDLE STDCALL | critical_section_owner (CRITICAL_SECTION_HANDLE criticalsection) |
| Get the current owner of an existing CriticalSection entry. | |
| uint32_t STDCALL | critical_section_set_spin_count (CRITICAL_SECTION_HANDLE criticalsection, uint32_t spincount) |
| Set the spin count of an existing CriticalSection entry. | |
| uint32_t STDCALL | critical_section_lock (CRITICAL_SECTION_HANDLE criticalsection) |
| Lock an existing CriticalSection entry. | |
| uint32_t STDCALL | critical_section_lock_ex (CRITICAL_SECTION_HANDLE criticalsection, uint32_t timeout) |
| Lock an existing CriticalSection entry. | |
| uint32_t STDCALL | critical_section_unlock (CRITICAL_SECTION_HANDLE criticalsection) |
| Unlock an existing CriticalSection entry. | |
| uint32_t STDCALL | critical_section_try_lock (CRITICAL_SECTION_HANDLE criticalsection) |
| Try to lock an existing CriticalSection entry. | |
| SEMAPHORE_HANDLE STDCALL | semaphore_create (uint32_t count) |
| Create and insert a new Semaphore entry. | |
| SEMAPHORE_HANDLE STDCALL | semaphore_create_ex (uint32_t count, uint32_t maximum, uint32_t flags) |
| Create and insert a new Semaphore entry. | |
| uint32_t STDCALL | semaphore_destroy (SEMAPHORE_HANDLE semaphore) |
| Destroy and remove an existing Semaphore entry. | |
| uint32_t STDCALL | semaphore_count (SEMAPHORE_HANDLE semaphore) |
| Get the current count of an existing Semaphore entry. | |
| uint32_t STDCALL | semaphore_wait (SEMAPHORE_HANDLE semaphore) |
| Wait on an existing Semaphore entry. | |
| uint32_t STDCALL | semaphore_wait_ex (SEMAPHORE_HANDLE semaphore, uint32_t timeout) |
| Wait on an existing Semaphore entry. | |
| uint32_t STDCALL | semaphore_signal (SEMAPHORE_HANDLE semaphore) |
| Signal an existing Semaphore entry. | |
| uint32_t STDCALL | semaphore_signal_ex (SEMAPHORE_HANDLE semaphore, uint32_t count, uint32_t *previous) |
| Signal an existing Semaphore entry one or more times. | |
| SYNCHRONIZER_HANDLE STDCALL | synchronizer_create (void) |
| Create and insert a new Synchronizer entry. | |
| SYNCHRONIZER_HANDLE STDCALL | synchronizer_create_ex (BOOL initialreader, BOOL initialwriter) |
| Create and insert a new Synchronizer entry. | |
| uint32_t STDCALL | synchronizer_destroy (SYNCHRONIZER_HANDLE synchronizer) |
| Destroy and remove an existing Synchronizer entry. | |
| uint32_t STDCALL | synchronizer_reader_count (SYNCHRONIZER_HANDLE synchronizer) |
| Get the current reader count of an existing Synchronizer entry. | |
| THREAD_HANDLE STDCALL | synchronizer_reader_last (SYNCHRONIZER_HANDLE synchronizer) |
| Get the last reader thread of an existing Synchronizer entry. | |
| uint32_t STDCALL | synchronizer_reader_lock (SYNCHRONIZER_HANDLE synchronizer) |
| Lock an existing Synchronizer entry for reading. | |
| uint32_t STDCALL | synchronizer_reader_lock_ex (SYNCHRONIZER_HANDLE synchronizer, uint32_t timeout) |
| Lock an existing Synchronizer entry for reading. | |
| uint32_t STDCALL | synchronizer_reader_unlock (SYNCHRONIZER_HANDLE synchronizer) |
| Unlock an existing Synchronizer entry. | |
| uint32_t STDCALL | synchronizer_reader_convert (SYNCHRONIZER_HANDLE synchronizer) |
| Convert a reader lock on an existing Synchronizer entry to a writer lock. | |
| uint32_t STDCALL | synchronizer_reader_convert_ex (SYNCHRONIZER_HANDLE synchronizer, uint32_t timeout) |
| Convert a reader lock on an existing Synchronizer entry to a writer lock. | |
| uint32_t STDCALL | synchronizer_writer_count (SYNCHRONIZER_HANDLE synchronizer) |
| Get the current writer count of an existing Synchronizer entry. | |
| THREAD_HANDLE STDCALL | synchronizer_writer_owner (SYNCHRONIZER_HANDLE synchronizer) |
| Get the current writer owner of an existing Synchronizer entry. | |
| uint32_t STDCALL | synchronizer_writer_lock (SYNCHRONIZER_HANDLE synchronizer) |
| Lock an existing Synchronizer entry for writing. | |
| uint32_t STDCALL | synchronizer_writer_lock_ex (SYNCHRONIZER_HANDLE synchronizer, uint32_t timeout) |
| Lock an existing Synchronizer entry for writing. | |
| uint32_t STDCALL | synchronizer_writer_unlock (SYNCHRONIZER_HANDLE synchronizer) |
| Unlock an existing Synchronizer entry. | |
| uint32_t STDCALL | synchronizer_writer_convert (SYNCHRONIZER_HANDLE synchronizer) |
| Convert a writer lock on an existing Synchronizer entry to a reader lock. | |
| CONDITION_HANDLE STDCALL | condition_create (void) |
| Create and insert a new Condition entry. | |
| uint32_t STDCALL | condition_destroy (CONDITION_HANDLE condition) |
| Destroy and remove an existing Condition entry. | |
| uint32_t STDCALL | condition_wait (CONDITION_HANDLE condition, uint32_t timeout) |
| Wait on an existing Condition. | |
| uint32_t STDCALL | condition_wait_mutex (CONDITION_HANDLE condition, MUTEX_HANDLE mutex, uint32_t timeout) |
| Release a Mutex and Wait on an existing Condition in an atomic operation. | |
| uint32_t STDCALL | condition_wait_synchronizer (CONDITION_HANDLE condition, SYNCHRONIZER_HANDLE synchronizer, uint32_t flags, uint32_t timeout) |
| Release a Synchronizer and Wait on an existing Condition in an atomic operation. | |
| uint32_t STDCALL | condition_wait_critical_section (CONDITION_HANDLE condition, CRITICAL_SECTION_HANDLE criticalsection, uint32_t timeout) |
| Release a Critical Section and Wait on an existing Condition in an atomic operation. | |
| uint32_t STDCALL | condition_wake (CONDITION_HANDLE condition) |
| Wake one thread waiting on an existing Condition. | |
| uint32_t STDCALL | condition_wake_all (CONDITION_HANDLE condition) |
| Wake all threads waiting on an existing Condition. | |
| COMPLETION_HANDLE STDCALL | completion_create (uint32_t flags) |
| Create and insert a new Completion entry. | |
| uint32_t STDCALL | completion_destroy (COMPLETION_HANDLE completion) |
| Destroy and remove an existing Completion entry. | |
| uint32_t STDCALL | completion_state (COMPLETION_HANDLE completion) |
| Get the current state of an existing Completion entry. | |
| uint32_t STDCALL | completion_wait (COMPLETION_HANDLE completion, uint32_t timeout) |
| Wait on an existing Completion. | |
| uint32_t STDCALL | completion_try_wait (COMPLETION_HANDLE completion) |
| Try an existing Completion to see if it is completed. | |
| uint32_t STDCALL | completion_reset (COMPLETION_HANDLE completion) |
| Reset (uncomplete) the state of an existing Completion entry. | |
| uint32_t STDCALL | completion_complete (COMPLETION_HANDLE completion) |
| Set (complete) the state of an existing Completion entry. | |
| uint32_t STDCALL | completion_complete_all (COMPLETION_HANDLE completion) |
| Set (complete) the state of an existing Completion entry. | |
| LIST_HANDLE STDCALL | list_create (void) |
| Create and insert a new List entry. | |
| LIST_HANDLE STDCALL | list_create_ex (uint32_t listtype, uint32_t flags) |
| Create and insert a new List entry. | |
| uint32_t STDCALL | list_destroy (LIST_HANDLE list) |
| Destroy and remove an existing List entry. | |
| uint32_t STDCALL | list_count (LIST_HANDLE list) |
| Get the current count from the supplied list. | |
| uint32_t STDCALL | list_add_first (LIST_HANDLE list, LIST_ELEMENT *element) |
| Add the supplied element as the first item in the List. | |
| uint32_t STDCALL | list_add_last (LIST_HANDLE list, LIST_ELEMENT *element) |
| Add the supplied element as the last item in the List. | |
| LIST_ELEMENT *STDCALL | list_get_thread (LIST_HANDLE list, THREAD_HANDLE thread) |
| Find the supplied thread in the List and return its element. | |
| LIST_ELEMENT *STDCALL | list_get_first (LIST_HANDLE list) |
| Get the first element from the List. | |
| LIST_ELEMENT *STDCALL | list_get_first_ex (LIST_HANDLE list, BOOL remove) |
| Get the first element from the List. | |
| LIST_ELEMENT *STDCALL | list_get_last (LIST_HANDLE list) |
| Get the last element from the List. | |
| LIST_ELEMENT *STDCALL | list_get_last_ex (LIST_HANDLE list, BOOL remove) |
| Get the last element from the List. | |
| uint32_t STDCALL | list_insert (LIST_HANDLE list, LIST_ELEMENT *previous, LIST_ELEMENT *element) |
| Insert a new element in the List. | |
| uint32_t STDCALL | list_remove (LIST_HANDLE list, LIST_ELEMENT *element) |
| Remove an element from the List. | |
| BOOL STDCALL | list_is_empty (LIST_HANDLE list) |
| Check if the supplied List is empty. | |
| BOOL STDCALL | list_not_empty (LIST_HANDLE list) |
| Check if the supplied List is empty. | |
| uint32_t STDCALL | list_lock (LIST_HANDLE list) |
| Lock the supplied List. | |
| uint32_t STDCALL | list_unlock (LIST_HANDLE list) |
| Unlock the supplied List. | |
| QUEUE_HANDLE STDCALL | queue_create (void) |
| Create and insert a new Queue entry. | |
| QUEUE_HANDLE STDCALL | queue_create_ex (uint32_t queuetype, uint32_t flags) |
| Create and insert a new Queue entry. | |
| uint32_t STDCALL | queue_destroy (QUEUE_HANDLE queue) |
| Destroy and remove an existing Queue entry. | |
| uint32_t STDCALL | queue_count (QUEUE_HANDLE queue) |
| Get the current count from the supplied queue. | |
| uint32_t STDCALL | queue_enqueue (QUEUE_HANDLE queue, THREAD_HANDLE thread) |
| Add the supplied thread as the last item in the Queue. | |
| THREAD_HANDLE STDCALL | queue_dequeue (QUEUE_HANDLE queue) |
| Get and remove the first thread from the Queue. | |
| int STDCALL | queue_first_key (QUEUE_HANDLE queue) |
| Get the first Key value from the Queue. | |
| int STDCALL | queue_last_key (QUEUE_HANDLE queue) |
| Get the last Key value from the Queue. | |
| uint32_t STDCALL | queue_insert_key (QUEUE_HANDLE queue, THREAD_HANDLE thread, int key) |
| Insert the supplied thread in the Queue ordered based on Key and the flags of the Queue. | |
| uint32_t STDCALL | queue_delete_key (QUEUE_HANDLE queue, THREAD_HANDLE thread) |
| Delete the supplied thread from the Queue based on the flags of the Queue. | |
| int STDCALL | queue_increment_key (QUEUE_HANDLE queue) |
| Increment the first Key value in the Queue. | |
| int STDCALL | queue_decrement_key (QUEUE_HANDLE queue) |
| Decrement the first Key value in the Queue. | |
| BOOL STDCALL | queue_is_empty (QUEUE_HANDLE queue) |
| Check if the supplied Queue is empty. | |
| BOOL STDCALL | queue_not_empty (QUEUE_HANDLE queue) |
| Check if the supplied Queue is not empty. | |
| uint32_t STDCALL | queue_lock (QUEUE_HANDLE queue) |
| Lock the supplied Queue. | |
| uint32_t STDCALL | queue_unlock (QUEUE_HANDLE queue) |
| Unlock the supplied Queue. | |
| THREAD_HANDLE STDCALL | thread_create (thread_start_proc startproc, uint32_t stacksize, uint32_t priority, const char *name, void *parameter) |
| Create and insert a new Thread entry. | |
| THREAD_HANDLE STDCALL | thread_create_ex (thread_start_proc startproc, uint32_t stacksize, uint32_t priority, uint32_t affinity, uint32_t cpu, const char *name, void *parameter) |
| Create and insert a new Thread entry. | |
| uint32_t STDCALL | thread_destroy (THREAD_HANDLE thread) |
| Destroy and remove an existing Thread entry. | |
| THREAD_HANDLE STDCALL | thread_get_current (void) |
| Get the Handle of currently executing thread. | |
| uint32_t STDCALL | thread_set_current (THREAD_HANDLE thread) |
| Set the Handle of currently executing thread. | |
| uint32_t STDCALL | thread_get_name (THREAD_HANDLE thread, char *name, uint32_t len) |
| Get the name of a Thread. | |
| uint32_t STDCALL | thread_set_name (THREAD_HANDLE thread, const char *name) |
| Set the name of a Thread. | |
| uint32_t STDCALL | thread_get_cpu (THREAD_HANDLE thread) |
| Get the current CPU of a thread (eg CPU_ID_0). | |
| uint32_t STDCALL | thread_set_cpu (THREAD_HANDLE thread, uint32_t cpu) |
| Set the current CPU of a thread (eg CPU_ID_0). | |
| uint32_t STDCALL | thread_get_state (THREAD_HANDLE thread) |
| Get the current state of a thread (eg THREAD_STATE_SUSPENDED). | |
| uint32_t STDCALL | thread_get_flags (THREAD_HANDLE thread) |
| Get the current flags of a thread. | |
| uint32_t STDCALL | thread_set_flags (THREAD_HANDLE thread, uint32_t flags) |
| Set the current flags of a thread. | |
| uint32_t STDCALL | thread_add_flags (THREAD_HANDLE thread, uint32_t flags) |
| Add flags to the current flags of a thread. | |
| uint32_t STDCALL | thread_remove_flags (THREAD_HANDLE thread, uint32_t flags) |
| Remove flags from the current flags of a thread. | |
| LCID STDCALL | thread_get_locale (THREAD_HANDLE thread) |
| Get the current locale of a thread. | |
| uint32_t STDCALL | thread_set_locale (THREAD_HANDLE thread, LCID locale) |
| Set the locale of a thread. | |
| uint32_t STDCALL | thread_get_times (THREAD_HANDLE thread, int64_t *createtime, int64_t *exittime, int64_t *kerneltime) |
| Get the current times of a thread. | |
| uint32_t STDCALL | thread_get_switch_count (THREAD_HANDLE thread, int64_t *switchcount) |
| Get the current context switch count of a thread (How many times the thread has been scheduled). | |
| uint32_t STDCALL | thread_get_stack_free (void) |
| Get the free stack size of the current thread. | |
| uint32_t STDCALL | thread_get_stack_size (THREAD_HANDLE thread) |
| Get the current stack size of a thread. | |
| size_t STDCALL | thread_get_stack_base (THREAD_HANDLE thread) |
| Get the current stack base of a thread. | |
| uint32_t STDCALL | thread_set_stack_base (THREAD_HANDLE thread, size_t stackbase) |
| Set the current stack base of a thread. | |
| size_t STDCALL | thread_get_stack_pointer (THREAD_HANDLE thread) |
| Get the current stack pointer of a thread. | |
| uint32_t STDCALL | thread_get_exit_code (THREAD_HANDLE thread) |
| Get the exit code of a Thread. | |
| uint32_t STDCALL | thread_get_affinity (THREAD_HANDLE thread) |
| Get the scheduling affinity of a Thread. | |
| uint32_t STDCALL | thread_set_affinity (THREAD_HANDLE thread, uint32_t affinity) |
| Set the scheduling affinity of a Thread. | |
| uint32_t STDCALL | thread_get_priority (THREAD_HANDLE thread) |
| Get the scheduling priority of a Thread. | |
| uint32_t STDCALL | thread_set_priority (THREAD_HANDLE thread, uint32_t priority) |
| Set the scheduling priority of a Thread. | |
| uint32_t STDCALL | thread_get_last_error (void) |
| Get the last error value for the current Thread. | |
| void STDCALL | thread_set_last_error (uint32_t lasterror) |
| Set the last error value for the current Thread. | |
| uint32_t STDCALL | thread_set_last_error_ex (uint32_t lasterror) |
| Set the last error value for the current Thread. | |
| uint32_t STDCALL | thread_get_wait_result (void) |
| Get the result of the last wait timeout for the current Thread. | |
| uint32_t STDCALL | thread_get_receive_result (void) |
| Get the result of the last receive timeout for the current Thread. | |
| uint32_t STDCALL | thread_get_tls_index (uint32_t tlsindex) |
| Get the current status of a TLS index in the TLS index table. | |
| uint32_t STDCALL | thread_alloc_tls_index (void) |
| Allocate a TLS index in the TLS index table. | |
| uint32_t STDCALL | thread_alloc_tls_index_ex (uint32_t flags) |
| Allocate a TLS index in the TLS index table. | |
| uint32_t STDCALL | thread_release_tls_index (uint32_t tlsindex) |
| Deallocate a TLS index from the TLS index table. | |
| void *STDCALL | thread_get_tls_value (uint32_t tlsindex) |
| Get the pointer associated with the TLS index for the current thread. | |
| uint32_t STDCALL | thread_set_tls_value (uint32_t tlsindex, void *tlsvalue) |
| Set the pointer associated with the TLS index for the current thread. | |
| void *STDCALL | thread_get_tls_pointer (THREAD_HANDLE thread) |
| Get the RTL TLS (Thread Local Storage) pointer of a Thread. | |
| uint32_t STDCALL | thread_set_tls_pointer (THREAD_HANDLE thread, void *tlspointer) |
| Set the RTL TLS (Thread Local Storage) pointer of a Thread. | |
| uint32_t STDCALL | thread_ready (THREAD_HANDLE thread, BOOL reschedule) |
| Place the supplied Thread on the ready queue. | |
| uint32_t STDCALL | thread_timeout (THREAD_HANDLE thread) |
| Place the supplied Thread on the ready queue after a timeout waiting on a resource. | |
| uint32_t STDCALL | thread_wake (THREAD_HANDLE thread) |
| Remove a thread prematurely from the sleep or timeout queues. | |
| uint32_t STDCALL | thread_migrate (THREAD_HANDLE thread, uint32_t cpu) |
| Migrate a thread to a new CPU. | |
| void STDCALL | thread_end (uint32_t exitcode) |
| Terminate the current Thread. | |
| uint32_t STDCALL | thread_halt (uint32_t exitcode) |
| Halt the current thread so it will never be rescheduled. | |
| uint32_t STDCALL | thread_terminate (THREAD_HANDLE thread, uint32_t exitcode) |
| Terminate but do not destroy the supplied Thread. | |
| uint32_t STDCALL | thread_yield (void) |
| Make the current thread yield the processor (Same as ThreadSleep(0)). | |
| uint32_t STDCALL | thread_sleep (uint32_t milliseconds) |
| Place the current thread on the sleep queue for a specified number of milliseconds. | |
| uint32_t STDCALL | thread_wait (LIST_HANDLE list, SPIN_HANDLE lock, uint32_t flags) |
| Put the current thread into a wait state on the supplied list. | |
| uint32_t STDCALL | thread_wait_ex (LIST_HANDLE list, SPIN_HANDLE lock, uint32_t flags, uint32_t timeout) |
| Put the current thread into a wait state with timeout on the supplied list. | |
| uint32_t STDCALL | thread_release (LIST_HANDLE list) |
| Release the first thread waiting on the supplied list. | |
| uint32_t STDCALL | thread_abandon (LIST_HANDLE list) |
| Release the first thread waiting on the supplied list and return with WAIT_ABANDONED. | |
| uint32_t STDCALL | thread_wait_terminate (THREAD_HANDLE thread, uint32_t timeout) |
| Make the current thread wait until the specified thread has terminated. | |
| uint32_t STDCALL | thread_suspend (THREAD_HANDLE thread) |
| Suspend a thread, placing it in hibernation. | |
| uint32_t STDCALL | thread_resume (THREAD_HANDLE thread) |
| Resume a suspended thread, making it ready. | |
| uint32_t STDCALL | thread_wait_message (void) |
| Make the current thread wait until a message is received (indefinitely). | |
| uint32_t STDCALL | thread_send_message (THREAD_HANDLE thread, THREAD_MESSAGE *message) |
| Send a message to another thread. | |
| uint32_t STDCALL | thread_receive_message (THREAD_MESSAGE *message) |
| Make the current thread wait to receive a message (indefinitely). | |
| uint32_t STDCALL | thread_receive_message_ex (THREAD_MESSAGE *message, uint32_t timeout, BOOL remove) |
| Make the current thread wait to receive a message. | |
| uint32_t STDCALL | thread_abandon_message (THREAD_HANDLE thread) |
| Tell another thread to abandon waiting for a message. | |
| uint32_t STDCALL | thread_lock (THREAD_HANDLE thread) |
| Lock a thread allowing access to internal structures such as the thread stack. | |
| uint32_t STDCALL | thread_unlock (THREAD_HANDLE thread) |
| Unlok a thread that was locked by ThreadLock. | |
| uint32_t STDCALL | scheduler_check (uint32_t cpuid) |
| Check if the sleep queue is empty, if not then decrement the first key Then check if the timeout queue is empty, if not then decrement the first key. | |
| uint32_t STDCALL | scheduler_wakeup (uint32_t cpuid) |
| Remove all threads from the sleep queue that have no more time to sleep. | |
| uint32_t STDCALL | scheduler_expire (uint32_t cpuid) |
| Remove all threads from the timeout queue that have no more time to wait. | |
| THREAD_HANDLE STDCALL | scheduler_switch (uint32_t cpuid, THREAD_HANDLE thread) |
| Perform a preemptive thread switch operation under an interrupt handler. | |
| THREAD_HANDLE STDCALL | scheduler_select (uint32_t cpuid, THREAD_HANDLE thread, BOOL yield) |
| Select the next thread to be run based on state, yield, quantum and priority. | |
| uint32_t STDCALL | scheduler_reschedule (BOOL yield) |
| Perform a thread switch operation when a thread yields, sleeps or waits. | |
| uint32_t STDCALL | scheduler_migration_enable (void) |
| Enable scheduler thread migration. | |
| uint32_t STDCALL | scheduler_migration_disable (void) |
| Disable scheduler thread migration. | |
| uint32_t STDCALL | scheduler_preempt_enable (uint32_t cpuid) |
| Enable thread preemption for the specified CPU. | |
| uint32_t STDCALL | scheduler_preempt_disable (uint32_t cpuid) |
| Disable thread preemption for the specified CPU. | |
| uint32_t STDCALL | scheduler_allocation_enable (uint32_t cpuid) |
| Enable thread allocation for the specified CPU. | |
| uint32_t STDCALL | scheduler_allocation_disable (uint32_t cpuid) |
| Disable thread allocation for the specified CPU. | |
| MESSAGESLOT_HANDLE STDCALL | messageslot_create (void) |
| Create and insert a new Messageslot entry. | |
| MESSAGESLOT_HANDLE STDCALL | messageslot_create_ex (uint32_t maximum, uint32_t flags) |
| Create and insert a new Messageslot entry. | |
| uint32_t STDCALL | messageslot_destroy (MESSAGESLOT_HANDLE messageslot) |
| Destroy and remove an existing Messageslot entry. | |
| uint32_t STDCALL | messageslot_count (MESSAGESLOT_HANDLE messageslot) |
| Get the number of available messages in a Messageslot entry. | |
| uint32_t STDCALL | messageslot_send (MESSAGESLOT_HANDLE messageslot, THREAD_MESSAGE *message) |
| Send a message to a Messageslot. | |
| uint32_t STDCALL | messageslot_receive (MESSAGESLOT_HANDLE messageslot, THREAD_MESSAGE *message) |
| Receive a message from a Messageslot. | |
| uint32_t STDCALL | messageslot_receive_ex (MESSAGESLOT_HANDLE messageslot, THREAD_MESSAGE *message, uint32_t timeout) |
| Receive a message from a Messageslot. | |
| MAILSLOT_HANDLE STDCALL | mailslot_create (uint32_t maximum) |
| Create and insert a new Mailslot entry. | |
| uint32_t STDCALL | mailslot_destroy (MAILSLOT_HANDLE mailslot) |
| Destroy and remove an existing Mailslot entry. | |
| uint32_t STDCALL | mailslot_count (MAILSLOT_HANDLE mailslot) |
| Get the number of available messages in a Mailslot entry. | |
| uint32_t STDCALL | mailslot_send (MAILSLOT_HANDLE mailslot, ssize_t data) |
| Send a message to a Mailslot. | |
| uint32_t STDCALL | mailslot_send_ex (MAILSLOT_HANDLE mailslot, ssize_t data, uint32_t timeout) |
| Send a message to a Mailslot. | |
| ssize_t STDCALL | mailslot_receive (MAILSLOT_HANDLE mailslot) |
| Receive a message from a Mailslot. | |
| ssize_t STDCALL | mailslot_receive_ex (MAILSLOT_HANDLE mailslot, uint32_t timeout) |
| Receive a message from a Mailslot. | |
| BUFFER_HANDLE STDCALL | buffer_create (uint32_t size, uint32_t count) |
| Create and insert a new Buffer entry. | |
| BUFFER_HANDLE STDCALL | buffer_create_ex (uint32_t size, uint32_t count, uint32_t flags) |
| Create and insert a new Buffer entry. | |
| uint32_t STDCALL | buffer_destroy (BUFFER_HANDLE buffer) |
| Destroy and remove an existing Buffer entry. | |
| uint32_t STDCALL | buffer_count (BUFFER_HANDLE buffer) |
| Get the total count of buffers in an existing Buffer entry. | |
| uint32_t STDCALL | buffer_available (BUFFER_HANDLE buffer) |
| Get the available count of buffers in an existing Buffer entry. | |
| void *STDCALL | buffer_get (BUFFER_HANDLE buffer) |
| Allocate an available buffer from an existing Buffer entry. | |
| void *STDCALL | buffer_get_ex (BUFFER_HANDLE buffer, uint32_t timeout) |
| Allocate an available buffer from an existing Buffer entry. | |
| uint32_t STDCALL | buffer_free (void *buffer) |
| Release a allocated buffer from an existing Buffer entry. | |
| void *STDCALL | buffer_iterate (BUFFER_HANDLE buffer, void *previous) |
| Iterate through each of the buffers in an existing Buffer entry. | |
| EVENT_HANDLE STDCALL | event_create (BOOL manualreset, BOOL initialstate) |
| Create and insert a new Event entry. | |
| EVENT_HANDLE STDCALL | event_create_ex (uint32_t flags) |
| Create and insert a new Event entry. | |
| uint32_t STDCALL | event_destroy (EVENT_HANDLE event) |
| Destroy and remove an existing Event entry. | |
| uint32_t STDCALL | event_state (EVENT_HANDLE event) |
| Get the current state of an existing Event entry. | |
| uint32_t STDCALL | event_wait (EVENT_HANDLE event) |
| Wait on an existing Event entry. | |
| uint32_t STDCALL | event_wait_ex (EVENT_HANDLE event, uint32_t timeout) |
| Wait on an existing Event entry. | |
| uint32_t STDCALL | event_set (EVENT_HANDLE event) |
| Set (Signal) an existing Event entry. | |
| uint32_t STDCALL | event_reset (EVENT_HANDLE event) |
| Reset (Unsignal) an existing Event entry. | |
| uint32_t STDCALL | event_pulse (EVENT_HANDLE event) |
| Pulse (Set then Reset) an existing Event entry. | |
| TIMER_HANDLE STDCALL | timer_create (uint32_t interval, BOOL enabled, BOOL reschedule, timer_event_proc event, void *data) |
| Create and insert a new Timer entry. | |
| TIMER_HANDLE STDCALL | timer_create_ex (uint32_t interval, uint32_t state, uint32_t flags, timer_event_proc event, void *data) |
| Create and insert a new Timer entry. | |
| uint32_t STDCALL | timer_destroy (TIMER_HANDLE timer) |
| Destroy and remove an existing Timer entry. | |
| uint32_t STDCALL | timer_enable (TIMER_HANDLE timer) |
| Enable an existing Timer entry (Timer events will be generated). | |
| uint32_t STDCALL | timer_enable_ex (TIMER_HANDLE timer, uint32_t interval, timer_event_proc event, void *data) |
| Enable and update an existing Timer entry (Timer events will be generated). | |
| uint32_t STDCALL | timer_disable (TIMER_HANDLE timer) |
| Disable an existing Timer entry (Timer events will not be generated). | |
| TIMER_HANDLE STDCALL | timer_dequeue (void) |
| Get and remove the first timer from the Timer list. | |
| int STDCALL | timer_first_key (void) |
| Get the first Key value from the Timer list. | |
| uint32_t STDCALL | timer_insert_key (TIMER_HANDLE timer, int key) |
| Insert the supplied timer in the Timer list in delta ascending order based on Key. | |
| uint32_t STDCALL | timer_delete_key (TIMER_HANDLE timer) |
| Delete the supplied timer from the Timer list. | |
| int STDCALL | timer_decrement_key (void) |
| Decrement the first Key value in the Timer list. | |
| BOOL STDCALL | timer_is_empty (void) |
| Check if the Timer list is empty. | |
| BOOL STDCALL | timer_not_empty (void) |
| Check if the Timer list is not empty. | |
| uint32_t STDCALL | timer_check (void) |
| Check if the timer list is empty, if not then decrement the first key. | |
| uint32_t STDCALL | timer_trigger (void) |
| Remove all entries from the timer list that have reached their interval. | |
| uint32_t STDCALL | worker_schedule (uint32_t interval, worker_task_proc task, void *data, worker_cb callback) |
| Schedule a task to be performed by a worker thread now or in the future. | |
| WORKER_HANDLE STDCALL | worker_schedule_ex (uint32_t interval, uint32_t flags, worker_task_proc task, void *data, worker_cb callback) |
| Schedule a task to be performed by a worker thread now or in the future. | |
| uint32_t STDCALL | worker_cancel (WORKER_HANDLE worker) |
| Cancel a previously scheduled worker thread task. | |
| uint32_t STDCALL | worker_schedule_irq (uint32_t affinity, worker_task_proc task, void *data, worker_cb callback) |
| Schedule a task to be performed by a worker thread when the caller is an IRQ handler. | |
| uint32_t STDCALL | worker_schedule_irq_ex (uint32_t affinity, uint32_t flags, worker_task_proc task, void *data, worker_cb callback) |
| Schedule a task to be performed by a worker thread when the caller is an IRQ handler. | |
| uint32_t STDCALL | worker_schedule_fiq (uint32_t affinity, worker_task_proc task, void *data, worker_cb callback) |
| Schedule a task to be performed by a worker thread when the caller is an FIQ handler. | |
| uint32_t STDCALL | worker_schedule_fiq_ex (uint32_t affinity, uint32_t flags, worker_task_proc task, void *data, worker_cb callback) |
| Schedule a task to be performed by a worker thread when the caller is an FIQ handler. | |
| uint32_t STDCALL | worker_increase (uint32_t count) |
| Increase the number of worker threads available. | |
| uint32_t STDCALL | worker_increase_ex (uint32_t count, BOOL priority) |
| Increase the number of worker threads available. | |
| uint32_t STDCALL | worker_decrease (uint32_t count) |
| Decrease the number of worker threads available. | |
| uint32_t STDCALL | worker_decrease_ex (uint32_t count, BOOL priority) |
| Decrease the number of worker threads available. | |
| uint32_t STDCALL | tasker_thread_send_message (THREAD_HANDLE thread, THREAD_MESSAGE *message) |
| Perform a ThreadSendMessage() function call using the tasker list. | |
| uint32_t STDCALL | tasker_messageslot_send (MESSAGESLOT_HANDLE messageslot, THREAD_MESSAGE *message) |
| Perform a MessageslotSend() function call using the tasker list. | |
| uint32_t STDCALL | tasker_semaphore_signal (SEMAPHORE_HANDLE semaphore, uint32_t count) |
| Perform a SemaphoreSignal() function call using the tasker list. | |
| uint32_t STDCALL | tasker_completion_reset (COMPLETION_HANDLE completion) |
| Perform a CompletionReset() function call using the tasker list. | |
| uint32_t STDCALL | tasker_completion_complete (COMPLETION_HANDLE completion, BOOL all) |
| Perform a CompletionComplete() or CompletionCompleteAll() function call using the tasker list. | |
| uint32_t STDCALL | tasker_enqueue (TASKER_TASK *task) |
| Add the supplied task to the end of the Tasker list. | |
| TASKER_TASK *STDCALL | tasker_dequeue (void) |
| Get and remove the first task from the Tasker list. | |
| uint32_t STDCALL | tasker_check (void) |
| Check if the tasker list is empty or contains tasks. | |
| uint32_t STDCALL | tasker_trigger (void) |
| Dequeue all tasks in the tasker list and perform the requested task for each. | |
| THREAD_ID STDCALL | begin_thread (void *signalaction, size_t stacksize, thread_func threadfunction, void *threadparameter, uint32_t creationflags, THREAD_ID *threadid) |
| Start a new thread. | |
| THREAD_ID STDCALL | begin_thread_ex (void *signalaction, size_t stacksize, thread_func threadfunction, void *threadparameter, uint32_t creationflags, uint32_t priority, uint32_t affinity, uint32_t cpu, const char *name, THREAD_ID *threadid) |
| Start a new thread. | |
| void STDCALL | end_thread (uint32_t exitcode) |
| End the current thread. | |
| uint32_t STDCALL | spin_get_count (void) |
| Get the current spin lock count. | |
| uint32_t STDCALL | mutex_get_count (void) |
| Get the current mutex count. | |
| uint32_t STDCALL | critical_section_get_count (void) |
| Get the current critical section count. | |
| uint32_t STDCALL | semaphore_get_count (void) |
| Get the current semaphore count. | |
| uint32_t STDCALL | synchronizer_get_count (void) |
| Get the current synchronizer count. | |
| uint32_t STDCALL | condition_get_count (void) |
| Get the current condition count. | |
| uint32_t STDCALL | completion_get_count (void) |
| Get the current completion count. | |
| uint32_t STDCALL | list_get_count (void) |
| Get the current list count. | |
| uint32_t STDCALL | queue_get_count (void) |
| Get the current queue count. | |
| uint32_t STDCALL | thread_get_count (void) |
| Get the current thread count. | |
| uint32_t STDCALL | thread_tls_get_count (void) |
| Get the current thread tls count. | |
| void *STDCALL | thread_allocate_stack (uint32_t stacksize) |
| Allocate memory for a new thread stack. | |
| void STDCALL | thread_release_stack (void *stackbase, uint32_t stacksize) |
| Release a thread stack allocated with ThreadAllocateStack. | |
| void *STDCALL | thread_setup_stack (void *stackbase, thread_start_proc startproc, thread_end_proc returnproc, void *parameter) |
| THREAD_SNAPSHOT *STDCALL | thread_snapshot_create (void) |
| uint32_t STDCALL | thread_snapshot_destroy (THREAD_SNAPSHOT *snapshot) |
| uint32_t STDCALL | messageslot_get_count (void) |
| Get the current messageslot count. | |
| uint32_t STDCALL | mailslot_get_count (void) |
| Get the current mailslot count. | |
| uint32_t STDCALL | buffer_get_count (void) |
| Get the current buffer count. | |
| uint32_t STDCALL | event_get_count (void) |
| Get the current event count. | |
| uint32_t STDCALL | timer_get_count (void) |
| Get the current timer count. | |
| uint32_t STDCALL | worker_get_count (void) |
| Get the current worker thread count. | |
| uint32_t STDCALL | worker_get_priority_count (void) |
| Get the current worker priority thread count. | |
| uint32_t STDCALL | tasker_get_count (void) |
| Get the current tasker count. | |
| uint32_t STDCALL | list_type_to_string (uint32_t listtype, char *string, uint32_t len) |
| uint32_t STDCALL | queue_type_to_string (uint32_t queuetype, char *string, uint32_t len) |
| uint32_t STDCALL | thread_type_to_string (uint32_t threadtype, char *string, uint32_t len) |
| uint32_t STDCALL | thread_state_to_string (uint32_t threadstate, char *string, uint32_t len) |
| uint32_t STDCALL | thread_priority_to_string (uint32_t threadpriority, char *string, uint32_t len) |
| uint32_t STDCALL | scheduler_get_list_flags (uint32_t listtype) |
| Get the list flags for the specified type of list. | |
| uint32_t STDCALL | scheduler_get_queue_flags (uint32_t queuetype) |
| Get the queue flags for the specified type of scheduler queue. | |
| QUEUE_HANDLE STDCALL | scheduler_get_queue_handle (uint32_t cpuid, uint32_t queuetype) |
| Get the queue handle for the specified type of scheduler queue on the specified CPU. | |
| QUEUE_HANDLE STDCALL | scheduler_get_queue_handle_ex (uint32_t cpuid, uint32_t priority) |
| Get the queue handle for the specified thread priority on the specified CPU. | |
| uint32_t STDCALL | scheduler_get_thread_count (uint32_t cpuid) |
| Get the thread count for the specified CPU. | |
| uint32_t STDCALL | scheduler_get_thread_quantum (uint32_t cpuid) |
| Get the current thread quantum for the specified CPU. | |
| THREAD_HANDLE STDCALL | scheduler_get_thread_handle (uint32_t cpuid, uint32_t threadtype) |
| Get the thread handle for the specified type of thread on the specified CPU. | |
| uint32_t STDCALL | scheduler_get_priority_mask (uint32_t cpuid) |
| Get the current priority mask for the specified CPU. | |
| uint32_t STDCALL | scheduler_get_priority_quantum (uint32_t priority) |
| Get the scheduler quantum for the specified thread priority. | |
| uint32_t STDCALL | scheduler_set_priority_quantum (uint32_t priority, uint32_t quantum) |
| Set the scheduler quantum for the specified thread priority. | |
| uint32_t STDCALL | scheduler_get_migration_quantum (void) |
| Get the current migration quantum. | |
| uint32_t STDCALL | scheduler_get_starvation_quantum (uint32_t cpuid) |
| Get the current starvation quantum for the specified CPU. | |
| uint32_t STDCALL | scheduler_get_thread_next (void) |
| Get the next CPU for thread allocation. | |
| uint32_t STDCALL | scheduler_get_thread_migration (void) |
| Get the current thread migration setting. | |
| uint32_t STDCALL | scheduler_get_thread_preempt (uint32_t cpuid) |
| Get the current thread preempt setting for the specified CPU. | |
| uint32_t STDCALL | scheduler_get_thread_allocation (uint32_t cpuid) |
| Get the current thread allocation setting for the specified CPU. | |
| uint32_t STDCALL | scheduler_migration_to_string (uint32_t migration, char *string, uint32_t len) |
| uint32_t STDCALL | scheduler_preempt_to_string (uint32_t preempt, char *string, uint32_t len) |
| uint32_t STDCALL | scheduler_allocation_to_string (uint32_t allocation, char *string, uint32_t len) |
| uint32_t STDCALL | timer_get_list_flags (void) |
| Get the lock flags for the timer list. | |
| uint32_t STDCALL | timer_get_messageslot_flags (void) |
| Get the lock flags for the timer messageslot. | |
| uint32_t STDCALL | worker_get_messageslot_flags (void) |
| Get the lock flags for the worker messageslot. | |
| #define LOCK_FLAG_NONE 0x00000000 |
Thread specific constants Lock constants
| #define LOCK_FLAG_IRQ 0x00000001 |
| #define LOCK_FLAG_FIQ 0x00000002 |
| #define LOCK_FLAG_IRQFIQ 0x00000004 |
| #define SPIN_SIGNATURE 0x0FEC3B82 |
Spin constants
| #define SPIN_STATE_UNLOCKED 0 |
Spin state constants
| #define SPIN_STATE_LOCKED 1 |
| #define MUTEX_SIGNATURE 0x1C5D7FA4 |
Mutex constants
| #define MUTEX_STATE_UNLOCKED 0 |
Mutex state constants
| #define MUTEX_STATE_LOCKED 1 |
| #define MUTEX_FLAG_NONE 0x00000000 |
Mutex flags constants
| #define MUTEX_FLAG_RECURSIVE 0x00000001 |
Mutex can be locked multiple times by the same thread if set (Must be unlocked the same number of times).
| #define MUTEX_FLAG_ERRORCHECK 0x00000002 |
Mutex will perform a deadlock check if set, will return with an error if already owned by the same thread (and not recursive).
| #define CRITICAL_SECTION_SIGNATURE 0x25F3AE01 |
Critical Section constants
| #define CRITICAL_SECTION_STATE_UNLOCKED 0 |
Critical Section state constants
| #define CRITICAL_SECTION_STATE_LOCKED 1 |
| #define SEMAPHORE_SIGNATURE 0x390A1EB4 |
Semaphore constants
| #define SEMAPHORE_FLAG_NONE LOCK_FLAG_NONE |
Semaphore flag constants
| #define SEMAPHORE_FLAG_IRQ LOCK_FLAG_IRQ |
| #define SEMAPHORE_FLAG_FIQ LOCK_FLAG_FIQ |
| #define SEMAPHORE_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
| #define SYNCHRONIZER_SIGNATURE 0xC5D081FB |
Synchronizer constants
| #define SYNCHRONIZER_STATE_UNLOCKED 0 |
Synchronizer state constants
| #define SYNCHRONIZER_STATE_READER_LOCKED 1 |
| #define SYNCHRONIZER_STATE_WRITER_LOCKED 2 |
| #define SYNCHRONIZER_FLAG_NONE 0x00000000 |
Synchronizer flag constants
| #define SYNCHRONIZER_FLAG_READ_PRIORITY 0x00000001 |
Synchronizer prioritises readers over writers.
| #define SYNCHRONIZER_FLAG_WRITE_PRIORITY 0x00000002 |
Synchronizer prioritises writers over readers.
| #define CONDITION_SIGNATURE 0xD14D3C0A |
Condition constants
| #define CONDITION_FLAG_NONE 0x00000000 |
Condition flag constants
| #define CONDITION_LOCK_FLAG_NONE 0x00000000 |
Condition lock flag constants
| #define CONDITION_LOCK_FLAG_WRITER 0x00000001 |
Condition should release and acquire the writer lock on a Synchronizer when ConditionWaitSynchronizer is called (otherwise release and acquire the reader lock).
| #define COMPLETION_SIGNATURE 0xFCE24CA1 |
Completion constants
| #define COMPLETION_STATE_RESET 0 |
Completion state constants
| #define COMPLETION_STATE_COMPLETE 1 |
| #define COMPLETION_FLAG_NONE LOCK_FLAG_NONE |
Completion flag constants
| #define COMPLETION_FLAG_IRQ LOCK_FLAG_IRQ |
Disable IRQ during completion operations (Wait/Reset/Complete).
| #define COMPLETION_FLAG_FIQ LOCK_FLAG_FIQ |
Disable FIQ during completion operations (Wait/Reset/Complete).
| #define COMPLETION_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
Disable IRQ and FIQ during completion operations (Wait/Reset/Complete).
| #define COMPLETION_FLAG_COUNTED 0x00000008 |
Use a counted value instead of a single state (Affects behaviour of Wait and Complete).
| #define LIST_SIGNATURE 0x4A98BE2A |
List constants
| #define LIST_TYPE_NOT_SPECIFIED 0 |
A generic thread list without a specific purpose.
List type constants
| #define LIST_TYPE_WAIT_SECTION 1 |
A Critical Section Wait List.
| #define LIST_TYPE_WAIT_SEMAPHORE 2 |
A Semaphore Wait List.
| #define LIST_TYPE_WAIT_SYNCHRONIZER 3 |
A Synchronizer Wait List.
| #define LIST_TYPE_WAIT_CONDITION 4 |
A Condition Wait List.
| #define LIST_TYPE_WAIT_COMPLETION 5 |
A Condition Wait List.
| #define LIST_TYPE_WAIT_EVENT 6 |
An Event Wait List.
| #define LIST_TYPE_WAIT_THREAD 7 |
A Thread Wait List.
| #define LIST_TYPE_WAIT_MESSAGESLOT 8 |
A Messageslot Wait List.
| #define LIST_TYPE_WAIT_OTHER 9 |
Another type of Wait List (Suitable for passing to ThreadWait/ThreadWaitEx/ThreadWaitMultiple/ThreadRelease).
| #define LIST_FLAG_NONE LOCK_FLAG_NONE |
List flag constants
| #define LIST_FLAG_IRQ LOCK_FLAG_IRQ |
| #define LIST_FLAG_FIQ LOCK_FLAG_FIQ |
| #define LIST_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
| #define QUEUE_SIGNATURE 0x57A3BF9E |
Queue constants
| #define QUEUE_TYPE_NOT_SPECIFIED 0 |
A generic thread queue without a specific purpose.
Queue type constants
| #define QUEUE_TYPE_SCHEDULE_SLEEP 1 |
A Scheduler Sleep Queue.
| #define QUEUE_TYPE_SCHEDULE_TIMEOUT 2 |
A Scheduler Timeout Queue.
| #define QUEUE_TYPE_SCHEDULE_TERMINATION 3 |
A Scheduler Termination Queue (Threads are placed on termination queue when they exit or are terminated).
| #define QUEUE_TYPE_SCHEDULE_NONE 4 |
A Scheduler No Priority Queue (Only used for IRQ/FIQ threads which are never selected for scheduling).
| #define QUEUE_TYPE_SCHEDULE_IDLE 5 |
A Scheduler Idle Priority Queue.
| #define QUEUE_TYPE_SCHEDULE_LOWEST 6 |
A Scheduler Lowest Priority Queue.
| #define QUEUE_TYPE_SCHEDULE_LOWER 7 |
A Scheduler Lower Priority Queue.
| #define QUEUE_TYPE_SCHEDULE_NORMAL 8 |
A Scheduler Normal Priority Queue.
| #define QUEUE_TYPE_SCHEDULE_HIGHER 9 |
A Scheduler Higher Priority Queue.
| #define QUEUE_TYPE_SCHEDULE_HIGHEST 10 |
A Scheduler Highest Priority Queue.
| #define QUEUE_TYPE_SCHEDULE_CRITICAL 11 |
A Scheduler Critical Priority Queue.
| #define QUEUE_FLAG_NONE LOCK_FLAG_NONE |
Queue flag constants
| #define QUEUE_FLAG_IRQ LOCK_FLAG_IRQ |
| #define QUEUE_FLAG_FIQ LOCK_FLAG_FIQ |
| #define QUEUE_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
| #define QUEUE_FLAG_DESCENDING 0x00000008 |
| #define QUEUE_FLAG_DELTA 0x00000010 |
| #define QUEUE_KEY_NONE (int32_t)0x7FFFFFFF |
Null key value returned from an empty Queue.
Queue key constants
| #define QUEUE_KEY_MAX (int32_t)0x7FFFFFFE |
Max key that can be ordered in a Queue.
| #define QUEUE_KEY_MIN (int32_t)0x80000000 |
Min key that can be ordered in a Queue.
| #define THREAD_SIGNATURE 0x6C2BA10F |
Thread constants
| #define THREAD_TYPE_NORMAL 0 |
A Normal thread (No special case handling).
Thread type constants
| #define THREAD_TYPE_IDLE 1 |
An Idle thread (Used to calculate ultilization and provide an always ready thread).
| #define THREAD_TYPE_IRQ 2 |
An IRQ thread (Used by the IRQ handler during interrupt time).
| #define THREAD_TYPE_FIQ 3 |
An FIQ thread (Used by the FIQ handler during interrupt time).
| #define THREAD_TYPE_SWI 4 |
A Software Interrupt (SWI) thread (Used by the SWI handler during a system call).
| #define THREAD_FLAG_NONE 0x00000000 |
Thread flag constants
| #define THREAD_FLAG_PERSIST 0x00000001 |
If set thread handle will persist until explicitly destroyed (Otherwise destroyed after termination quantum has elapsed).
| #define THREAD_FLAG_CANCELLED 0x00000002 |
Indicates that thread has been cancelled, for support of external thread APIs (eg pThreads)(Not used internally by Ultibo).
| #define THREAD_FLAG_CANCEL_DISABLE 0x00000004 |
Indicates that thread cancellation is disabled for a thread, for support of external thread APIs (eg pThreads)(Not used internally by Ultibo).
| #define THREAD_FLAG_CANCEL_ASYNCHRONOUS 0x00000008 |
Indicates that asynchronous thread cancellation is enabled for a thread, for support of external thread APIs (eg pThreads)(Not used internally by Ultibo).
| #define THREAD_FLAG_INTERNAL THREAD_FLAG_NONE + 0x80000000 |
Note: Temporary value to avoid warning.
| #define THREAD_STATE_RUNNING 1 |
Thread is currently running.
Thread state constants
| #define THREAD_STATE_READY 2 |
Thread is on ready queue.
| #define THREAD_STATE_SLEEP 3 |
Thread is sleeping.
| #define THREAD_STATE_SUSPENDED 4 |
Thread is suspended.
| #define THREAD_STATE_WAIT 5 |
Thread is on a wait list.
| #define THREAD_STATE_WAIT_TIMEOUT 6 |
Thread is on a wait list with timeout.
| #define THREAD_STATE_RECEIVE 7 |
Thread is waiting to receive a message.
| #define THREAD_STATE_RECEIVE_TIMEOUT 8 |
Thread is waiting to receive a message with timeout.
| #define THREAD_STATE_HALTED 9 |
Thread has been halted (Due to an unhandled exception etc).
| #define THREAD_STATE_TERMINATED 10 |
Thread has been terminated
| #define THREAD_PRIORITY_NONE 0 |
To Do THREAD_STATE_SEND / THREAD_STATE_SEND_TIMEOUT ? //Who would wake them up ? //Timeout is ok, but what about send only ?
Thread priority constants Only used for IRQ/FIQ threads which are never selected for scheduling
| #define THREAD_PRIORITY_IDLE 1 |
| #define THREAD_PRIORITY_LOWEST 2 |
| #define THREAD_PRIORITY_LOWER 3 |
| #define THREAD_PRIORITY_NORMAL 4 |
| #define THREAD_PRIORITY_HIGHER 5 |
| #define THREAD_PRIORITY_HIGHEST 6 |
| #define THREAD_PRIORITY_CRITICAL 7 |
| #define THREAD_PRIORITY_DEFAULT THREAD_PRIORITY_NORMAL |
Default thread priority.
| #define THREAD_PRIORITY_MINIMUM THREAD_PRIORITY_IDLE |
Minimum thread priority.
| #define THREAD_PRIORITY_MAXIMUM THREAD_PRIORITY_CRITICAL |
Maximum thread priority.
| #define THREAD_PRIORITY_COUNT THREAD_PRIORITY_MAXIMUM + 1 |
Number of thread priority levels.
| #define THREAD_PRIORITY_BELOW_NORMAL THREAD_PRIORITY_LOWER |
Additional priority aliases for compatibility
| #define THREAD_PRIORITY_ABOVE_NORMAL THREAD_PRIORITY_HIGHER |
| #define THREAD_PRIORITY_TIME_CRITICAL THREAD_PRIORITY_CRITICAL |
| #define THREAD_NAME_LENGTH SIZE_64 |
Length of thread name.
Thread name constants
| #define IRQ_THREAD_NAME "IRQ" |
| #define FIQ_THREAD_NAME "FIQ" |
| #define SWI_THREAD_NAME "SWI" |
| #define IDLE_THREAD_NAME "Idle" |
| #define MAIN_THREAD_NAME "Main" |
| #define TIMER_THREAD_NAME "Timer" |
| #define WORKER_THREAD_NAME "Worker" |
| #define TIMER_PRIORITY_THREAD_NAME "Priority Timer" |
| #define WORKER_PRIORITY_THREAD_NAME "Priority Worker" |
| #define RTL_THREAD_NAME "RTL Thread" |
| #define TIMER_THREAD_PRIORITY THREAD_PRIORITY_NORMAL |
Thread priority constants
| #define WORKER_THREAD_PRIORITY THREAD_PRIORITY_NORMAL |
| #define TIMER_PRIORITY_THREAD_PRIORITY THREAD_PRIORITY_HIGHEST |
| #define WORKER_PRIORITY_THREAD_PRIORITY THREAD_PRIORITY_HIGHER |
| #define THREAD_CREATE_NONE 0x00000000 |
Thread create constants
| #define THREAD_CREATE_SUSPENDED 0x00000004 |
| #define THREAD_TLS_FREE 0x00000000 |
Thread TLS constants
| #define THREAD_TLS_USED 0x00000001 |
| #define THREAD_TLS_INVALID 0xFFFFFFFF |
| #define THREAD_TLS_MAXIMUM SIZE_64 |
The maximum number TLS index slots available.
| #define THREAD_TLS_FLAG_NONE 0x00000000 |
Thread TLS flag constants
| #define THREAD_TLS_FLAG_FREE 0x00000001 |
If set then pointer in thread TLS index will be freed on ThreadReleaseTlsIndex or ThreadDestroy.
| #define THREAD_LISTS_MAXIMUM SIZE_64 |
Maximum number of lists a thread can wait on at the same time.
Thread wait constants
| #define MESSAGESLOT_SIGNATURE 0xB631CE4B |
Messageslot constants
| #define MESSAGESLOT_FLAG_NONE LOCK_FLAG_NONE |
Messageslot flag constants
| #define MESSAGESLOT_FLAG_IRQ LOCK_FLAG_IRQ |
| #define MESSAGESLOT_FLAG_FIQ LOCK_FLAG_FIQ |
| #define MESSAGESLOT_FLAG_IRQFIQ LOCK_FLAG_IRQFIQ |
| #define MAILSLOT_SIGNATURE 0x7A409BF3 |
Mailslot constants
| #define BUFFER_SIGNATURE 0x830BEA71 |
Buffer constants
| #define BUFFER_FLAG_NONE 0x00000000 |
Buffer flag constants
| #define BUFFER_FLAG_SHARED 0x00000001 |
If set the buffer memory (Not the buffer entry itself) is allocated from shared memory.
| #define EVENT_SIGNATURE 0x903BA69D |
Event constants
| #define EVENT_STATE_UNSIGNALED 0 |
Event state constants
| #define EVENT_STATE_SIGNALED 1 |
| #define EVENT_FLAG_NONE 0x00000000 |
Event flag constants
| #define EVENT_FLAG_INITIAL_STATE 0x00000001 |
| #define EVENT_FLAG_MANUAL_RESET 0x00000002 |
| #define TIMER_SIGNATURE 0xAB7E07FB |
Timer constants
| #define TIMER_STATE_DISABLED 0 |
Timer state constants
| #define TIMER_STATE_ENABLED 1 |
| #define TIMER_FLAG_NONE 0x00000000 |
Timer flag constants
| #define TIMER_FLAG_RESCHEDULE 0x00000001 |
Timer should be rescheduled each time the event completes.
| #define TIMER_FLAG_IMMEDIATE 0x00000002 |
Timer event should be executed immediately and then each interval milliseconds.
| #define TIMER_FLAG_WORKER 0x00000004 |
Timer event should be executed by a worker thread instead of a timer thread.
| #define TIMER_FLAG_PRIORITY 0x00000008 |
Timer event should be executed by a priority timer thread.
| #define TIMER_KEY_NONE (int32_t)0x7FFFFFFF |
Null key value returned from an empty Timer list.
Timer key constants
| #define TIMER_KEY_MAX (int32_t)0x7FFFFFFE |
Max key that can be ordered in a Timer list.
| #define TIMER_KEY_MIN (int32_t)0x80000000 |
Min key that can be ordered in a Timer list.
| #define WORKER_SIGNATURE 0xEF6A901B |
Worker constants
| #define WORKER_FLAG_NONE 0x00000000 |
Worker flag constants
| #define WORKER_FLAG_RESCHEDULE 0x00000001 |
Worker task should be rescheduled each time the task completes.
| #define WORKER_FLAG_IMMEDIATE 0x00000002 |
Worker task should be executed immediately and then each interval milliseconds.
| #define WORKER_FLAG_CANCEL 0x00000004 |
Internal flag to indicate the worker task should be cancelled next time the interval expires.
| #define WORKER_FLAG_NOFREE 0x00000008 |
Internal flag to tell worker execute not to free the worker request when it is completed.
| #define WORKER_FLAG_TERMINATE 0x00000010 |
Internal flag to tell worker execute to terminate the worker thread.
| #define WORKER_FLAG_IRQ 0x00000020 |
Internal flag to tell worker execute to free IRQ memory when the request is completed.
| #define WORKER_FLAG_FIQ 0x00000040 |
Internal flag to tell worker execute to free FIQ memory when the request is completed.
| #define WORKER_FLAG_PRIORITY 0x00000080 |
Worker task should be executed by a priority worker thread.
| #define WORKER_FLAG_INTERNAL WORKER_FLAG_CANCEL | WORKER_FLAG_NOFREE | WORKER_FLAG_TERMINATE | WORKER_FLAG_IRQ | WORKER_FLAG_FIQ |
Internal only flags.
| #define WORKER_FLAG_EXCLUDED_IRQ WORKER_FLAG_RESCHEDULE | WORKER_FLAG_IMMEDIATE |
Excluded flags.
| #define WORKER_FLAG_EXCLUDED_FIQ WORKER_FLAG_RESCHEDULE | WORKER_FLAG_IMMEDIATE |
Excluded flags.
| #define TASKER_TASK_THREADSENDMESSAGE 1 |
Perform a ThreadSendMessage() function using the tasker list.
Tasker task constants
| #define TASKER_TASK_MESSAGESLOTSEND 2 |
Perform a MessageslotSend() function using the tasker list.
| #define TASKER_TASK_SEMAPHORESIGNAL 3 |
Perform a SemaphoreSignal() function using the tasker list.
| #define TASKER_TASK_COMPLETIONRESET 4 |
Perform a CompletionReset() function using the tasker list.
| #define TASKER_TASK_COMPLETIONCOMPLETE 5 |
Perform a CompletionComplete() or CompletionCompleteAll() function using the tasker list.
| #define SCHEDULER_MIGRATION_DISABLED 0 |
Scheduler migration constants
| #define SCHEDULER_MIGRATION_ENABLED 1 |
| #define SCHEDULER_PREEMPT_DISABLED 0 |
Scheduler preempt constants
| #define SCHEDULER_PREEMPT_ENABLED 1 |
| #define SCHEDULER_ALLOCATION_DISABLED 0 |
Scheduler allocation constants
| #define SCHEDULER_ALLOCATION_ENABLED 1 |
| #define SCHEDULER_MASK_NONE (1 << THREAD_PRIORITY_NONE) |
Scheduler mask constants
| #define SCHEDULER_MASK_IDLE (1 << THREAD_PRIORITY_IDLE) |
| #define SCHEDULER_MASK_LOWEST (1 << THREAD_PRIORITY_LOWEST) |
| #define SCHEDULER_MASK_LOWER (1 << THREAD_PRIORITY_LOWER) |
| #define SCHEDULER_MASK_NORMAL (1 << THREAD_PRIORITY_NORMAL) |
| #define SCHEDULER_MASK_HIGHER (1 << THREAD_PRIORITY_HIGHER) |
| #define SCHEDULER_MASK_HIGHEST (1 << THREAD_PRIORITY_HIGHEST) |
| #define SCHEDULER_MASK_CRITICAL (1 << THREAD_PRIORITY_CRITICAL) |
| #define SCHEDULER_QUANTUM_NONE 0 |
Scheduler quantum constants
| #define SCHEDULER_QUANTUM_IDLE 0 |
| #define SCHEDULER_QUANTUM_LOWEST 1 |
| #define SCHEDULER_QUANTUM_LOWER 2 |
| #define SCHEDULER_QUANTUM_NORMAL 4 |
| #define SCHEDULER_QUANTUM_HIGHER 6 |
| #define SCHEDULER_QUANTUM_HIGHEST 8 |
| #define SCHEDULER_QUANTUM_CRITICAL 10 |
| typedef struct _SPIN_ENTRY SPIN_ENTRY |
Thread specific types See also Handle types in GlobalConst Spin entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _MUTEX_ENTRY MUTEX_ENTRY |
Mutex entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _CRITICAL_SECTION_ENTRY CRITICAL_SECTION_ENTRY |
Critical Section entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _SEMAPHORE_ENTRY SEMAPHORE_ENTRY |
Semaphore entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _SYNCHRONIZER_ENTRY SYNCHRONIZER_ENTRY |
Synchronizer entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _CONDITION_ENTRY CONDITION_ENTRY |
Condition entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _COMPLETION_ENTRY COMPLETION_ENTRY |
Completion entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _LIST_ELEMENT LIST_ELEMENT |
List entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _LIST_ENTRY LIST_ENTRY |
| typedef LIST_HANDLE LIST_HANDLES[THREAD_LISTS_MAXIMUM] |
List handles
| typedef struct _QUEUE_ELEMENT QUEUE_ELEMENT |
Queue entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _QUEUE_ENTRY QUEUE_ENTRY |
| typedef struct _THREAD_MESSAGE THREAD_MESSAGE |
Message list
| typedef struct _MESSAGE_LIST MESSAGE_LIST |
| typedef struct _THREAD_ENTRY THREAD_ENTRY |
Thread entry Note: Changes to this structure need to be accounted for in platform specific handlers
| typedef struct _THREAD_SNAPSHOT THREAD_SNAPSHOT |
Thread snapshot
| typedef struct _MESSAGESLOT_ENTRY MESSAGESLOT_ENTRY |
Messageslot entry
| typedef struct _MAILSLOT_ENTRY MAILSLOT_ENTRY |
Mailslot entry
| typedef struct _BUFFER_ITEM BUFFER_ITEM |
Buffer entry
| typedef struct _BUFFER_ENTRY BUFFER_ENTRY |
| typedef struct _EVENT_ENTRY EVENT_ENTRY |
Event entry
| typedef struct _TIMER_ITEM TIMER_ITEM |
Timer list
| typedef struct _TIMER_LIST TIMER_LIST |
| typedef struct _TIMER_ENTRY TIMER_ENTRY |
Timer entry
| typedef struct _WORKER_REQUEST WORKER_REQUEST |
Worker request
| typedef struct _TASKER_TASK TASKER_TASK |
Tasker list
| typedef struct _TASKER_LIST TASKER_LIST |
| typedef struct _TASKER_THREAD_SEND_MESSAGE TASKER_THREAD_SEND_MESSAGE |
Tasker ThreadSendMessage task
| typedef struct _TASKER_MESSAGESLOT_SEND TASKER_MESSAGESLOT_SEND |
Tasker MessageslotSend task
| typedef struct _TASKER_SEMAPHORE_SIGNAL TASKER_SEMAPHORE_SIGNAL |
Tasker SemaphoreSignal task
| typedef struct _TASKER_SEMAPHORE_RESET TASKER_SEMAPHORE_RESET |
Tasker CompletionReset task
| typedef struct _TASKER_SEMAPHORE_COMPLETE TASKER_SEMAPHORE_COMPLETE |
Tasker CompletionComplete task
| typedef ssize_t STDCALL(* thread_start_proc) (void *parameter) |
Prototypes for Thread Start/End Handlers
| typedef void STDCALL(* thread_end_proc) (uint32_t exitcode) |
| SPIN_HANDLE STDCALL spin_create | ( | void | ) |
Create and insert a new Spin entry.
Spin Functions
| SPIN_HANDLE STDCALL spin_create_ex | ( | BOOL | initialowner | ) |
Create and insert a new Spin entry.
| InitialOwner | If true set the state of the spin to locked and the owner to the current thread |
| uint32_t STDCALL spin_destroy | ( | SPIN_HANDLE | spin | ) |
Destroy and remove an existing Spin entry.
| Spin | Handle of Spin entry to destroy |
| THREAD_HANDLE STDCALL spin_owner | ( | SPIN_HANDLE | spin | ) |
Get the current owner of an existing Spin entry.
| Spin | Handle of Spin entry to get owner for |
| uint32_t STDCALL spin_lock | ( | SPIN_HANDLE | spin | ) |
Lock an existing Spin entry.
| Spin | Handle of Spin entry to lock |
| uint32_t STDCALL spin_unlock | ( | SPIN_HANDLE | spin | ) |
Unlock an existing Spin entry.
| Spin | Handle of Spin entry to unlock |
| uint32_t STDCALL spin_lock_irq | ( | SPIN_HANDLE | spin | ) |
Lock an existing Spin entry, disable IRQ and save the previous IRQ state.
| Spin | Handle of Spin entry to lock |
| uint32_t STDCALL spin_unlock_irq | ( | SPIN_HANDLE | spin | ) |
Unlock an existing Spin entry and restore the previous IRQ state.
| Spin | Handle of Spin entry to unlock |
| uint32_t STDCALL spin_lock_fiq | ( | SPIN_HANDLE | spin | ) |
Lock an existing Spin entry, disable FIQ and save the previous FIQ state.
| Spin | Handle of Spin entry to lock |
| uint32_t STDCALL spin_unlock_fiq | ( | SPIN_HANDLE | spin | ) |
Unlock an existing Spin entry and restore the previous FIQ state.
| Spin | Handle of Spin entry to unlock |
| uint32_t STDCALL spin_lock_irq_fiq | ( | SPIN_HANDLE | spin | ) |
Lock an existing Spin entry, disable IRQ and FIQ and save the previous IRQ and FIQ state.
| Spin | Handle of Spin entry to lock |
| uint32_t STDCALL spin_unlock_irq_fiq | ( | SPIN_HANDLE | spin | ) |
Unlock an existing Spin entry and restore the previous IRQ and FIQ state.
| Spin | Handle of Spin entry to unlock |
| uint32_t STDCALL spin_lock_preempt | ( | SPIN_HANDLE | spin | ) |
Lock an existing Spin entry, disable IRQ or IRQ/FIQ and save the previous IRQ or IRQ/FIQ state.
| Spin | Handle of Spin entry to lock |
| uint32_t STDCALL spin_unlock_preempt | ( | SPIN_HANDLE | spin | ) |
Unlock an existing Spin entry and restore the previous IRQ or IRQ/FIQ state.
| Spin | Handle of Spin entry to unlock |
| BOOL STDCALL spin_check_irq | ( | SPIN_HANDLE | spin | ) |
Check the mask that stores the previous IRQ state to determine if IRQ is enabled.
| Spin | Handle of Spin entry to check |
| BOOL STDCALL spin_check_fiq | ( | SPIN_HANDLE | spin | ) |
Check the mask that stores the previous FIQ state to determine if FIQ is enabled.
| Spin | Handle of Spin entry to check |
| uint32_t STDCALL spin_exchange_irq | ( | SPIN_HANDLE | spin1, |
| SPIN_HANDLE | spin2 ) |
Exchange the previous IRQ state between two Spin entries.
| Spin1 | Handle of first Spin entry |
| Spin2 | Handle of second Spin entry |
| uint32_t STDCALL spin_exchange_fiq | ( | SPIN_HANDLE | spin1, |
| SPIN_HANDLE | spin2 ) |
Exchange the previous FIQ state between two Spin entries.
| Spin1 | Handle of first Spin entry |
| Spin2 | Handle of second Spin entry |
| MUTEX_HANDLE STDCALL mutex_create | ( | void | ) |
Create and insert a new Mutex entry.
Mutex Functions
| MUTEX_HANDLE STDCALL mutex_create_ex | ( | BOOL | initialowner, |
| uint32_t | spincount, | ||
| uint32_t | flags ) |
Create and insert a new Mutex entry.
| InitialOwner | If true set the state of the mutex to locked and the owner to the current thread |
| SpinCount | The number of times the mutex will spin before yielding (Always 0 if CPU count equals 1) |
| Flags | The flags for the Mutex entry (eg MUTEX_FLAG_RECURSIVE) |
| uint32_t STDCALL mutex_destroy | ( | MUTEX_HANDLE | mutex | ) |
Destroy and remove an existing Mutex entry.
| Mutex | Handle of Mutex entry to destroy |
| uint32_t STDCALL mutex_flags | ( | MUTEX_HANDLE | mutex | ) |
Get the current flags of an existing Mutex entry.
| Mutex | Handle of Mutex entry to get flags for |
| uint32_t STDCALL mutex_count | ( | MUTEX_HANDLE | mutex | ) |
Get the current lock count of an existing Mutex entry.
| Mutex | Mutex to get count for |
| THREAD_HANDLE STDCALL mutex_owner | ( | MUTEX_HANDLE | mutex | ) |
Get the current owner of an existing Mutex entry.
| Mutex | Handle of Mutex entry to get owner for |
| uint32_t STDCALL mutex_lock | ( | MUTEX_HANDLE | mutex | ) |
Lock an existing Mutex entry.
| Mutex | Handle of Mutex entry to lock |
| uint32_t STDCALL mutex_unlock | ( | MUTEX_HANDLE | mutex | ) |
Unlock an existing Mutex entry.
| Mutex | Handle of Mutex entry to unlock |
| uint32_t STDCALL mutex_try_lock | ( | MUTEX_HANDLE | mutex | ) |
Try to lock an existing Mutex entry.
If the Mutex is not locked then lock it and mark the owner as the current thread
If the Mutex is already locked then return immediately with an error and do not wait for it to be unlocked
| Mutex | Mutex to try to lock |
| CRITICAL_SECTION_HANDLE STDCALL critical_section_create | ( | void | ) |
Create and insert a new CriticalSection entry.
Critical Section Functions
| CRITICAL_SECTION_HANDLE STDCALL critical_section_create_ex | ( | BOOL | initialowner, |
| uint32_t | spincount ) |
Create and insert a new CriticalSection entry.
| InitialOwner | If true set the state of the criticalsection to locked and the owner to the current thread |
| SpinCount | The number of times the criticalsection will spin before waiting (Always 0 if CPU count equals 1) |
| uint32_t STDCALL critical_section_destroy | ( | CRITICAL_SECTION_HANDLE | criticalsection | ) |
Destroy and remove an existing CriticalSection entry.
| CriticalSection | Handle of CriticalSection entry to destroy |
| uint32_t STDCALL critical_section_count | ( | CRITICAL_SECTION_HANDLE | criticalsection | ) |
Get the current lock count of an existing CriticalSection entry.
| CriticalSection | CriticalSection to get count for |
| THREAD_HANDLE STDCALL critical_section_owner | ( | CRITICAL_SECTION_HANDLE | criticalsection | ) |
Get the current owner of an existing CriticalSection entry.
| CriticalSection | CriticalSection to get owner for |
| uint32_t STDCALL critical_section_set_spin_count | ( | CRITICAL_SECTION_HANDLE | criticalsection, |
| uint32_t | spincount ) |
Set the spin count of an existing CriticalSection entry.
| CriticalSection | CriticalSection to set spin count for |
| SpinCount | The spin count value to set |
| uint32_t STDCALL critical_section_lock | ( | CRITICAL_SECTION_HANDLE | criticalsection | ) |
Lock an existing CriticalSection entry.
If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread
If the CriticalSection is already locked by the current thread then increment the count and return immediately
If the CriticalSection is already locked by another thread then wait until it is unlocked
| CriticalSection | CriticalSection to lock |
| uint32_t STDCALL critical_section_lock_ex | ( | CRITICAL_SECTION_HANDLE | criticalsection, |
| uint32_t | timeout ) |
Lock an existing CriticalSection entry.
If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread
If the CriticalSection is already locked by the current thread then increment the count and return immediately
If the CriticalSection is already locked by another thread then wait until it is unlocked
| CriticalSection | CriticalSection to lock |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| uint32_t STDCALL critical_section_unlock | ( | CRITICAL_SECTION_HANDLE | criticalsection | ) |
Unlock an existing CriticalSection entry.
If the CriticalSection is locked by the current thread then decrement the count
If the count is greater than zero then return immediately
If the count reaches zero then unlock the CriticalSection and release the first thread waiting for it to be unlocked
If the CriticalSection is locked by another thread then return an error
If the CriticalSection is not locked then return an error
| CriticalSection | CriticalSection to unlock |
| uint32_t STDCALL critical_section_try_lock | ( | CRITICAL_SECTION_HANDLE | criticalsection | ) |
Try to lock an existing CriticalSection entry.
If the CriticalSection is not locked then lock it, set the count to one and mark the owner as the current thread
If the CriticalSection is already locked by the current thread then increment the count and return immediately
If the CriticalSection is already locked by another thread then return immediately with an error and do not wait for it to be unlocked
| CriticalSection | CriticalSection to try to lock |
| SEMAPHORE_HANDLE STDCALL semaphore_create | ( | uint32_t | count | ) |
Create and insert a new Semaphore entry.
Semaphore Functions
| Count | The initial count of the Semaphore (Must be greater than or equal to zero) |
| SEMAPHORE_HANDLE STDCALL semaphore_create_ex | ( | uint32_t | count, |
| uint32_t | maximum, | ||
| uint32_t | flags ) |
Create and insert a new Semaphore entry.
| Count | The initial count of the Semaphore (Must be greater than or equal to zero) |
| Maximum | The maximum count of the Semaphore (Must be greater than one) |
| Flags | The flags for the Semaphore entry (eg SEMAPHORE_FLAG_IRQ) |
| uint32_t STDCALL semaphore_destroy | ( | SEMAPHORE_HANDLE | semaphore | ) |
Destroy and remove an existing Semaphore entry.
| Semaphore | Handle of Semaphore entry to destroy |
| uint32_t STDCALL semaphore_count | ( | SEMAPHORE_HANDLE | semaphore | ) |
Get the current count of an existing Semaphore entry.
| Semaphore | Semaphore to get count for |
| uint32_t STDCALL semaphore_wait | ( | SEMAPHORE_HANDLE | semaphore | ) |
Wait on an existing Semaphore entry.
If the Semaphore count is greater than zero it will be decremented and this function will return immediately
If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx()
| Semaphore | Semaphore to wait on |
| uint32_t STDCALL semaphore_wait_ex | ( | SEMAPHORE_HANDLE | semaphore, |
| uint32_t | timeout ) |
Wait on an existing Semaphore entry.
If the Semaphore count is greater than zero it will be decremented and this function will return immediately
If the Semaphore count is zero the current thread will be put on a wait queue until the Semaphore is signalled by another thread calling SemaphoreSignal() or SemaphoreSignalEx()
| Semaphore | Semaphore to wait on |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| uint32_t STDCALL semaphore_signal | ( | SEMAPHORE_HANDLE | semaphore | ) |
Signal an existing Semaphore entry.
If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue
If no threads are waiting then the Semaphore count will be incremented by one
| Semaphore | Semaphore to signal |
| uint32_t STDCALL semaphore_signal_ex | ( | SEMAPHORE_HANDLE | semaphore, |
| uint32_t | count, | ||
| uint32_t * | previous ) |
Signal an existing Semaphore entry one or more times.
If any threads are waiting on the Semaphore then one thread will be woken up and placed on the ready queue for each iteration of the count passed
If no threads are waiting then the Semaphore count will be incremented once for each iteration of the count passed
| Semaphore | Semaphore to signal |
| Count | The number is times to signal the Semaphore, must be greater than zero |
| Previous | A pointer to a value that receives the previous count of the Semaphore Can be nil if the previous count is not required |
| SYNCHRONIZER_HANDLE STDCALL synchronizer_create | ( | void | ) |
Create and insert a new Synchronizer entry.
Synchronizer Functions
| SYNCHRONIZER_HANDLE STDCALL synchronizer_create_ex | ( | BOOL | initialreader, |
| BOOL | initialwriter ) |
Create and insert a new Synchronizer entry.
| InitialReader | If true set the state of the synchronizer to locked and the reader count to 1 |
| InitialWriter | If true set the state of the synchronizer to locked and the writer owner to the current thread |
| uint32_t STDCALL synchronizer_destroy | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Destroy and remove an existing Synchronizer entry.
| Synchronizer | Handle of Synchronizer entry to destroy |
| uint32_t STDCALL synchronizer_reader_count | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Get the current reader count of an existing Synchronizer entry.
| Synchronizer | Synchronizer to get count for |
| THREAD_HANDLE STDCALL synchronizer_reader_last | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Get the last reader thread of an existing Synchronizer entry.
| Synchronizer | Synchronizer to last reader for |
| uint32_t STDCALL synchronizer_reader_lock | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Lock an existing Synchronizer entry for reading.
If the Synchronizer is not locked then lock it and set the reader count to one
If the Synchronizer is already locked for reading then increment the reader count and return immediately
If the Synchronizer is already locked for writing then wait until it is unlocked
| Synchronizer | Synchronizer to lock |
| uint32_t STDCALL synchronizer_reader_lock_ex | ( | SYNCHRONIZER_HANDLE | synchronizer, |
| uint32_t | timeout ) |
Lock an existing Synchronizer entry for reading.
If the Synchronizer is not locked then lock it and set the reader count to one
If the Synchronizer is already locked for reading then increment the reader count and return immediately
If the Synchronizer is already locked for writing then wait until it is unlocked
| Synchronizer | Synchronizer to lock |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| uint32_t STDCALL synchronizer_reader_unlock | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Unlock an existing Synchronizer entry.
If the Synchronizer is locked for reading then decrement the count
If the count is greater than zero then return immediately
If the count reaches zero then unlock the Synchronizer and release the first writer thread waiting for it to be unlocked
If the Synchronizer is locked for writing then return an error
If the Synchronizer is not locked then return an error
| Synchronizer | Synchronizer to unlock |
| uint32_t STDCALL synchronizer_reader_convert | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Convert a reader lock on an existing Synchronizer entry to a writer lock.
If the Synchronizer is locked for reading then decrement the count
If the count is greater than zero then wait to acquire the writer lock
If the count reaches zero then convert to writer lock with the current thread as the owner
If the Synchronizer is locked for writing then return an error
If the Synchronizer is not locked then return an error
| Synchronizer | Synchronizer to convert |
| uint32_t STDCALL synchronizer_reader_convert_ex | ( | SYNCHRONIZER_HANDLE | synchronizer, |
| uint32_t | timeout ) |
Convert a reader lock on an existing Synchronizer entry to a writer lock.
If the Synchronizer is locked for reading then decrement the count
If the count is greater than zero then wait to acquire the writer lock
If the count reaches zero then convert to writer lock with the current thread as the owner
If the Synchronizer is locked for writing then return an error
If the Synchronizer is not locked then return an error
| Synchronizer | Synchronizer to convert |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| uint32_t STDCALL synchronizer_writer_count | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Get the current writer count of an existing Synchronizer entry.
| Synchronizer | Synchronizer to get count for |
| THREAD_HANDLE STDCALL synchronizer_writer_owner | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Get the current writer owner of an existing Synchronizer entry.
| Synchronizer | Synchronizer to get owner for |
| uint32_t STDCALL synchronizer_writer_lock | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Lock an existing Synchronizer entry for writing.
If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread
If the Synchronizer is already locked by the current thread then increment the writer count and return immediately
If the Synchronizer is already locked for reading then wait until it is unlocked
| Synchronizer | Synchronizer to lock |
| uint32_t STDCALL synchronizer_writer_lock_ex | ( | SYNCHRONIZER_HANDLE | synchronizer, |
| uint32_t | timeout ) |
Lock an existing Synchronizer entry for writing.
If the Synchronizer is not locked then lock it, set the writer count to one and mark the owner as the current thread
If the Synchronizer is already locked by the current thread then increment the writer count and return immediately
If the Synchronizer is already locked for reading then wait until it is unlocked
| Synchronizer | Synchronizer to lock |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| uint32_t STDCALL synchronizer_writer_unlock | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Unlock an existing Synchronizer entry.
If the Synchronizer is locked for writing by the current thread then decrement the count
If the count is greater than zero then return immediately
If the count reaches zero then unlock the Synchronizer and release all reader threads waiting for it to be unlocked or the first writer thread waiting for it to be unlocked
If the Synchronizer is locked for reading then return an error
If the Synchronizer is locked for writing by another thread then return an error
If the Synchronizer is not locked then return an error
| Synchronizer | Synchronizer to unlock |
| uint32_t STDCALL synchronizer_writer_convert | ( | SYNCHRONIZER_HANDLE | synchronizer | ) |
Convert a writer lock on an existing Synchronizer entry to a reader lock.
If the Synchronizer is locked for writing by the current thread and the count is one then decrement the count
If the count is greater than one then return an error
If the count reaches zero then convert to reader lock and release all waiting reader threads
If the Synchronizer is locked for reading then return an error
If the Synchronizer is not locked then return an error
| Synchronizer | Synchronizer to convert |
| CONDITION_HANDLE STDCALL condition_create | ( | void | ) |
Create and insert a new Condition entry.
Condition Functions
| uint32_t STDCALL condition_destroy | ( | CONDITION_HANDLE | condition | ) |
Destroy and remove an existing Condition entry.
| Condition | Handle of Condition entry to destroy |
| uint32_t STDCALL condition_wait | ( | CONDITION_HANDLE | condition, |
| uint32_t | timeout ) |
Wait on an existing Condition.
| Condition | Condition to wait on |
| Timeout | Time in milliseconds to wait to be woken 0 = No Wait INFINITE = Wait Indefinitely |
| uint32_t STDCALL condition_wait_mutex | ( | CONDITION_HANDLE | condition, |
| MUTEX_HANDLE | mutex, | ||
| uint32_t | timeout ) |
Release a Mutex and Wait on an existing Condition in an atomic operation.
| Condition | Condition to wait on |
| Mutex | Mutex to release |
| Timeout | Time in milliseconds to wait to be woken 0 = No Wait INFINITE = Wait Indefinitely |
| uint32_t STDCALL condition_wait_synchronizer | ( | CONDITION_HANDLE | condition, |
| SYNCHRONIZER_HANDLE | synchronizer, | ||
| uint32_t | flags, | ||
| uint32_t | timeout ) |
Release a Synchronizer and Wait on an existing Condition in an atomic operation.
| Condition | Condition to wait on |
| Synchronizer | Synchronizer to release |
| Flags | Flags to indicate reader or writer lock for the Synchronizer (eg CONDITION_LOCK_FLAG_WRITER) |
| Timeout | Time in milliseconds to wait to be woken 0 = No Wait INFINITE = Wait Indefinitely |
| uint32_t STDCALL condition_wait_critical_section | ( | CONDITION_HANDLE | condition, |
| CRITICAL_SECTION_HANDLE | criticalsection, | ||
| uint32_t | timeout ) |
Release a Critical Section and Wait on an existing Condition in an atomic operation.
| Condition | Condition to wait on |
| CriticalSection | Critical Section to release |
| Timeout | Time in milliseconds to wait to be woken 0 = No Wait INFINITE = Wait Indefinitely |
| uint32_t STDCALL condition_wake | ( | CONDITION_HANDLE | condition | ) |
Wake one thread waiting on an existing Condition.
| Condition | Condition to wake |
| uint32_t STDCALL condition_wake_all | ( | CONDITION_HANDLE | condition | ) |
Wake all threads waiting on an existing Condition.
| Condition | Condition to wake |
| COMPLETION_HANDLE STDCALL completion_create | ( | uint32_t | flags | ) |
Create and insert a new Completion entry.
Completion Functions
| Flags | The flags for the Completion entry (eg COMPLETION_FLAG_IRQ) |
| uint32_t STDCALL completion_destroy | ( | COMPLETION_HANDLE | completion | ) |
Destroy and remove an existing Completion entry.
| Completion | Handle of Completion entry to destroy |
| uint32_t STDCALL completion_state | ( | COMPLETION_HANDLE | completion | ) |
Get the current state of an existing Completion entry.
| Completion | Completion to get the state for |
| uint32_t STDCALL completion_wait | ( | COMPLETION_HANDLE | completion, |
| uint32_t | timeout ) |
Wait on an existing Completion.
If the completion is set (complete) then return immediately with success
If the completion is not set then wait for it to be completed before returning
For counted completions, decrement the count if it is not 0 or -1 after testing if the completion is set
| Completion | Completion to wait on |
| Timeout | Time in milliseconds to wait to be woken 0 = No Wait INFINITE = Wait Indefinitely |
| uint32_t STDCALL completion_try_wait | ( | COMPLETION_HANDLE | completion | ) |
Try an existing Completion to see if it is completed.
If the completion is not set (complete) then return immediately with an error and do not wait for it to be completed
| Completion | Completion to try |
| uint32_t STDCALL completion_reset | ( | COMPLETION_HANDLE | completion | ) |
Reset (uncomplete) the state of an existing Completion entry.
If the completion is not set then return with no action
If the completion is set then change the state to not set
For counted completions, reset the counter to 0
| Completion | Completion to reset the state for |
| uint32_t STDCALL completion_complete | ( | COMPLETION_HANDLE | completion | ) |
Set (complete) the state of an existing Completion entry.
If the completion is already set then return with no action
If the completion is not set then release one waiting thread (if any) and return
For counted completions, release one waiting thread, if there are no waiting threads increment the count if it is not -1 and return
| Completion | Completion to set the state for |
| uint32_t STDCALL completion_complete_all | ( | COMPLETION_HANDLE | completion | ) |
Set (complete) the state of an existing Completion entry.
If the completion is already set then return with no action
If the completion is not set then release all waiting threads (if any) and return
For counted completions, set the count to -1, release all waiting threads (if any) and return
| Completion | Completion to set the state for |
| LIST_HANDLE STDCALL list_create | ( | void | ) |
Create and insert a new List entry.
List Functions
| LIST_HANDLE STDCALL list_create_ex | ( | uint32_t | listtype, |
| uint32_t | flags ) |
Create and insert a new List entry.
| ListType | Type of list to create (eg LIST_TYPE_WAIT_SEMAPHORE) |
| Flags | Flags for the new list (eg LIST_FLAG_IRQ) |
| uint32_t STDCALL list_destroy | ( | LIST_HANDLE | list | ) |
Destroy and remove an existing List entry.
| List | Handle of List entry to destroy |
| uint32_t STDCALL list_count | ( | LIST_HANDLE | list | ) |
Get the current count from the supplied list.
| List | Handle of List entry to get from |
| uint32_t STDCALL list_add_first | ( | LIST_HANDLE | list, |
| LIST_ELEMENT * | element ) |
Add the supplied element as the first item in the List.
| List | Handle of List entry to add to |
| Element | The list element to be added |
| uint32_t STDCALL list_add_last | ( | LIST_HANDLE | list, |
| LIST_ELEMENT * | element ) |
Add the supplied element as the last item in the List.
| List | Handle of List entry to add to |
| Element | The list element to be added |
| LIST_ELEMENT *STDCALL list_get_thread | ( | LIST_HANDLE | list, |
| THREAD_HANDLE | thread ) |
Find the supplied thread in the List and return its element.
| List | Handle of List entry to find from |
| Thread | The thread handle to be found |
| LIST_ELEMENT *STDCALL list_get_first | ( | LIST_HANDLE | list | ) |
Get the first element from the List.
| List | Handle of List entry to get from |
| LIST_ELEMENT *STDCALL list_get_first_ex | ( | LIST_HANDLE | list, |
| BOOL | remove ) |
Get the first element from the List.
| List | Handle of List entry to get from |
| Remove | If true then remove the element from the list |
| LIST_ELEMENT *STDCALL list_get_last | ( | LIST_HANDLE | list | ) |
Get the last element from the List.
| List | Handle of List entry to get from |
| LIST_ELEMENT *STDCALL list_get_last_ex | ( | LIST_HANDLE | list, |
| BOOL | remove ) |
Get the last element from the List.
| List | Handle of List entry to get from |
| Remove | If true then remove the element from the list |
| uint32_t STDCALL list_insert | ( | LIST_HANDLE | list, |
| LIST_ELEMENT * | previous, | ||
| LIST_ELEMENT * | element ) |
Insert a new element in the List.
| List | Handle of List entry to insert into |
| Previous | The element to insert the new element after |
| Element | The list element to be inserted |
| uint32_t STDCALL list_remove | ( | LIST_HANDLE | list, |
| LIST_ELEMENT * | element ) |
Remove an element from the List.
| List | Handle of List entry to remove from |
| Element | The list element to be removed |
| BOOL STDCALL list_is_empty | ( | LIST_HANDLE | list | ) |
Check if the supplied List is empty.
| List | Handle of List entry to check |
| BOOL STDCALL list_not_empty | ( | LIST_HANDLE | list | ) |
Check if the supplied List is empty.
| List | Handle of List entry to check |
| uint32_t STDCALL list_lock | ( | LIST_HANDLE | list | ) |
Lock the supplied List.
| List | Handle of List entry to lock |
| uint32_t STDCALL list_unlock | ( | LIST_HANDLE | list | ) |
Unlock the supplied List.
| List | Handle of List entry to unlock |
| QUEUE_HANDLE STDCALL queue_create | ( | void | ) |
Create and insert a new Queue entry.
Queue Functions
| QUEUE_HANDLE STDCALL queue_create_ex | ( | uint32_t | queuetype, |
| uint32_t | flags ) |
Create and insert a new Queue entry.
| QueueType | Type of queue to create (eg QUEUE_TYPE_SCHEDULE_SLEEP) |
| Flags | Flags for the new queue (eg QUEUE_FLAG_DESCENDING) |
| uint32_t STDCALL queue_destroy | ( | QUEUE_HANDLE | queue | ) |
Destroy and remove an existing Queue entry.
| Queue | Handle of Queue entry to destroy |
| uint32_t STDCALL queue_count | ( | QUEUE_HANDLE | queue | ) |
Get the current count from the supplied queue.
| List | Handle of Queue entry to get from |
| uint32_t STDCALL queue_enqueue | ( | QUEUE_HANDLE | queue, |
| THREAD_HANDLE | thread ) |
Add the supplied thread as the last item in the Queue.
| Queue | Handle of Queue entry to add to |
| Thread | Handle of the Thread to enqueue |
| THREAD_HANDLE STDCALL queue_dequeue | ( | QUEUE_HANDLE | queue | ) |
Get and remove the first thread from the Queue.
| Queue | Handle of Queue entry to get from |
| int STDCALL queue_first_key | ( | QUEUE_HANDLE | queue | ) |
Get the first Key value from the Queue.
| Queue | Handle of Queue entry to get from |
| int STDCALL queue_last_key | ( | QUEUE_HANDLE | queue | ) |
Get the last Key value from the Queue.
| Queue | Handle of Queue entry to get from |
| uint32_t STDCALL queue_insert_key | ( | QUEUE_HANDLE | queue, |
| THREAD_HANDLE | thread, | ||
| int | key ) |
Insert the supplied thread in the Queue ordered based on Key and the flags of the Queue.
| Queue | Handle of Queue entry to insert into |
| Thread | Handle of thread to be inserted |
| Key | The key to order the insertion on |
| uint32_t STDCALL queue_delete_key | ( | QUEUE_HANDLE | queue, |
| THREAD_HANDLE | thread ) |
Delete the supplied thread from the Queue based on the flags of the Queue.
| Queue | Handle of Queue entry to delete from |
| Thread | Handle of thread to be deleted |
| int STDCALL queue_increment_key | ( | QUEUE_HANDLE | queue | ) |
Increment the first Key value in the Queue.
| Queue | Handle of Queue entry to increment in |
| int STDCALL queue_decrement_key | ( | QUEUE_HANDLE | queue | ) |
Decrement the first Key value in the Queue.
| Queue | Handle of Queue entry to decrement in |
| BOOL STDCALL queue_is_empty | ( | QUEUE_HANDLE | queue | ) |
Check if the supplied Queue is empty.
| Queue | Handle of Queue entry to check |
| BOOL STDCALL queue_not_empty | ( | QUEUE_HANDLE | queue | ) |
Check if the supplied Queue is not empty.
| Queue | Handle of Queue entry to check |
| uint32_t STDCALL queue_lock | ( | QUEUE_HANDLE | queue | ) |
Lock the supplied Queue.
| Queue | Handle of Queue entry to lock |
| uint32_t STDCALL queue_unlock | ( | QUEUE_HANDLE | queue | ) |
Unlock the supplied Queue.
| Queue | Handle of Queue entry to unlock |
| THREAD_HANDLE STDCALL thread_create | ( | thread_start_proc | startproc, |
| uint32_t | stacksize, | ||
| uint32_t | priority, | ||
| const char * | name, | ||
| void * | parameter ) |
Create and insert a new Thread entry.
Thread Functions
The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume
| StartProc | Procedure address where the thread will start running |
| StackSize | Stack size in bytes |
| Priority | Thread priority (eg THREAD_PRIORITY_NORMAL) |
| Name | Name of the thread |
| Parameter | Parameter passed to StartProc of new thread |
| WARNING | ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx These functions do not handle setting up certain RTL functionality such as thread variables,
exceptions and standard input/output handles.
If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the
TThread class and its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify
the thread creation behaviour and understand that you also need to handle the additional RTL setup
|
| THREAD_HANDLE STDCALL thread_create_ex | ( | thread_start_proc | startproc, |
| uint32_t | stacksize, | ||
| uint32_t | priority, | ||
| uint32_t | affinity, | ||
| uint32_t | cpu, | ||
| const char * | name, | ||
| void * | parameter ) |
Create and insert a new Thread entry.
The new thread will be created suspended so it will not start running until it is scheduled with either ThreadReady or ThreadResume
| StartProc | Procedure address where the thread will start running |
| StackSize | Stack size in bytes |
| Priority | Thread priority (eg THREAD_PRIORITY_NORMAL) |
| Affinity | Thread affinity (eg CPU_AFFINITY_ALL) |
| CPU | The CPU to assign new thread to (eg CPU_ID_0) |
| Name | Name of the thread |
| Parameter | Parameter passed to StartProc of new thread |
| WARNING | ThreadCreate and ThreadCreateEx are only used internally by SysBeginThread and SysBeginThreadEx These functions do not handle setting up certain RTL functionality such as thread variables,
exceptions and standard input/output handles.
If you need to create a standard thread use either BeginThread (or BeginThreadEx) or use the
TThread class or its descendants. Only use ThreadCreate and ThreadCreateEx if you need to modify
the thread creation behaviour and understand that you also need to handle the additional RTL setup
|
| uint32_t STDCALL thread_destroy | ( | THREAD_HANDLE | thread | ) |
Destroy and remove an existing Thread entry.
| Thread | Handle of thread to destroy |
| THREAD_HANDLE STDCALL thread_get_current | ( | void | ) |
Get the Handle of currently executing thread.
| uint32_t STDCALL thread_set_current | ( | THREAD_HANDLE | thread | ) |
Set the Handle of currently executing thread.
| uint32_t STDCALL thread_get_name | ( | THREAD_HANDLE | thread, |
| char * | name, | ||
| uint32_t | len ) |
Get the name of a Thread.
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_set_name | ( | THREAD_HANDLE | thread, |
| const char * | name ) |
Set the name of a Thread.
| Thread | Handle of thread to set |
| uint32_t STDCALL thread_get_cpu | ( | THREAD_HANDLE | thread | ) |
Get the current CPU of a thread (eg CPU_ID_0).
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_set_cpu | ( | THREAD_HANDLE | thread, |
| uint32_t | cpu ) |
Set the current CPU of a thread (eg CPU_ID_0).
The new CPU will not take affect until the thread is next rescheduled
| Thread | Handle of thread to set |
| CPU | New thread CPU (eg CPU_ID_0) |
| uint32_t STDCALL thread_get_state | ( | THREAD_HANDLE | thread | ) |
Get the current state of a thread (eg THREAD_STATE_SUSPENDED).
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_get_flags | ( | THREAD_HANDLE | thread | ) |
Get the current flags of a thread.
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_set_flags | ( | THREAD_HANDLE | thread, |
| uint32_t | flags ) |
Set the current flags of a thread.
| Thread | Handle of thread to set |
| Flags | Flags to set (eg THREAD_FLAG_PERSIST) |
| uint32_t STDCALL thread_add_flags | ( | THREAD_HANDLE | thread, |
| uint32_t | flags ) |
Add flags to the current flags of a thread.
| Thread | Handle of thread to add flags for |
| Flags | Flags to add (eg THREAD_FLAG_PERSIST) |
| uint32_t STDCALL thread_remove_flags | ( | THREAD_HANDLE | thread, |
| uint32_t | flags ) |
Remove flags from the current flags of a thread.
| Thread | Handle of thread to remove flags from |
| Flags | Flags to remove (eg THREAD_FLAG_PERSIST) |
| LCID STDCALL thread_get_locale | ( | THREAD_HANDLE | thread | ) |
Get the current locale of a thread.
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_set_locale | ( | THREAD_HANDLE | thread, |
| LCID | locale ) |
Set the locale of a thread.
| Thread | Handle of thread to set |
| Locale | Locale id to set |
| uint32_t STDCALL thread_get_times | ( | THREAD_HANDLE | thread, |
| int64_t * | createtime, | ||
| int64_t * | exittime, | ||
| int64_t * | kerneltime ) |
Get the current times of a thread.
| Thread | Handle of thread to get |
| CreateTime | Buffer to receive the CreateTime value |
| ExitTime | Buffer to receive the ExitTime value |
| KernelTime | Buffer to receive the KernelTime value |
| uint32_t STDCALL thread_get_switch_count | ( | THREAD_HANDLE | thread, |
| int64_t * | switchcount ) |
Get the current context switch count of a thread (How many times the thread has been scheduled).
| Thread | Handle of thread to get |
| SwitchCount | Buffer to receive the SwitchCount value |
| uint32_t STDCALL thread_get_stack_free | ( | void | ) |
Get the free stack size of the current thread.
| uint32_t STDCALL thread_get_stack_size | ( | THREAD_HANDLE | thread | ) |
Get the current stack size of a thread.
| Thread | Handle of thread to get |
| size_t STDCALL thread_get_stack_base | ( | THREAD_HANDLE | thread | ) |
Get the current stack base of a thread.
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_set_stack_base | ( | THREAD_HANDLE | thread, |
| size_t | stackbase ) |
Set the current stack base of a thread.
| Thread | Handle of thread to set |
| StackBase | Stack base to set |
| size_t STDCALL thread_get_stack_pointer | ( | THREAD_HANDLE | thread | ) |
Get the current stack pointer of a thread.
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_get_exit_code | ( | THREAD_HANDLE | thread | ) |
Get the exit code of a Thread.
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_get_affinity | ( | THREAD_HANDLE | thread | ) |
Get the scheduling affinity of a Thread.
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_set_affinity | ( | THREAD_HANDLE | thread, |
| uint32_t | affinity ) |
Set the scheduling affinity of a Thread.
The new affinity will not take affect until the thread is next rescheduled
| Thread | Handle of thread to set |
| Affinity | New thread affinity (eg CPU_AFFINITY_0) |
| uint32_t STDCALL thread_get_priority | ( | THREAD_HANDLE | thread | ) |
Get the scheduling priority of a Thread.
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_set_priority | ( | THREAD_HANDLE | thread, |
| uint32_t | priority ) |
Set the scheduling priority of a Thread.
The new priority will not take affect until the thread is next rescheduled
| Thread | Handle of thread to set |
| Priority | New thread priority (eg THREAD_PRIORITY_NORMAL) |
| uint32_t STDCALL thread_get_last_error | ( | void | ) |
Get the last error value for the current Thread.
| void STDCALL thread_set_last_error | ( | uint32_t | lasterror | ) |
Set the last error value for the current Thread.
| uint32_t STDCALL thread_set_last_error_ex | ( | uint32_t | lasterror | ) |
Set the last error value for the current Thread.
| uint32_t STDCALL thread_get_wait_result | ( | void | ) |
Get the result of the last wait timeout for the current Thread.
| uint32_t STDCALL thread_get_receive_result | ( | void | ) |
Get the result of the last receive timeout for the current Thread.
| uint32_t STDCALL thread_get_tls_index | ( | uint32_t | tlsindex | ) |
Get the current status of a TLS index in the TLS index table.
| TlsIndex | The TLS index to get the status for |
| uint32_t STDCALL thread_alloc_tls_index | ( | void | ) |
Allocate a TLS index in the TLS index table.
| uint32_t STDCALL thread_alloc_tls_index_ex | ( | uint32_t | flags | ) |
Allocate a TLS index in the TLS index table.
| Flags | The flags to apply to the TLS index entries (eg THREAD_TLS_FLAG_FREE) |
| uint32_t STDCALL thread_release_tls_index | ( | uint32_t | tlsindex | ) |
Deallocate a TLS index from the TLS index table.
| TlsIndex | The TLS index to deallocate |
| void *STDCALL thread_get_tls_value | ( | uint32_t | tlsindex | ) |
Get the pointer associated with the TLS index for the current thread.
| uint32_t STDCALL thread_set_tls_value | ( | uint32_t | tlsindex, |
| void * | tlsvalue ) |
Set the pointer associated with the TLS index for the current thread.
| TlsIndex | The TLS index to get the pointer for |
| void *STDCALL thread_get_tls_pointer | ( | THREAD_HANDLE | thread | ) |
Get the RTL TLS (Thread Local Storage) pointer of a Thread.
| Thread | Handle of thread to get |
| uint32_t STDCALL thread_set_tls_pointer | ( | THREAD_HANDLE | thread, |
| void * | tlspointer ) |
Set the RTL TLS (Thread Local Storage) pointer of a Thread.
| Thread | Handle of thread to set |
| TlsPointer | Pointer value to set (Can be nil to clear the pointer) |
| uint32_t STDCALL thread_ready | ( | THREAD_HANDLE | thread, |
| BOOL | reschedule ) |
Place the supplied Thread on the ready queue.
| Thread | Handle of thread to make ready |
| Reschedule | If True then call SchedulerReschedule |
| uint32_t STDCALL thread_timeout | ( | THREAD_HANDLE | thread | ) |
Place the supplied Thread on the ready queue after a timeout waiting on a resource.
| Thread | Handle of thread to make ready |
| uint32_t STDCALL thread_wake | ( | THREAD_HANDLE | thread | ) |
Remove a thread prematurely from the sleep or timeout queues.
| Thread | Handle of thread to remove |
| uint32_t STDCALL thread_migrate | ( | THREAD_HANDLE | thread, |
| uint32_t | cpu ) |
Migrate a thread to a new CPU.
| Thread | Handle of thread to migrate |
| CPU | New CPU for the thread |
| void STDCALL thread_end | ( | uint32_t | exitcode | ) |
Terminate the current Thread.
| ExitCode | The return code of the thread |
| uint32_t STDCALL thread_halt | ( | uint32_t | exitcode | ) |
Halt the current thread so it will never be rescheduled.
Normally only called due to an unhandled exception etc so that the thread is put to sleep permanently without being terminated
| ExitCode | The return code of the thread |
| uint32_t STDCALL thread_terminate | ( | THREAD_HANDLE | thread, |
| uint32_t | exitcode ) |
Terminate but do not destroy the supplied Thread.
The terminated thread is placed on the termination queue until any threads waiting on it have been released
| Thread | Handle of thread to terminate |
| ExitCode | The return code of the thread |
| uint32_t STDCALL thread_yield | ( | void | ) |
Make the current thread yield the processor (Same as ThreadSleep(0)).
| uint32_t STDCALL thread_sleep | ( | uint32_t | milliseconds | ) |
Place the current thread on the sleep queue for a specified number of milliseconds.
| Milliseconds | Number of milliseconds to sleep |
| uint32_t STDCALL thread_wait | ( | LIST_HANDLE | list, |
| SPIN_HANDLE | lock, | ||
| uint32_t | flags ) |
Put the current thread into a wait state on the supplied list.
| List | Handle of List entry to put thread into |
| Lock | Handle of Lock to release before going into wait state |
| Flags | Flag to indicate which unlock method to use |
| uint32_t STDCALL thread_wait_ex | ( | LIST_HANDLE | list, |
| SPIN_HANDLE | lock, | ||
| uint32_t | flags, | ||
| uint32_t | timeout ) |
Put the current thread into a wait state with timeout on the supplied list.
| List | Handle of List entry to put thread into |
| Lock | Handle of Lock to release before going into wait state |
| Flags | Flag to indicate which unlock method to use |
| Timeout | Milliseconds to wait before timeout (INFINITE equals wait forever) |
| uint32_t STDCALL thread_release | ( | LIST_HANDLE | list | ) |
Release the first thread waiting on the supplied list.
| List | Handle of List entry to release thread from |
| uint32_t STDCALL thread_abandon | ( | LIST_HANDLE | list | ) |
Release the first thread waiting on the supplied list and return with WAIT_ABANDONED.
| List | Handle of List entry to release thread from |
| uint32_t STDCALL thread_wait_terminate | ( | THREAD_HANDLE | thread, |
| uint32_t | timeout ) |
Make the current thread wait until the specified thread has terminated.
| Thread | Handle of the thread to wait on |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| uint32_t STDCALL thread_suspend | ( | THREAD_HANDLE | thread | ) |
Suspend a thread, placing it in hibernation.
| Thread | Handle of thread to suspend |
| uint32_t STDCALL thread_resume | ( | THREAD_HANDLE | thread | ) |
Resume a suspended thread, making it ready.
| Thread | Handle of thread to resume |
| uint32_t STDCALL thread_wait_message | ( | void | ) |
Make the current thread wait until a message is received (indefinitely).
| uint32_t STDCALL thread_send_message | ( | THREAD_HANDLE | thread, |
| THREAD_MESSAGE * | message ) |
Send a message to another thread.
| Thread | Handle of thread to send to |
| Message | Contents of message to send |
| uint32_t STDCALL thread_receive_message | ( | THREAD_MESSAGE * | message | ) |
Make the current thread wait to receive a message (indefinitely).
| Message | The received message if successful, undefined on error |
| uint32_t STDCALL thread_receive_message_ex | ( | THREAD_MESSAGE * | message, |
| uint32_t | timeout, | ||
| BOOL | remove ) |
Make the current thread wait to receive a message.
| Message | The received message if successful, undefined on error |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| Remove | If true then remove the received message from the message list |
| uint32_t STDCALL thread_abandon_message | ( | THREAD_HANDLE | thread | ) |
Tell another thread to abandon waiting for a message.
| Thread | Handle of thread to abandon waiting |
| uint32_t STDCALL thread_lock | ( | THREAD_HANDLE | thread | ) |
Lock a thread allowing access to internal structures such as the thread stack.
| Thread | Handle of thread to lock |
| uint32_t STDCALL thread_unlock | ( | THREAD_HANDLE | thread | ) |
Unlok a thread that was locked by ThreadLock.
| Thread | Handle of thread to unlock |
| uint32_t STDCALL scheduler_check | ( | uint32_t | cpuid | ) |
Check if the sleep queue is empty, if not then decrement the first key Then check if the timeout queue is empty, if not then decrement the first key.
Scheduler Functions
If either key reaches zero, return success to indicate there are threads to be woken or threads whose timeout has expired
Finally check if the termination queue is empty, if not then decrement the first key
Items will be removed from the termination queue by SchedulerReschedule
| CPUID | The ID of the current CPU |
| uint32_t STDCALL scheduler_wakeup | ( | uint32_t | cpuid | ) |
Remove all threads from the sleep queue that have no more time to sleep.
Threads will be placed back on the ready queue for rescheduling
| CPUID | The ID of the current CPU |
| uint32_t STDCALL scheduler_expire | ( | uint32_t | cpuid | ) |
Remove all threads from the timeout queue that have no more time to wait.
Threads will be placed back on the ready queue for rescheduling but will return with an error indicating the timeout expired
| CPUID | The ID of the current CPU |
| THREAD_HANDLE STDCALL scheduler_switch | ( | uint32_t | cpuid, |
| THREAD_HANDLE | thread ) |
Perform a preemptive thread switch operation under an interrupt handler.
The next thread to run will be selected based on remaining quantum of the current thread, ready threads at higher priority levels and scheduler priority quantum for fair scheduling of lower priority threads
| CPUID | The ID of the current CPU |
| Thread | The handle of the currently running thread (Before IRQ or FIQ occurred) |
| THREAD_HANDLE STDCALL scheduler_select | ( | uint32_t | cpuid, |
| THREAD_HANDLE | thread, | ||
| BOOL | yield ) |
Select the next thread to be run based on state, yield, quantum and priority.
| CPUID | The ID of the current CPU |
| Thread | The handle of the currently running thread (Before IRQ or FIQ occurred or when Reschedule was called) |
| Yield | True if the current thread is giving up its remaining time slice |
Perform a thread switch operation when a thread yields, sleeps or waits.
The next thread to run will be selected based on whether the current thread is yielding or no longer ready, remaining quantum of the current thread, ready threads at higher priority levels and scheduler priority quantum for fair scheduling of lower priority threads
| Yield | True if the current thread is giving up its remaining time slice |
| uint32_t STDCALL scheduler_migration_enable | ( | void | ) |
Enable scheduler thread migration.
| uint32_t STDCALL scheduler_migration_disable | ( | void | ) |
Disable scheduler thread migration.
| uint32_t STDCALL scheduler_preempt_enable | ( | uint32_t | cpuid | ) |
Enable thread preemption for the specified CPU.
| CPUID | The ID of the CPU to enable for |
| uint32_t STDCALL scheduler_preempt_disable | ( | uint32_t | cpuid | ) |
Disable thread preemption for the specified CPU.
| CPUID | The ID of the CPU to disable for |
| uint32_t STDCALL scheduler_allocation_enable | ( | uint32_t | cpuid | ) |
Enable thread allocation for the specified CPU.
| CPUID | The ID of the CPU to enable for |
| uint32_t STDCALL scheduler_allocation_disable | ( | uint32_t | cpuid | ) |
Disable thread allocation for the specified CPU.
| CPUID | The ID of the CPU to disable for |
| MESSAGESLOT_HANDLE STDCALL messageslot_create | ( | void | ) |
Create and insert a new Messageslot entry.
Messageslot Functions
| MESSAGESLOT_HANDLE STDCALL messageslot_create_ex | ( | uint32_t | maximum, |
| uint32_t | flags ) |
Create and insert a new Messageslot entry.
| Maximum | Maximum number of messages allowed for the Messageslot (Must be greater than zero) |
| Flags | The flags for the Messageslot entry (eg MESSAGESLOT_FLAG_IRQ) |
| uint32_t STDCALL messageslot_destroy | ( | MESSAGESLOT_HANDLE | messageslot | ) |
Destroy and remove an existing Messageslot entry.
| Messageslot | Handle of Messageslot entry to destroy |
| uint32_t STDCALL messageslot_count | ( | MESSAGESLOT_HANDLE | messageslot | ) |
Get the number of available messages in a Messageslot entry.
| Messageslot | Messageslot to get from |
| uint32_t STDCALL messageslot_send | ( | MESSAGESLOT_HANDLE | messageslot, |
| THREAD_MESSAGE * | message ) |
Send a message to a Messageslot.
| Messageslot | Messageslot to send to |
| Message | Contents of message to send |
| uint32_t STDCALL messageslot_receive | ( | MESSAGESLOT_HANDLE | messageslot, |
| THREAD_MESSAGE * | message ) |
Receive a message from a Messageslot.
| Messageslot | Messageslot to receive from |
| Message | The received message if successful, undefined on error |
| uint32_t STDCALL messageslot_receive_ex | ( | MESSAGESLOT_HANDLE | messageslot, |
| THREAD_MESSAGE * | message, | ||
| uint32_t | timeout ) |
Receive a message from a Messageslot.
| Messageslot | Messageslot to receive from |
| Message | The received message if successful, undefined on error |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| MAILSLOT_HANDLE STDCALL mailslot_create | ( | uint32_t | maximum | ) |
Create and insert a new Mailslot entry.
Mailslot Functions
| Maximum | Maximum number of messages allowed for the Mailslot (Must be greater than zero) |
| uint32_t STDCALL mailslot_destroy | ( | MAILSLOT_HANDLE | mailslot | ) |
Destroy and remove an existing Mailslot entry.
| Mailslot | Handle of Mailslot entry to destroy |
| uint32_t STDCALL mailslot_count | ( | MAILSLOT_HANDLE | mailslot | ) |
Get the number of available messages in a Mailslot entry.
| Mailslot | Mailslot to get from |
| uint32_t STDCALL mailslot_send | ( | MAILSLOT_HANDLE | mailslot, |
| ssize_t | data ) |
Send a message to a Mailslot.
| Mailslot | Mailslot to send to |
| Data | Message to send to mailslot |
| uint32_t STDCALL mailslot_send_ex | ( | MAILSLOT_HANDLE | mailslot, |
| ssize_t | data, | ||
| uint32_t | timeout ) |
Send a message to a Mailslot.
| Mailslot | Mailslot to send to |
| Data | Message to send to mailslot |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| ssize_t STDCALL mailslot_receive | ( | MAILSLOT_HANDLE | mailslot | ) |
Receive a message from a Mailslot.
| Mailslot | Mailslot to receive from |
| ssize_t STDCALL mailslot_receive_ex | ( | MAILSLOT_HANDLE | mailslot, |
| uint32_t | timeout ) |
Receive a message from a Mailslot.
| Mailslot | Mailslot to receive from |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| BUFFER_HANDLE STDCALL buffer_create | ( | uint32_t | size, |
| uint32_t | count ) |
Create and insert a new Buffer entry.
Buffer Functions
| Size | Size of each buffer in bytes |
| Count | Total number of buffers |
| BUFFER_HANDLE STDCALL buffer_create_ex | ( | uint32_t | size, |
| uint32_t | count, | ||
| uint32_t | flags ) |
Create and insert a new Buffer entry.
| Size | Size of each buffer in bytes |
| Count | Total number of buffers |
| Flags | Flags for buffer (eg BUFFER_FLAG_SHARED) |
| uint32_t STDCALL buffer_destroy | ( | BUFFER_HANDLE | buffer | ) |
Destroy and remove an existing Buffer entry.
| Buffer | Handle of Buffer entry to destroy |
| uint32_t STDCALL buffer_count | ( | BUFFER_HANDLE | buffer | ) |
Get the total count of buffers in an existing Buffer entry.
| Buffer | Buffer to get total count for |
| uint32_t STDCALL buffer_available | ( | BUFFER_HANDLE | buffer | ) |
Get the available count of buffers in an existing Buffer entry.
| Buffer | Buffer to get available count for |
| void *STDCALL buffer_get | ( | BUFFER_HANDLE | buffer | ) |
Allocate an available buffer from an existing Buffer entry.
| Buffer | Handle of Buffer entry to allocate from |
| void *STDCALL buffer_get_ex | ( | BUFFER_HANDLE | buffer, |
| uint32_t | timeout ) |
Allocate an available buffer from an existing Buffer entry.
| Buffer | Handle of Buffer entry to allocate from |
| Timeout | Milliseconds to wait before timeout (0 equals do not wait, INFINITE equals wait forever) |
| uint32_t STDCALL buffer_free | ( | void * | buffer | ) |
Release a allocated buffer from an existing Buffer entry.
| Buffer | Pointer to the allocated buffer (As returned by BufferGet/BufferGetEx) |
| void *STDCALL buffer_iterate | ( | BUFFER_HANDLE | buffer, |
| void * | previous ) |
Iterate through each of the buffers in an existing Buffer entry.
| Buffer | Handle of Buffer entry to iterate from |
| Previous | The pointer returned by the previous call or nil on first call |
The function will fail if any buffers are already in use (if the count and available count are not equal)
| EVENT_HANDLE STDCALL event_create | ( | BOOL | manualreset, |
| BOOL | initialstate ) |
Create and insert a new Event entry.
Event Functions
| ManualReset | Create a manual reset event if true or an auto reset event if false An manual reset event must be reset by calling EventReset An auto reset event is reset when a single waiting thread is released |
| InitialState | Set the initial state of the event to signaled if true or to unsignaled if false |
| EVENT_HANDLE STDCALL event_create_ex | ( | uint32_t | flags | ) |
Create and insert a new Event entry.
| Flags | Event flags to use for the new entry (eg EVENT_FLAG_MANUAL_RESET) |
| uint32_t STDCALL event_destroy | ( | EVENT_HANDLE | event | ) |
Destroy and remove an existing Event entry.
| Event | Handle of Event entry to destroy |
| uint32_t STDCALL event_state | ( | EVENT_HANDLE | event | ) |
Get the current state of an existing Event entry.
| Event | Event to get state for |
| uint32_t STDCALL event_wait | ( | EVENT_HANDLE | event | ) |
Wait on an existing Event entry.
If the Event is currently signaled then simply return immediately
If the Event is currently unsignaled then wait for it to be signaled before returning
| Event | Event to wait on |
| uint32_t STDCALL event_wait_ex | ( | EVENT_HANDLE | event, |
| uint32_t | timeout ) |
Wait on an existing Event entry.
If the Event is currently signaled then simply return immediately
If the Event is currently unsignaled then wait for it to be signaled before returning
| Event | Event to wait on |
| Timeout | Time in milliseconds to wait for the event to be signaled 0 = No Wait INFINITE = Wait Indefinitely |
| uint32_t STDCALL event_set | ( | EVENT_HANDLE | event | ) |
Set (Signal) an existing Event entry.
If the event is currently signaled then return with no action
If the event is unsignaled then, if the event is manual reset release all waiting threads and return. If the event is auto reset release one waiting thread, unsignal the event and return
If no threads are waiting then simply signal the event and return, if the event is auto reset then the next thread to wait will unsignal the event
| Event | Event to set |
| uint32_t STDCALL event_reset | ( | EVENT_HANDLE | event | ) |
Reset (Unsignal) an existing Event entry.
If the event is currently unsignaled then return with no action
If the event is signaled then unsignal the event and return
| Event | Event to reset |
| uint32_t STDCALL event_pulse | ( | EVENT_HANDLE | event | ) |
Pulse (Set then Reset) an existing Event entry.
If the event is currently signaled then unsignal the event and return
If the event is unsignaled then, if the event is manual reset release all waiting threads, unsignal the event and return. If the event is auto reset release one waiting thread, unsignal the event and return
If no threads are waiting then simply unsignal the event and return
| Event | Event to pulse |
| TIMER_HANDLE STDCALL timer_create | ( | uint32_t | interval, |
| BOOL | enabled, | ||
| BOOL | reschedule, | ||
| timer_event_proc | event, | ||
| void * | data ) |
Create and insert a new Timer entry.
Timer Functions
| Interval | Number of milliseconds between timer events |
| Enabled | If true then timer generates events |
| Reschedule | If true then reschedule timer after each event |
| Event | The function to call when the timer event is generated |
| Data | Data to be passed to the function when the timer event is generated (May be nil) |
| TIMER_HANDLE STDCALL timer_create_ex | ( | uint32_t | interval, |
| uint32_t | state, | ||
| uint32_t | flags, | ||
| timer_event_proc | event, | ||
| void * | data ) |
Create and insert a new Timer entry.
| Interval | Number of milliseconds between timer events |
| State | State of timer entry (eg TIMER_STATE_ENABLED) |
| Flags | Flags of timer entry (eg TIMER_FLAG_RESCHEDULE) |
| Event | The function to call when the timer event is generated |
| Data | Data to be passed to the function when the timer event is generated (May be nil) |
| uint32_t STDCALL timer_destroy | ( | TIMER_HANDLE | timer | ) |
Destroy and remove an existing Timer entry.
| Timer | Handle of Timer entry to destroy |
| uint32_t STDCALL timer_enable | ( | TIMER_HANDLE | timer | ) |
Enable an existing Timer entry (Timer events will be generated).
| Timer | Handle of Timer entry to enable |
| uint32_t STDCALL timer_enable_ex | ( | TIMER_HANDLE | timer, |
| uint32_t | interval, | ||
| timer_event_proc | event, | ||
| void * | data ) |
Enable and update an existing Timer entry (Timer events will be generated).
| Timer | Handle of Timer entry to enable |
| Interval | Number of milliseconds between timer events |
| Event | The function to call when the timer event is generated |
| Data | Data to be passed to the function when the timer event is generated (May be nil) |
| uint32_t STDCALL timer_disable | ( | TIMER_HANDLE | timer | ) |
Disable an existing Timer entry (Timer events will not be generated).
| Timer | Handle of Timer entry to disable |
| TIMER_HANDLE STDCALL timer_dequeue | ( | void | ) |
Get and remove the first timer from the Timer list.
| int STDCALL timer_first_key | ( | void | ) |
Get the first Key value from the Timer list.
| uint32_t STDCALL timer_insert_key | ( | TIMER_HANDLE | timer, |
| int | key ) |
Insert the supplied timer in the Timer list in delta ascending order based on Key.
| Timer | Handle of timer to be inserted |
| Key | The key to order the insertion on |
| uint32_t STDCALL timer_delete_key | ( | TIMER_HANDLE | timer | ) |
Delete the supplied timer from the Timer list.
| Timer | Handle of timer to be deleted |
| int STDCALL timer_decrement_key | ( | void | ) |
Decrement the first Key value in the Timer list.
Check if the Timer list is empty.
Check if the Timer list is not empty.
| uint32_t STDCALL timer_check | ( | void | ) |
Check if the timer list is empty, if not then decrement the first key.
If the key reaches zero, return success to indicate there are timers to be triggered
| uint32_t STDCALL timer_trigger | ( | void | ) |
Remove all entries from the timer list that have reached their interval.
For each timer a message will be sent to the Timer thread to call the event
| uint32_t STDCALL worker_schedule | ( | uint32_t | interval, |
| worker_task_proc | task, | ||
| void * | data, | ||
| worker_cb | callback ) |
Schedule a task to be performed by a worker thread now or in the future.
Worker Functions
| Interval | The number of milliseconds before the task is to be performed (0 for immediate) |
| Task | The function to be called by the worker when the interval has elapsed |
| Data | A pointer to user defined data which will be passed to the task function (Optional) |
| Callback | The function to be called by the worker when the task has completed (Optional) |
| WORKER_HANDLE STDCALL worker_schedule_ex | ( | uint32_t | interval, |
| uint32_t | flags, | ||
| worker_task_proc | task, | ||
| void * | data, | ||
| worker_cb | callback ) |
Schedule a task to be performed by a worker thread now or in the future.
| Interval | The number of milliseconds before the task is to be performed (0 for immediate) |
| Flags | The flags for the task (eg WORKER_FLAG_RESCHEDULE) |
| Task | The function to be called by the worker when the interval has elapsed |
| Data | A pointer to user defined data which will be passed to the task function (Optional) |
| Callback | The function to be called by the worker when the task has completed (Optional) |
| uint32_t STDCALL worker_cancel | ( | WORKER_HANDLE | worker | ) |
Cancel a previously scheduled worker thread task.
| Worker | The handle of the worker task to cancel |
| uint32_t STDCALL worker_schedule_irq | ( | uint32_t | affinity, |
| worker_task_proc | task, | ||
| void * | data, | ||
| worker_cb | callback ) |
Schedule a task to be performed by a worker thread when the caller is an IRQ handler.
| Affinity | CPU Affinity for memory allocation (eg CPU_AFFINITY_0 or CPU_AFFINITY_NONE) |
| Task | The function to be called by the worker |
| Data | A pointer to user defined data which will be passed to the task function (Optional) |
| Callback | The function to be called by the worker when the task has completed (Optional) |
| uint32_t STDCALL worker_schedule_irq_ex | ( | uint32_t | affinity, |
| uint32_t | flags, | ||
| worker_task_proc | task, | ||
| void * | data, | ||
| worker_cb | callback ) |
Schedule a task to be performed by a worker thread when the caller is an IRQ handler.
| Affinity | CPU Affinity for memory allocation (eg CPU_AFFINITY_0 or CPU_AFFINITY_NONE) |
| Flags | The flags for the task (eg WORKER_FLAG_PRIORITY) |
| Task | The function to be called by the worker |
| Data | A pointer to user defined data which will be passed to the task function (Optional) |
| Callback | The function to be called by the worker when the task has completed (Optional) |
| uint32_t STDCALL worker_schedule_fiq | ( | uint32_t | affinity, |
| worker_task_proc | task, | ||
| void * | data, | ||
| worker_cb | callback ) |
Schedule a task to be performed by a worker thread when the caller is an FIQ handler.
| Affinity | CPU Affinity for memory allocation (eg CPU_AFFINITY_0 or CPU_AFFINITY_NONE) |
| Task | The function to be called by the worker |
| Data | A pointer to user defined data which will be passed to the task function (Optional) |
| Callback | The function to be called by the worker when the task has completed (Optional) |
| uint32_t STDCALL worker_schedule_fiq_ex | ( | uint32_t | affinity, |
| uint32_t | flags, | ||
| worker_task_proc | task, | ||
| void * | data, | ||
| worker_cb | callback ) |
Schedule a task to be performed by a worker thread when the caller is an FIQ handler.
| Affinity | CPU Affinity for memory allocation (eg CPU_AFFINITY_0 or CPU_AFFINITY_NONE) |
| Flags | The flags for the task (eg WORKER_FLAG_PRIORITY) |
| Task | The function to be called by the worker |
| Data | A pointer to user defined data which will be passed to the task function (Optional) |
| Callback | The function to be called by the worker when the task has completed (Optional) |
| uint32_t STDCALL worker_increase | ( | uint32_t | count | ) |
Increase the number of worker threads available.
| Count | Number of worker threads to increase by |
Increase the number of worker threads available.
| Count | Number of worker threads to increase by |
| Priority | If true increase worker priority threads |
| uint32_t STDCALL worker_decrease | ( | uint32_t | count | ) |
Decrease the number of worker threads available.
| Count | Number of worker threads to decrease by |
Decrease the number of worker threads available.
| Count | Number of worker threads to decrease by |
| Priority | If true decrease worker priority threads |
| uint32_t STDCALL tasker_thread_send_message | ( | THREAD_HANDLE | thread, |
| THREAD_MESSAGE * | message ) |
Perform a ThreadSendMessage() function call using the tasker list.
Tasker Functions
| uint32_t STDCALL tasker_messageslot_send | ( | MESSAGESLOT_HANDLE | messageslot, |
| THREAD_MESSAGE * | message ) |
Perform a MessageslotSend() function call using the tasker list.
| uint32_t STDCALL tasker_semaphore_signal | ( | SEMAPHORE_HANDLE | semaphore, |
| uint32_t | count ) |
Perform a SemaphoreSignal() function call using the tasker list.
| uint32_t STDCALL tasker_completion_reset | ( | COMPLETION_HANDLE | completion | ) |
Perform a CompletionReset() function call using the tasker list.
| uint32_t STDCALL tasker_completion_complete | ( | COMPLETION_HANDLE | completion, |
| BOOL | all ) |
Perform a CompletionComplete() or CompletionCompleteAll() function call using the tasker list.
| uint32_t STDCALL tasker_enqueue | ( | TASKER_TASK * | task | ) |
Add the supplied task to the end of the Tasker list.
| TASKER_TASK *STDCALL tasker_dequeue | ( | void | ) |
Get and remove the first task from the Tasker list.
| uint32_t STDCALL tasker_check | ( | void | ) |
Check if the tasker list is empty or contains tasks.
| uint32_t STDCALL tasker_trigger | ( | void | ) |
Dequeue all tasks in the tasker list and perform the requested task for each.
| THREAD_ID STDCALL begin_thread | ( | void * | signalaction, |
| size_t | stacksize, | ||
| thread_func | threadfunction, | ||
| void * | threadparameter, | ||
| uint32_t | creationflags, | ||
| THREAD_ID * | threadid ) |
Start a new thread.
RTL Thread Manager Functions See: \source\rtl\inc\thread.inc and \source\rtl\inc\threadh.inc See: \source\rtl\inc\system.inc and \source\rtl\inc\systemh.inc
| SignalAction | Not used by Ultibo |
| StackSize | The stack size for the new thread |
| ThreadFunction | The function to be executed by the new thread |
| ThreadParameter | A pointer to be passed to ThreadFunction (Optional) |
| CreationFlags | Flags to determine how the new thread is created (eg THREAD_CREATE_SUSPENDED) |
| ThreadId | Filled with the thread ID of the new thread on return |
| THREAD_ID STDCALL begin_thread_ex | ( | void * | signalaction, |
| size_t | stacksize, | ||
| thread_func | threadfunction, | ||
| void * | threadparameter, | ||
| uint32_t | creationflags, | ||
| uint32_t | priority, | ||
| uint32_t | affinity, | ||
| uint32_t | cpu, | ||
| const char * | name, | ||
| THREAD_ID * | threadid ) |
Start a new thread.
| SignalAction | Not used by Ultibo |
| StackSize | The stack size for the new thread |
| ThreadFunction | The function to be executed by the new thread |
| ThreadParameter | A pointer to be passed to ThreadFunction (Optional) |
| CreationFlags | Flags to determine how the new thread is created (eg THREAD_CREATE_SUSPENDED) |
| Priority | The priority of the new thread (eg THREAD_PRIORITY_NORMAL) |
| Affinity | The CPU affinity of the new thread (eg CPU_AFFINITY_ALL) |
| CPU | The CPU to assign new thread to (eg CPU_ID_0) |
| Name | The name of the new thread |
| ThreadId | Filled with the thread ID of the new thread on return |
| void STDCALL end_thread | ( | uint32_t | exitcode | ) |
End the current thread.
| ExitCode | The exit code returned by a call to ThreadGetExitCode |
| uint32_t STDCALL spin_get_count | ( | void | ) |
Get the current spin lock count.
Thread Helper Functions
| uint32_t STDCALL mutex_get_count | ( | void | ) |
Get the current mutex count.
| uint32_t STDCALL critical_section_get_count | ( | void | ) |
Get the current critical section count.
| uint32_t STDCALL semaphore_get_count | ( | void | ) |
Get the current semaphore count.
| uint32_t STDCALL synchronizer_get_count | ( | void | ) |
Get the current synchronizer count.
| uint32_t STDCALL condition_get_count | ( | void | ) |
Get the current condition count.
| uint32_t STDCALL completion_get_count | ( | void | ) |
Get the current completion count.
| uint32_t STDCALL list_get_count | ( | void | ) |
Get the current list count.
| uint32_t STDCALL queue_get_count | ( | void | ) |
Get the current queue count.
| uint32_t STDCALL thread_get_count | ( | void | ) |
Get the current thread count.
| uint32_t STDCALL thread_tls_get_count | ( | void | ) |
Get the current thread tls count.
| void *STDCALL thread_allocate_stack | ( | uint32_t | stacksize | ) |
Allocate memory for a new thread stack.
| StackSize | Number of bytes requested for new thread stack |
| void STDCALL thread_release_stack | ( | void * | stackbase, |
| uint32_t | stacksize ) |
Release a thread stack allocated with ThreadAllocateStack.
| StackBase | Pointer to the top (highest address) of the thread stack (as returned by ThreadAllocateStack |
| StackSize | Size of the thread stack, in bytes (Same value passed to ThreadAllocateStack) |
| void *STDCALL thread_setup_stack | ( | void * | stackbase, |
| thread_start_proc | startproc, | ||
| thread_end_proc | returnproc, | ||
| void * | parameter ) |
| THREAD_SNAPSHOT *STDCALL thread_snapshot_create | ( | void | ) |
| uint32_t STDCALL thread_snapshot_destroy | ( | THREAD_SNAPSHOT * | snapshot | ) |
| uint32_t STDCALL messageslot_get_count | ( | void | ) |
Get the current messageslot count.
| uint32_t STDCALL mailslot_get_count | ( | void | ) |
Get the current mailslot count.
| uint32_t STDCALL buffer_get_count | ( | void | ) |
Get the current buffer count.
| uint32_t STDCALL event_get_count | ( | void | ) |
Get the current event count.
| uint32_t STDCALL timer_get_count | ( | void | ) |
Get the current timer count.
| uint32_t STDCALL worker_get_count | ( | void | ) |
Get the current worker thread count.
| uint32_t STDCALL worker_get_priority_count | ( | void | ) |
Get the current worker priority thread count.
| uint32_t STDCALL tasker_get_count | ( | void | ) |
Get the current tasker count.
| uint32_t STDCALL list_type_to_string | ( | uint32_t | listtype, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL queue_type_to_string | ( | uint32_t | queuetype, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL thread_type_to_string | ( | uint32_t | threadtype, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL thread_state_to_string | ( | uint32_t | threadstate, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL thread_priority_to_string | ( | uint32_t | threadpriority, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL scheduler_get_list_flags | ( | uint32_t | listtype | ) |
Get the list flags for the specified type of list.
Scheduler Helper Functions
| uint32_t STDCALL scheduler_get_queue_flags | ( | uint32_t | queuetype | ) |
Get the queue flags for the specified type of scheduler queue.
| QUEUE_HANDLE STDCALL scheduler_get_queue_handle | ( | uint32_t | cpuid, |
| uint32_t | queuetype ) |
Get the queue handle for the specified type of scheduler queue on the specified CPU.
| QUEUE_HANDLE STDCALL scheduler_get_queue_handle_ex | ( | uint32_t | cpuid, |
| uint32_t | priority ) |
Get the queue handle for the specified thread priority on the specified CPU.
| uint32_t STDCALL scheduler_get_thread_count | ( | uint32_t | cpuid | ) |
Get the thread count for the specified CPU.
| uint32_t STDCALL scheduler_get_thread_quantum | ( | uint32_t | cpuid | ) |
Get the current thread quantum for the specified CPU.
| THREAD_HANDLE STDCALL scheduler_get_thread_handle | ( | uint32_t | cpuid, |
| uint32_t | threadtype ) |
Get the thread handle for the specified type of thread on the specified CPU.
| uint32_t STDCALL scheduler_get_priority_mask | ( | uint32_t | cpuid | ) |
Get the current priority mask for the specified CPU.
| uint32_t STDCALL scheduler_get_priority_quantum | ( | uint32_t | priority | ) |
Get the scheduler quantum for the specified thread priority.
| uint32_t STDCALL scheduler_set_priority_quantum | ( | uint32_t | priority, |
| uint32_t | quantum ) |
Set the scheduler quantum for the specified thread priority.
| uint32_t STDCALL scheduler_get_migration_quantum | ( | void | ) |
Get the current migration quantum.
| uint32_t STDCALL scheduler_get_starvation_quantum | ( | uint32_t | cpuid | ) |
Get the current starvation quantum for the specified CPU.
| uint32_t STDCALL scheduler_get_thread_next | ( | void | ) |
Get the next CPU for thread allocation.
| uint32_t STDCALL scheduler_get_thread_migration | ( | void | ) |
Get the current thread migration setting.
| uint32_t STDCALL scheduler_get_thread_preempt | ( | uint32_t | cpuid | ) |
Get the current thread preempt setting for the specified CPU.
| uint32_t STDCALL scheduler_get_thread_allocation | ( | uint32_t | cpuid | ) |
Get the current thread allocation setting for the specified CPU.
| uint32_t STDCALL scheduler_migration_to_string | ( | uint32_t | migration, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL scheduler_preempt_to_string | ( | uint32_t | preempt, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL scheduler_allocation_to_string | ( | uint32_t | allocation, |
| char * | string, | ||
| uint32_t | len ) |
| uint32_t STDCALL timer_get_list_flags | ( | void | ) |
Get the lock flags for the timer list.
Timer Helper Functions
| uint32_t STDCALL timer_get_messageslot_flags | ( | void | ) |
Get the lock flags for the timer messageslot.
| uint32_t STDCALL worker_get_messageslot_flags | ( | void | ) |
Get the lock flags for the worker messageslot.
Worker Helper Functions