117 uint32_t max_ticks) {
131 if (waited >= max_ticks) {
#define ICARUS_MAX_SEMAPHORES
Maximum number of semaphores.
ICARUS Kernel Core - State and Initialization.
icarus_semaphore_t * semaphore_list[64]
Array of pointers to all semaphores.
volatile uint32_t os_tick_count
System tick counter.
uint32_t task_active_sleep(uint32_t ticks)
Sleep for specified ticks (cooperative, via SVC)
ICARUS Scheduler - Task Scheduling and Timing.
uint32_t __semaphore_get_count(uint8_t semaphore_idx)
Privileged implementation of semaphore_get_count.
bool __semaphore_consume_timeout(uint8_t semaphore_idx, uint32_t max_ticks)
Privileged implementation of semaphore_consume_timeout.
uint32_t __semaphore_get_max_count(uint8_t semaphore_idx)
Privileged implementation of semaphore_get_max_count.
void __sem_decrement(uint8_t semaphore_idx)
Privileged write gate: decrement semaphore count.
bool __semaphore_feed(uint8_t semaphore_idx)
Privileged implementation of semaphore_feed.
bool __sem_can_consume(uint8_t semaphore_idx)
Privileged call gate: can semaphore be consumed?
bool __semaphore_init(uint8_t semaphore_idx, uint32_t semaphore_count)
Privileged implementation of semaphore_init.
bool __sem_can_feed(uint8_t semaphore_idx)
Privileged call gate: can semaphore accept a feed?
void __sem_increment(uint8_t semaphore_idx)
Privileged write gate: increment semaphore count.
bool __semaphore_consume(uint8_t semaphore_idx)
Privileged implementation of semaphore_consume.
ICARUS Semaphore - Counting Semaphores.
bool sem_can_feed(uint8_t semaphore_idx)
Check if semaphore can accept a feed (SVC call gate)
void sem_decrement(uint8_t semaphore_idx)
Decrement semaphore count (SVC call gate)
bool sem_can_consume(uint8_t semaphore_idx)
Check if semaphore can be consumed (SVC call gate)
void sem_increment(uint8_t semaphore_idx)
Increment semaphore count (SVC call gate)
uint32_t tick_updated_at
Last modification timestamp (for debugging)
uint32_t max_count
Maximum count (initial value)
bool engaged
true if semaphore is initialized and active
uint32_t count
Current semaphore count.