Functions | |
bool | schedule_context_switch (uint32_t current_task, uint32_t next_task) |
Opt for task switch. | |
void | PendSV_Handler (void) |
Handle task switch. | |
Variables | |
static struct OS_thread_t * | old_task |
static struct OS_thread_t * | new_task |
static struct OS_process_t * | old_parent_process |
static struct OS_process_t * | new_parent_process |
static struct OS_process_t * | old_host_process |
static struct OS_process_t * | new_host_process |
static uint8_t | new_thread_id |
static Process_t | new_process_id |
static bool | ctxt_switch_pending |
struct OS_stack_t | os_stacks |
Thread stacks. | |
void PendSV_Handler | ( | void | ) |
Handle task switch.
This function performs the heavy lifting of context switching when CPU is switched from one task to another. As of now, it stores outgoing task's application context onto stack and restores incoming task's context from its stack. It then sets PSP to point to incoming task's stack and resumes normal operation.
bool schedule_context_switch | ( | uint32_t | current_task, |
uint32_t | next_task | ||
) |
Opt for task switch.
Schedule context switch on next suitable moment.
Calling this function will prepare task switch. It will set up some stuff needed and then schedule PendSV.
current_task | ID of task, which is currently running |
next_task | ID of task, which should be scheduled next |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
extern |
Thread stacks.
Scheduler notion on existing stacks.