17#ifndef ICARUS_KERNEL_H
18#define ICARUS_KERNEL_H
159bool bkpram_write(
const void *src, uint32_t offset, uint32_t len);
#define ICARUS_MAX_SEMAPHORES
Maximum number of semaphores.
#define ICARUS_MAX_TASKS
Maximum number of concurrent tasks.
#define ICARUS_MAX_MESSAGE_QUEUES
Maximum number of message queues (pipes)
ICARUS OS Configuration Header.
void os_yield(void)
Voluntarily yield CPU to scheduler.
void * __kernel_protected_data(uint16_t num_words)
Privileged implementation of kernel_protected_data.
uint8_t num_created_tasks
Total number of created tasks.
volatile uint32_t current_task_ticks_remaining
Ticks remaining in current task's time slice.
void __exit_critical(void)
Privileged implementation of exit_critical.
uint8_t running_task_count
Count of tasks in active states.
void os_start(void)
Start the ICARUS scheduler.
uint8_t current_task_index
Index of currently executing task.
const char * os_get_current_task_name(void)
Get name of currently executing task.
void exit_critical(void)
Exit critical section (re-enable scheduler if outermost)
icarus_pipe_t * message_pipe_list[64]
Array of pointers to all message pipes.
uint32_t * kernel_get_data(uint8_t task_idx)
Get data pointer for task index (internal use)
uint32_t * kernel_get_stack(uint8_t task_idx)
Get stack pointer for task index (internal use)
volatile uint8_t os_running
Flag indicating OS is running.
icarus_task_t * task_list[128]
Array of pointers to all task control blocks.
int8_t current_cleanup_task_idx
Current cleanup queue write index.
void os_init(void)
Initialize the ICARUS kernel.
void __os_init(void)
Privileged implementation of os_init.
void __enter_critical(void)
Privileged implementation of enter_critical.
void enter_critical(void)
Enter critical section (disable scheduler)
uint32_t * __kernel_get_data(uint8_t task_idx)
Privileged implementation of kernel_get_data.
void __os_start(void)
Privileged implementation of os_start.
void * kernel_protected_data(uint16_t num_words)
Allocate protected data words for current task.
icarus_semaphore_t * semaphore_list[64]
Array of pointers to all semaphores.
int8_t cleanup_task_idx[128]
Cleanup task index queue.
volatile uint32_t os_tick_count
System tick counter.
uint32_t task_active_sleep(uint32_t ticks)
Sleep for specified ticks (cooperative, via SVC)
uint32_t * __kernel_get_stack(uint8_t task_idx)
Privileged implementation of kernel_get_stack.
volatile uint32_t ticks_per_task
Configured ticks per time slice.
volatile bool scheduler_enabled
Scheduler enable flag.
bool bkpram_write(const void *src, uint32_t offset, uint32_t len)
Copy data into battery-backed RAM (RAM_D3) via SVC.
ICARUS OS Hardware Abstraction Layer Interface.
ICARUS OS Core Type Definitions.