|
ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
|
ICARUS Task Management - Creation and Lifecycle. More...
Go to the source code of this file.
Functions | |
| void | os_register_task (void(*function)(void), const char *name) |
| Register a task with automatic stack allocation. | |
| void | os_create_task (icarus_task_t *task, void(*function)(void), uint32_t *stack, uint32_t stack_size, uint32_t *data, const char *name) |
| Create a task with explicit stack allocation. | |
| void | os_exit_task (void) |
| Terminate current task normally. | |
| void | os_kill_process (uint8_t task_index) |
| Terminate another task by index. | |
| void | os_task_suicide (void) |
| Terminate current task (suicide) | |
| void | os_restart_task (uint8_t task_index) |
| Restart a killed or finished task (cold restart from entry point). | |
| void | __os_register_task (void(*function)(void), const char *name) |
| Privileged implementation of os_register_task. | |
| void | __os_exit_task (void) |
| Privileged implementation of os_exit_task. | |
| void | __os_kill_process (uint8_t task_index) |
| Privileged implementation of os_kill_process. | |
| void | __os_task_suicide (void) |
| Privileged implementation of os_task_suicide. | |
| void | __os_restart_task (uint8_t task_index) |
| Privileged implementation of os_restart_task. | |
ICARUS Task Management - Creation and Lifecycle.
Task creation, registration, and lifecycle management.
Definition in file task.h.
| void __os_exit_task | ( | void | ) |
Privileged implementation of os_exit_task.
Definition at line 90 of file task.c.
References __os_yield(), cleanup_task_idx, current_cleanup_task_idx, current_task_index, ICARUS_MAX_TASKS, running_task_count, task_list, icarus_task_t::task_state, and TASK_STATE_FINISHED.
Referenced by os_exit_task(), and SVC_Handler_C().
| void __os_kill_process | ( | uint8_t | task_index | ) |
Privileged implementation of os_kill_process.
Definition at line 110 of file task.c.
References __os_yield(), cleanup_task_idx, current_cleanup_task_idx, current_task_index, ICARUS_MAX_TASKS, num_created_tasks, running_task_count, task_list, icarus_task_t::task_state, and TASK_STATE_KILLED.
Referenced by __os_task_suicide(), os_kill_process(), and SVC_Handler_C().
| void __os_register_task | ( | void(*)(void) | function, |
| const char * | name | ||
| ) |
Privileged implementation of os_register_task.
Definition at line 74 of file task.c.
References __kernel_get_data(), __kernel_get_stack(), ICARUS_STACK_WORDS, num_created_tasks, os_create_task(), and task_list.
Referenced by __os_init(), os_register_task(), and SVC_Handler_C().
| void __os_restart_task | ( | uint8_t | task_index | ) |
Privileged implementation of os_restart_task.
Re-initializes a killed/finished task's stack frame from its original function pointer and stack base. The task re-enters the scheduler as if freshly created — no new stack slot is allocated, no memory is leaked.
| task_index | Index of the task to restart (1-based). |
Definition at line 154 of file task.c.
References icarus_task_t::dispatch_count, icarus_task_t::function, icarus_task_t::global_tick_paused, num_created_tasks, os_exit_task(), running_task_count, icarus_task_t::stack_base, icarus_task_t::stack_pointer, icarus_task_t::stack_size, icarus_task_t::stack_watermark, task_list, icarus_task_t::task_state, TASK_STATE_COLD, TASK_STATE_FINISHED, TASK_STATE_KILLED, and icarus_task_t::ticks_to_pause.
Referenced by os_restart_task(), and SVC_Handler_C().
| void __os_task_suicide | ( | void | ) |
Privileged implementation of os_task_suicide.
Definition at line 136 of file task.c.
References __os_kill_process(), current_task_index, and task_list.
Referenced by os_task_suicide(), and SVC_Handler_C().
| void os_create_task | ( | icarus_task_t * | task, |
| void(*)(void) | function, | ||
| uint32_t * | stack, | ||
| uint32_t | stack_size, | ||
| uint32_t * | data, | ||
| const char * | name | ||
| ) |
Create a task with explicit stack allocation.
| task | TCB to initialize |
| function | Task entry point |
| stack | Stack memory (8-byte aligned) |
| stack_size | Stack size in 32-bit words |
| name | Task name |
Definition at line 27 of file task.c.
References icarus_task_t::data_pointer, icarus_task_t::dispatch_count, icarus_task_t::function, icarus_task_t::global_tick_paused, ICARUS_MAX_TASK_NAME_LEN, ICARUS_MAX_TASKS, icarus_task_t::name, num_created_tasks, os_exit_task(), running_task_count, icarus_task_t::stack_base, icarus_task_t::stack_pointer, icarus_task_t::stack_size, icarus_task_t::stack_watermark, icarus_task_t::task_priority, TASK_PRIORITY_LOW, icarus_task_t::task_state, TASK_STATE_COLD, and icarus_task_t::ticks_to_pause.
Referenced by __os_register_task().
| void os_exit_task | ( | void | ) |
Terminate current task normally.
Terminate current task normally.
Definition at line 636 of file svc.c.
References __os_exit_task(), and SVC_OS_EXIT_TASK.
Referenced by __os_restart_task(), and os_create_task().
| void os_kill_process | ( | uint8_t | task_index | ) |
Terminate another task by index.
| task_index | Index of task to kill |
Terminate another task by index.
Definition at line 676 of file svc.c.
References __os_kill_process(), and SVC_OS_KILL_PROCESS.
| void os_register_task | ( | void(*)(void) | function, |
| const char * | name | ||
| ) |
Register a task with automatic stack allocation.
| function | Task entry point |
| name | Task name (max ICARUS_MAX_TASK_NAME_LEN chars) |
Register a task with automatic stack allocation.
Definition at line 658 of file svc.c.
References __os_register_task(), and SVC_OS_REGISTER_TASK.
| void os_restart_task | ( | uint8_t | task_index | ) |
Restart a killed or finished task (cold restart from entry point).
Re-initializes the task's stack frame from its original function pointer and stack base. The task re-enters the scheduler as if freshly created — no new stack slot is allocated.
| task_index | Index of the task to restart (1-based; 0 is idle). |
Restart a killed or finished task (cold restart from entry point).
Definition at line 693 of file svc.c.
References __os_restart_task(), and SVC_OS_RESTART_TASK.
| void os_task_suicide | ( | void | ) |
Terminate current task (suicide)
Definition at line 647 of file svc.c.
References __os_task_suicide(), and SVC_OS_TASK_SUICIDE.