Basic structures that contain the internal state of kernel. More...
Data Structures | |
struct | OS_thread_t |
Thread control block. More... | |
struct | OS_stack_t |
Kernel structure for maintaining thread stacks. More... | |
struct | OS_process_t |
Process control block. More... | |
struct | OS_core_state_t |
Structure holding current scheduling state of CPU. More... | |
Macros | |
#define | OS_TASK_NO_STACK (~0) |
#define | OS_STACK_DWORD (OS_STACK_SIZE/4) |
Typedefs | |
typedef Process_t | OS_RPC_stack[8] |
RPC call owner process stack. | |
typedef int | Event_t |
Type to carry event being notified. | |
typedef void() | WaitHandler_t(const void *, Thread_t, int, Event_t) |
Prototype for function that handles thread wakeup on notification. | |
Enumerations | |
enum | ThreadState { THREAD_STATE_EMPTY = 0 , THREAD_STATE_READY , THREAD_STATE_RUNNING , THREAD_STATE_CREATED , THREAD_STATE_STOPPED , THREAD_STATE_FINISHED , THREAD_STATE_WAITING , THREAD_STATE_MIGRATING } |
List of states in which thread can be. More... | |
Variables | |
struct OS_thread_t | os_threads [OS_THREADS] |
Scheduler notion on existing threads. | |
struct OS_process_t | os_processes [OS_PROCESSES] |
Scheduler notion on existing processes. | |
struct OS_stack_t | os_stacks |
Scheduler notion on existing stacks. | |
Basic structures that contain the internal state of kernel.
Kernel is built around minimalistic core, which consists of prioritized thread scheduler. Scheduler can be started up after basic HW setup is done by calling os_start(). This will collect all auto-started threads, prepare them and start thread scheduler. All other mechanisms are built around thread scheduler.
#define OS_STACK_DWORD (OS_STACK_SIZE/4) |
#define OS_TASK_NO_STACK (~0) |
typedef int Event_t |
Type to carry event being notified.
Event signals what exactly happened to the object being notified. See EventTypes for the list of events.
typedef Process_t OS_RPC_stack[8] |
RPC call owner process stack.
This stack records owners of nested RPC calls. It can accomodate up to 8 owners which means 8 nested RPC calls.
Prototype for function that handles thread wakeup on notification.
enum ThreadState |
List of states in which thread can be.
Enumerator | |
---|---|
THREAD_STATE_EMPTY | This thread slot is empty (default after reset) |
THREAD_STATE_READY | Thread is ready to be scheduled. |
THREAD_STATE_RUNNING | Thread is currently running. |
THREAD_STATE_CREATED | Thread was created, but does not have stack assigned. |
THREAD_STATE_STOPPED | Thread was running, but was forced to stop. It still has valid state so can't be disposed of without damage. Can be placed into ready/running state by calling os_thread_continue(). |
THREAD_STATE_FINISHED | Thread finished it's execution either explicitly by calling thread_exit() or by returning from thread entrypoint. Nobody called thread_join() yet. This state is the same as "zombie" in Linux. |
THREAD_STATE_WAITING | Thread is waitihg for object to be notified. |
THREAD_STATE_MIGRATING | Thread has been stopped and is ready to migrate over to another core. |
|
extern |
Scheduler notion on existing processes.
Scheduler notion on existing processes.
|
extern |
Scheduler notion on existing stacks.
Scheduler notion on existing stacks.
|
extern |
Scheduler notion on existing threads.
Scheduler notion on existing threads.