3#include <cmrx/sys/runtime.h>
4#include <cmrx/defines.h>
5#include <conf/kernel.h>
6#include <arch/runtime.h>
129#define OS_TASK_NO_STACK (~0)
130#define OS_STACK_DWORD (OS_STACK_SIZE/4)
156#ifdef KERNEL_HAS_MEMORY_PROTECTION
uint8_t Process_t
Data type used for process IDs.
Definition defines.h:75
uint8_t Thread_t
Data type used for thread IDs.
Definition defines.h:72
#define OS_THREADS
How many threads can exist.
Definition kernel.h:32
#define OS_STACKS
How many stacks can be allocated.
Definition kernel.h:35
#define OS_PROCESSES
How many processes can be allocated.
Definition kernel.h:38
Process_t OS_RPC_stack[8]
RPC call owner process stack.
Definition runtime.h:52
struct OS_thread_t os_threads[OS_THREADS]
Scheduler notion on existing threads.
Definition sched.c:32
int Event_t
Type to carry event being notified.
Definition runtime.h:58
struct OS_process_t os_processes[OS_PROCESSES]
Scheduler notion on existing processes.
Definition sched.c:35
ThreadState
List of states in which thread can be.
Definition runtime.h:20
void() WaitHandler_t(const void *, Thread_t, int, Event_t)
Prototype for function that handles thread wakeup on notification.
Definition runtime.h:62
#define OS_STACK_DWORD
Definition runtime.h:130
struct OS_stack_t os_stacks
Scheduler notion on existing stacks.
Definition sched.c:48
@ THREAD_STATE_READY
Thread is ready to be scheduled.
Definition runtime.h:24
@ THREAD_STATE_MIGRATING
Thread has been stopped and is ready to migrate over to another core.
Definition runtime.h:44
@ THREAD_STATE_RUNNING
Thread is currently running.
Definition runtime.h:26
@ THREAD_STATE_STOPPED
Thread was running, but was forced to stop.
Definition runtime.h:33
@ THREAD_STATE_EMPTY
This thread slot is empty (default after reset)
Definition runtime.h:22
@ THREAD_STATE_FINISHED
Thread finished it's execution either explicitly by calling thread_exit() or by returning from thread...
Definition runtime.h:38
@ THREAD_STATE_WAITING
Thread is waitihg for object to be notified.
Definition runtime.h:41
@ THREAD_STATE_CREATED
Thread was created, but does not have stack assigned.
Definition runtime.h:28
ARM-specific architecture state of a thread.
Definition runtime.h:58
Structure holding current scheduling state of CPU.
Definition runtime.h:183
Thread_t thread_prev
previously running thread ID
Definition runtime.h:184
Thread_t thread_next
ID of thread which will be scheduled once thread switch occurs.
Definition runtime.h:186
Thread_t thread_current
ID of thread which is currently executed.
Definition runtime.h:185
Static definition of process in firmware image.
Definition runtime.h:31
Process control block.
Definition runtime.h:153
const struct OS_process_definition_t * definition
Definition runtime.h:154
Kernel structure for maintaining thread stacks.
Definition runtime.h:137
uint32_t stacks[OS_STACKS][OS_STACK_DWORD]
Thread stacks.
Definition runtime.h:139
uint32_t allocations
Information about stack allocation.
Definition runtime.h:143
Thread control block.
Definition runtime.h:72
uint32_t signals
Current pending signal bitmask.
Definition runtime.h:95
int exit_status
Exit status after thread quit.
Definition runtime.h:100
uint8_t base_priority
Configured priority.
Definition runtime.h:126
enum ThreadState state
State of this thread.
Definition runtime.h:109
struct Arch_State_t arch
Definition runtime.h:97
uint32_t * sp
Value of SP.
Definition runtime.h:77
WaitHandler_t * wait_callback
Definition runtime.h:85
void(* signal_handler)(int)
Address of signal handler to use.
Definition runtime.h:89
uint8_t stack_id
ID of stack, which is allocated to this thread.
Definition runtime.h:106
uint8_t core_id
Core at which this thread is running.
Definition runtime.h:120
Process_t process_id
Owning process reference.
Definition runtime.h:117
const void * wait_object
Identification of object, which causes this thread to block.
Definition runtime.h:83
uint8_t priority
Thread priority.
Definition runtime.h:114
OS_RPC_stack rpc_stack
Ummmmm...
Definition runtime.h:103