C Microkernel Realtime eXecutive
Realtime Operating System for Cortex-M based microcontrollers
 
Loading...
Searching...
No Matches

Description

Kernel scheduler internals.

Macros

#define STATIC   static
 

Functions

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.
 
int os_process_create (Process_t process_id, const struct OS_process_definition_t *definition)
 Create process using process definition.
 
void os_boot_thread (Thread_t boot_thread)
 Start executing thread.
 

Macro Definition Documentation

◆ STATIC

#define STATIC   static

Function Documentation

◆ 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_threadID of thread that shall be started

◆ os_process_create()

int os_process_create ( Process_t  process_id,
const struct OS_process_definition_t definition 
)

Create process using process definition.

Takes process definition and initializes MPU regions for process out of it.

Parameters
process_idID of process to be initialized
definitionprocess 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_idID of stack to be populated
stack_sizesize of stack in 32-bit quantities
entrypointaddress of thread entrypoint function
dataaddress of data passed to the thread as its 1st argument
Returns
Address to which the SP shall be set.