Kernel scheduler internals.
◆ STATIC
◆ os_boot_thread()
void os_boot_thread |
( |
Thread_t |
boot_thread | ) |
|
Start executing thread.
Used to actually start executing in thread mode just after the kernel has been initialized and is ready to start the first thread. This function has to perform CPU switch from privileged mode in which kernel runs into unprivileged mode in which threads are supposed to run. Thread passed to this function is in state ready to be executed by normal kernel thread switching mechanism on this platform.
- Parameters
-
boot_thread | ID of thread that shall be started |
◆ os_process_create()
Create process using process definition.
Takes process definition and initializes MPU regions for process out of it.
- Parameters
-
process_id | ID of process to be initialized |
definition | process definition. This is constructed at compile time using OS_APPLICATION macros |
- Returns
- E_OK if process was contructed properly, E_INVALID if process ID is already used or if process definition contains invalid section boundaries. E_OUT_OF_RANGE is returned if process ID requested is out of limits given by the size of process table.
◆ os_thread_populate_stack()
uint32_t * os_thread_populate_stack |
( |
int |
stack_id, |
|
|
unsigned |
stack_size, |
|
|
entrypoint_t * |
entrypoint, |
|
|
void * |
data |
|
) |
| |
Populate stack of new thread so it can be executed.
Populates stack of new thread so that it can be executed with no other actions required. Returns the address where SP shall point to.
- Parameters
-
stack_id | ID of stack to be populated |
stack_size | size of stack in 32-bit quantities |
entrypoint | address of thread entrypoint function |
data | address of data passed to the thread as its 1st argument |
- Returns
- Address to which the SP shall be set.