|
ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
|
ICARUS Semaphore Implementation. More...
Go to the source code of this file.
Functions | |
| bool | __semaphore_init (uint8_t semaphore_idx, uint32_t semaphore_count) |
| Privileged implementation of semaphore_init. | |
| bool | __semaphore_feed (uint8_t semaphore_idx) |
| Privileged implementation of semaphore_feed. | |
| bool | __semaphore_consume (uint8_t semaphore_idx) |
| Privileged implementation of semaphore_consume. | |
| bool | __semaphore_consume_timeout (uint8_t semaphore_idx, uint32_t max_ticks) |
| Privileged implementation of semaphore_consume_timeout. | |
| uint32_t | __semaphore_get_count (uint8_t semaphore_idx) |
| Privileged implementation of semaphore_get_count. | |
| uint32_t | __semaphore_get_max_count (uint8_t semaphore_idx) |
| Privileged implementation of semaphore_get_max_count. | |
| bool | __sem_can_feed (uint8_t semaphore_idx) |
| Privileged call gate: can semaphore accept a feed? | |
| bool | __sem_can_consume (uint8_t semaphore_idx) |
| Privileged call gate: can semaphore be consumed? | |
| void | __sem_increment (uint8_t semaphore_idx) |
| Privileged write gate: increment semaphore count. | |
| void | __sem_decrement (uint8_t semaphore_idx) |
| Privileged write gate: decrement semaphore count. | |
ICARUS Semaphore Implementation.
Counting semaphore implementation for task synchronization.
Definition in file semaphore.c.
| bool __sem_can_consume | ( | uint8_t | semaphore_idx | ) |
Privileged call gate: can semaphore be consumed?
Definition at line 186 of file semaphore.c.
References icarus_semaphore_t::count, ICARUS_MAX_SEMAPHORES, and semaphore_list.
Referenced by sem_can_consume(), and SVC_Handler_C().
| bool __sem_can_feed | ( | uint8_t | semaphore_idx | ) |
Privileged call gate: can semaphore accept a feed?
Definition at line 172 of file semaphore.c.
References icarus_semaphore_t::count, ICARUS_MAX_SEMAPHORES, icarus_semaphore_t::max_count, and semaphore_list.
Referenced by sem_can_feed(), and SVC_Handler_C().
| void __sem_decrement | ( | uint8_t | semaphore_idx | ) |
Privileged write gate: decrement semaphore count.
Definition at line 213 of file semaphore.c.
References icarus_semaphore_t::count, ICARUS_MAX_SEMAPHORES, os_tick_count, semaphore_list, and icarus_semaphore_t::tick_updated_at.
Referenced by sem_decrement(), and SVC_Handler_C().
| void __sem_increment | ( | uint8_t | semaphore_idx | ) |
Privileged write gate: increment semaphore count.
Definition at line 199 of file semaphore.c.
References icarus_semaphore_t::count, ICARUS_MAX_SEMAPHORES, os_tick_count, semaphore_list, and icarus_semaphore_t::tick_updated_at.
Referenced by sem_increment(), and SVC_Handler_C().
| bool __semaphore_consume | ( | uint8_t | semaphore_idx | ) |
Privileged implementation of semaphore_consume.
Definition at line 81 of file semaphore.c.
References ICARUS_MAX_SEMAPHORES, sem_can_consume(), sem_decrement(), semaphore_list, and task_active_sleep().
Referenced by semaphore_consume().
| bool __semaphore_consume_timeout | ( | uint8_t | semaphore_idx, |
| uint32_t | max_ticks | ||
| ) |
Privileged implementation of semaphore_consume_timeout.
Spins with task_active_sleep(1) checking sem_can_consume() each tick. Returns false if max_ticks elapse without the semaphore becoming available. max_ticks == 0 is a non-blocking try (check once, return immediately).
| semaphore_idx | Semaphore index. |
| max_ticks | Maximum ticks to wait. |
| true | Acquired. |
| false | Timeout or invalid. |
Definition at line 116 of file semaphore.c.
References ICARUS_MAX_SEMAPHORES, sem_can_consume(), sem_decrement(), semaphore_list, and task_active_sleep().
Referenced by semaphore_consume_timeout(), and SVC_Handler_C().
| bool __semaphore_feed | ( | uint8_t | semaphore_idx | ) |
Privileged implementation of semaphore_feed.
Definition at line 54 of file semaphore.c.
References ICARUS_MAX_SEMAPHORES, sem_can_feed(), sem_increment(), semaphore_list, and task_active_sleep().
Referenced by semaphore_feed().
| uint32_t __semaphore_get_count | ( | uint8_t | semaphore_idx | ) |
Privileged implementation of semaphore_get_count.
Definition at line 146 of file semaphore.c.
References icarus_semaphore_t::count, ICARUS_MAX_SEMAPHORES, and semaphore_list.
Referenced by semaphore_get_count(), and SVC_Handler_C().
| uint32_t __semaphore_get_max_count | ( | uint8_t | semaphore_idx | ) |
Privileged implementation of semaphore_get_max_count.
Definition at line 158 of file semaphore.c.
References ICARUS_MAX_SEMAPHORES, icarus_semaphore_t::max_count, and semaphore_list.
Referenced by semaphore_get_max_count(), and SVC_Handler_C().
| bool __semaphore_init | ( | uint8_t | semaphore_idx, |
| uint32_t | semaphore_count | ||
| ) |
Privileged implementation of semaphore_init.
Definition at line 35 of file semaphore.c.
References icarus_semaphore_t::count, icarus_semaphore_t::engaged, ICARUS_MAX_SEMAPHORES, icarus_semaphore_t::max_count, os_tick_count, semaphore_list, and icarus_semaphore_t::tick_updated_at.
Referenced by semaphore_init(), and SVC_Handler_C().