|
ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
|
ICARUS Scheduler - Task Scheduling and Timing. More...
Go to the source code of this file.
Functions | |
| void | os_yield (void) |
| Voluntarily yield CPU to scheduler. | |
| uint32_t | task_active_sleep (uint32_t ticks) |
| Sleep for specified ticks (cooperative) | |
| uint32_t | task_blocking_sleep (uint32_t ticks) |
| Sleep with scheduler disabled (blocking) | |
| uint32_t | task_busy_wait (uint32_t ticks) |
| Busy-wait for specified ticks. | |
| uint32_t | os_get_tick_count (void) |
| Get current system tick count. | |
| uint8_t | os_get_running_task_count (void) |
| Get number of active tasks. | |
| const char * | os_get_current_task_name (void) |
| Get name of currently executing task. | |
| uint32_t | os_get_task_ticks_remaining (void) |
| Get remaining ticks in current time slice. | |
| const char * | os_get_task_name (uint8_t task_idx) |
| Get task name by index (safe from unprivileged mode) | |
| uint8_t | os_get_num_created_tasks (void) |
| Get number of created tasks (safe from unprivileged mode) | |
| uint8_t | os_is_running (void) |
| Check if OS is running (safe from unprivileged mode) | |
| icarus_task_state_t | os_get_task_state (uint8_t task_idx) |
| Get a task's current state (safe from unprivileged mode). | |
| uint32_t | os_get_task_dispatch_count (uint8_t task_idx) |
| Get a task's dispatch count (times scheduled to run). | |
| uint32_t | os_get_stack_watermark (uint8_t task_idx) |
| Get a task's stack high-water mark (minimum free words). | |
| void | os_update_stack_watermark (uint8_t task_idx) |
| Scan a task's stack for the sentinel pattern and update the watermark field in the TCB. | |
| void | __os_yield (void) |
| Privileged implementation of os_yield. | |
| uint32_t | __task_active_sleep (uint32_t ticks) |
| Privileged implementation of task_active_sleep. | |
| uint32_t | __task_blocking_sleep (uint32_t ticks) |
| Privileged implementation of task_blocking_sleep. | |
| uint32_t | __task_busy_wait (uint32_t ticks) |
| Privileged implementation of task_busy_wait. | |
| uint32_t | __os_get_tick_count (void) |
| Privileged implementation of os_get_tick_count. | |
| uint8_t | __os_get_running_task_count (void) |
| Privileged implementation of os_get_running_task_count. | |
| const char * | __os_get_current_task_name (void) |
| Privileged implementation of os_get_current_task_name. | |
| uint32_t | __os_get_task_ticks_remaining (void) |
| Privileged implementation of os_get_task_ticks_remaining. | |
| const char * | __os_get_task_name (uint8_t task_idx) |
| Privileged implementation of os_get_task_name. | |
| uint8_t | __os_get_num_created_tasks (void) |
| Privileged implementation of os_get_num_created_tasks. | |
| uint8_t | __os_is_running (void) |
| Privileged implementation of os_is_running. | |
| icarus_task_state_t | __os_get_task_state (uint8_t task_idx) |
| Privileged implementation of os_get_task_state. | |
| uint32_t | __os_get_task_dispatch_count (uint8_t task_idx) |
| Privileged implementation of os_get_task_dispatch_count. | |
| uint32_t | __os_get_stack_watermark (uint8_t task_idx) |
| Privileged implementation of os_get_stack_watermark. | |
| void | __os_update_stack_watermark (uint8_t task_idx) |
| Scan a task's stack from the base upward for the sentinel pattern (0xDEADC0DE) and update the watermark. | |
ICARUS Scheduler - Task Scheduling and Timing.
Task scheduling, yielding, and sleep functions.
Definition in file scheduler.h.
| const char * __os_get_current_task_name | ( | void | ) |
Privileged implementation of os_get_current_task_name.
Definition at line 65 of file scheduler.c.
References current_task_index, ICARUS_MAX_TASK_NAME_LEN, icarus_task_t::name, num_created_tasks, task_list, and task_name_buffer.
Referenced by os_get_current_task_name(), and SVC_Handler_C().
| uint8_t __os_get_num_created_tasks | ( | void | ) |
Privileged implementation of os_get_num_created_tasks.
Definition at line 345 of file kernel.c.
References num_created_tasks.
Referenced by os_get_num_created_tasks(), and SVC_Handler_C().
| uint8_t __os_get_running_task_count | ( | void | ) |
Privileged implementation of os_get_running_task_count.
Definition at line 56 of file scheduler.c.
References running_task_count.
Referenced by os_get_running_task_count(), and SVC_Handler_C().
| uint32_t __os_get_stack_watermark | ( | uint8_t | task_idx | ) |
Privileged implementation of os_get_stack_watermark.
| task_idx | Task index. |
Definition at line 387 of file kernel.c.
References num_created_tasks, icarus_task_t::stack_watermark, and task_list.
Referenced by os_get_stack_watermark(), and SVC_Handler_C().
| uint32_t __os_get_task_dispatch_count | ( | uint8_t | task_idx | ) |
Privileged implementation of os_get_task_dispatch_count.
| task_idx | Task index. |
Definition at line 375 of file kernel.c.
References icarus_task_t::dispatch_count, num_created_tasks, and task_list.
Referenced by os_get_task_dispatch_count(), and SVC_Handler_C().
| const char * __os_get_task_name | ( | uint8_t | task_idx | ) |
Privileged implementation of os_get_task_name.
Definition at line 315 of file kernel.c.
References ICARUS_MAX_TASK_NAME_LEN, icarus_task_t::name, num_created_tasks, and task_list.
Referenced by os_get_task_name(), and SVC_Handler_C().
| icarus_task_state_t __os_get_task_state | ( | uint8_t | task_idx | ) |
Privileged implementation of os_get_task_state.
| task_idx | Task index. |
Definition at line 363 of file kernel.c.
References num_created_tasks, task_list, icarus_task_t::task_state, and TASK_STATE_FINISHED.
Referenced by os_get_task_state(), and SVC_Handler_C().
| uint32_t __os_get_task_ticks_remaining | ( | void | ) |
Privileged implementation of os_get_task_ticks_remaining.
Definition at line 87 of file scheduler.c.
References current_task_ticks_remaining.
Referenced by os_get_task_ticks_remaining(), and SVC_Handler_C().
| uint32_t __os_get_tick_count | ( | void | ) |
Privileged implementation of os_get_tick_count.
Definition at line 48 of file scheduler.c.
References os_tick_count.
Referenced by os_get_tick_count(), and SVC_Handler_C().
| uint8_t __os_is_running | ( | void | ) |
Privileged implementation of os_is_running.
Definition at line 354 of file kernel.c.
References os_running.
Referenced by os_is_running(), and SVC_Handler_C().
| void __os_update_stack_watermark | ( | uint8_t | task_idx | ) |
Scan a task's stack from the base upward for the sentinel pattern (0xDEADC0DE) and update the watermark.
| task_idx | Task index. |
Definition at line 399 of file kernel.c.
References num_created_tasks, icarus_task_t::stack_base, icarus_task_t::stack_size, icarus_task_t::stack_watermark, and task_list.
Referenced by os_update_stack_watermark(), and SVC_Handler_C().
| void __os_yield | ( | void | ) |
Privileged implementation of os_yield.
Definition at line 99 of file scheduler.c.
References current_task_ticks_remaining, and ticks_per_task.
Referenced by __os_exit_task(), __os_kill_process(), __task_active_sleep(), os_yield(), and SVC_Handler_C().
| uint32_t __task_active_sleep | ( | uint32_t | ticks | ) |
Privileged implementation of task_active_sleep.
Definition at line 108 of file scheduler.c.
References __os_yield(), current_task_index, icarus_task_t::global_tick_paused, os_tick_count, task_list, icarus_task_t::task_state, TASK_STATE_BLOCKED, and icarus_task_t::ticks_to_pause.
Referenced by SVC_Handler_C(), and task_active_sleep().
| uint32_t __task_blocking_sleep | ( | uint32_t | ticks | ) |
Privileged implementation of task_blocking_sleep.
Definition at line 121 of file scheduler.c.
References enter_critical(), exit_critical(), and task_busy_wait().
Referenced by task_blocking_sleep().
| uint32_t __task_busy_wait | ( | uint32_t | ticks | ) |
Privileged implementation of task_busy_wait.
Definition at line 133 of file scheduler.c.
References os_get_tick_count(), and os_tick_count.
Referenced by task_busy_wait().
| const char * os_get_current_task_name | ( | void | ) |
| uint8_t os_get_num_created_tasks | ( | void | ) |
Get number of created tasks (safe from unprivileged mode)
Get number of created tasks (safe from unprivileged mode)
Definition at line 1145 of file svc.c.
References __os_get_num_created_tasks(), and SVC_GET_NUM_TASKS.
Referenced by display_init().
| uint8_t os_get_running_task_count | ( | void | ) |
Get number of active tasks.
Definition at line 594 of file svc.c.
References __os_get_running_task_count(), and SVC_OS_GET_RUNNING_TASK_COUNT.
| uint32_t os_get_stack_watermark | ( | uint8_t | task_idx | ) |
Get a task's stack high-water mark (minimum free words).
| task_idx | Task index. |
Get a task's stack high-water mark (minimum free words).
Definition at line 1225 of file svc.c.
References __os_get_stack_watermark(), and SVC_GET_STACK_WATERMARK.
| uint32_t os_get_task_dispatch_count | ( | uint8_t | task_idx | ) |
Get a task's dispatch count (times scheduled to run).
| task_idx | Task index. |
Get a task's dispatch count (times scheduled to run).
Definition at line 1205 of file svc.c.
References __os_get_task_dispatch_count(), and SVC_GET_TASK_DISPATCH_COUNT.
| const char * os_get_task_name | ( | uint8_t | task_idx | ) |
Get task name by index (safe from unprivileged mode)
| task_idx | Task index (0 to num_created_tasks-1) |
Get task name by index (safe from unprivileged mode)
| task_idx | Task index (0 to num_created_tasks-1) |
Definition at line 1123 of file svc.c.
References __os_get_task_name(), and SVC_GET_TASK_NAME.
Referenced by display_init().
| icarus_task_state_t os_get_task_state | ( | uint8_t | task_idx | ) |
Get a task's current state (safe from unprivileged mode).
| task_idx | Task index (0 to num_created_tasks-1). |
Get a task's current state (safe from unprivileged mode).
Definition at line 1185 of file svc.c.
References __os_get_task_state(), and SVC_GET_TASK_STATE.
| uint32_t os_get_task_ticks_remaining | ( | void | ) |
Get remaining ticks in current time slice.
Definition at line 613 of file svc.c.
References __os_get_task_ticks_remaining(), and SVC_OS_GET_TASK_TICKS_REMAINING.
| uint32_t os_get_tick_count | ( | void | ) |
Get current system tick count.
Definition at line 556 of file svc.c.
References __os_get_tick_count(), and SVC_OS_GET_TICK_COUNT.
Referenced by __task_busy_wait().
| uint8_t os_is_running | ( | void | ) |
Check if OS is running (safe from unprivileged mode)
Definition at line 1166 of file svc.c.
References __os_is_running(), and SVC_OS_IS_RUNNING.
Referenced by os_heartbeat_task().
| void os_update_stack_watermark | ( | uint8_t | task_idx | ) |
Scan a task's stack for the sentinel pattern and update the watermark field in the TCB.
| task_idx | Task index. |
Scan a task's stack for the sentinel pattern and update the watermark field in the TCB.
Definition at line 1245 of file svc.c.
References __os_update_stack_watermark(), and SVC_UPDATE_STACK_WATERMARK.
| void os_yield | ( | void | ) |
| uint32_t task_active_sleep | ( | uint32_t | ticks | ) |
| uint32_t task_blocking_sleep | ( | uint32_t | ticks | ) |
Sleep with scheduler disabled (blocking)
| ticks | Number of ticks to wait |
Sleep with scheduler disabled (blocking)
Definition at line 542 of file svc.c.
References __task_blocking_sleep().
Referenced by __io_putchar().
| uint32_t task_busy_wait | ( | uint32_t | ticks | ) |
Busy-wait for specified ticks.
| ticks | Number of ticks to wait |
Busy-wait for specified ticks.
Definition at line 549 of file svc.c.
References __task_busy_wait().
Referenced by __task_blocking_sleep().