51 uint8_t svc_number = ((uint8_t *)(uintptr_t)stack_frame[6])[-2];
52 uint32_t arg0 = stack_frame[0];
53 uint32_t arg1 = stack_frame[1];
77 stack_frame[0] = (uint32_t)(uintptr_t)name;
90 (
const char *)(uintptr_t)arg1);
105 stack_frame[0] = (uint32_t)(uintptr_t)ptr;
110 stack_frame[0] = (uint32_t)(uintptr_t)ptr;
115 stack_frame[0] = (uint32_t)(uintptr_t)ptr;
122 stack_frame[0] = (uint32_t)ret;
134 bool ret =
__pipe_init((uint8_t)arg0, (uint8_t)arg1);
135 stack_frame[0] = (uint32_t)ret;
157 stack_frame[0] = r ? 1u : 0u;
162 stack_frame[0] = r ? 1u : 0u;
167 stack_frame[0] = r ? 1u : 0u;
172 stack_frame[0] = r ? 1u : 0u;
185 (uint8_t)stack_frame[2]);
189 (uint8_t)stack_frame[2]);
195 stack_frame[0] = (uint32_t)(uintptr_t)name;
211 stack_frame[0] = (uint32_t)ok;
227 uint8_t module_id = (uint8_t)(arg0 & 0xFF);
228 uint8_t severity = (uint8_t)((arg0 >> 8) & 0xFF);
229 uint16_t event_id = (uint16_t)((arg0 >> 16) & 0xFFFF);
230 const void *payload = (
const void *)(uintptr_t)arg1;
231 uint8_t payload_len = (uint8_t)stack_frame[2];
233 payload, payload_len);
241 stack_frame[0] = (uint32_t)sq;
248 (uint8_t *)(uintptr_t)stack_frame[2]);
249 stack_frame[0] = (uint32_t)ok;
263 stack_frame[0] = (uint32_t)ok;
269 (
const uint8_t *)(uintptr_t)arg1,
270 (uint16_t)stack_frame[2],
271 (uint16_t)stack_frame[3]);
272 stack_frame[0] = (uint32_t)ok;
278 (uint8_t *)(uintptr_t)arg1,
279 (uint16_t *)(uintptr_t)stack_frame[2],
281 stack_frame[0] = (uint32_t)ok;
287 (
const uint8_t *)(uintptr_t)arg1,
288 (uint16_t)stack_frame[2]);
289 stack_frame[0] = (uint32_t)ok;
295 (uint8_t *)(uintptr_t)arg1,
296 (uint16_t)stack_frame[2]);
297 stack_frame[0] = (uint32_t)(int32_t)n;
302 stack_frame[0] = (uint32_t)(uintptr_t)d;
317 stack_frame[0] = ok ? 1u : 0u;
324 stack_frame[0] = (uint32_t)st;
346 (
const uint8_t *)(uintptr_t)arg1,
348 stack_frame[0] = (uint32_t)ok;
353 stack_frame[0] = (uint32_t)ok;
358 stack_frame[0] = (uint32_t)ok;
367 stack_frame[0] = (uint32_t)ok;
376 const void *src = (
const void *)(uintptr_t)arg0;
377 uint32_t offset = arg1;
378 uint32_t len = stack_frame[2];
381 (offset + len) >= offset) {
385 stack_frame[0] = (uint32_t)ok;
395 stack_frame[0] = (uint32_t)ok;
400 stack_frame[0] = (uint32_t)ok;
405 (
const uint8_t *)(uintptr_t)arg1,
406 (uint8_t)stack_frame[2]);
407 stack_frame[0] = (uint32_t)n;
423 bool ok =
__fs_create((
const char *)(uintptr_t)arg0,
425 stack_frame[0] = (uint32_t)ok;
429 bool ok =
__fs_open((
const char *)(uintptr_t)arg0,
431 stack_frame[0] = (uint32_t)ok;
436 (
const uint8_t *)(uintptr_t)arg1,
437 (uint16_t)stack_frame[2]);
438 stack_frame[0] = (uint32_t)ok;
443 (uint8_t *)(uintptr_t)arg1,
444 (uint16_t)stack_frame[2],
445 (uint16_t)stack_frame[3]);
446 stack_frame[0] = (uint32_t)n;
450 bool ok =
__fs_delete((
const char *)(uintptr_t)arg0);
451 stack_frame[0] = (uint32_t)ok;
457 stack_frame[0] = (uint32_t)n;
787 :
"r" ((uint32_t)semaphore_idx),
"r" (semaphore_count),
865bool pipe_init(uint8_t pipe_idx, uint16_t pipe_capacity_bytes) {
874 :
"r" ((uint32_t)pipe_idx),
"r" ((uint32_t)pipe_capacity_bytes),
887bool pipe_enqueue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes) {
894bool pipe_dequeue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes) {
997 :
"r" ((uint32_t)pipe_idx),
"r" ((uint32_t)message_bytes),
1001 return (
bool)result;
1020 :
"r" ((uint32_t)pipe_idx),
"r" ((uint32_t)message_bytes),
1024 return (
bool)result;
1082 :
"r" ((uint32_t)pipe_idx),
"r" (message),
"r" ((uint32_t)message_bytes),
1103 :
"r" ((uint32_t)pipe_idx),
"r" (message),
"r" ((uint32_t)message_bytes),
1290 return (
bool)result;
1332 const void *payload, uint8_t payload_len) {
1334 uint32_t packed = ((uint32_t)event_id << 16)
1335 | ((uint32_t)((uint8_t)severity) << 8)
1336 | (uint32_t)module_id;
1343 :
"r" (packed),
"r" ((uint32_t)(uintptr_t)payload),
1348 __os_event(module_id, severity, event_id, payload, payload_len);
1359 :
"r" ((uint32_t)module_id),
"r" ((uint32_t)min_severity),
1386 uint8_t *num_drained) {
1396 :
"r" ((uint32_t)(uintptr_t)out_buf),
1397 "r" ((uint32_t)max_entries),
1398 "r" ((uint32_t)(uintptr_t)num_drained),
1402 return (
bool)result;
1447 return (
bool)result;
1454 uint16_t schema_crc) {
1465 :
"r" ((uint32_t)
id),
"r" ((uint32_t)(uintptr_t)data),
1466 "r" ((uint32_t)len),
"r" ((uint32_t)schema_crc),
1468 :
"r0",
"r1",
"r2",
"r3"
1470 return (
bool)result;
1472 return __tbl_load(
id, data, len, schema_crc);
1483 uint16_t scratch_len = 0;
1498 :
"r" ((uint32_t)
id),
1499 "r" ((uint32_t)(uintptr_t)scratch),
1500 "r" ((uint32_t)(uintptr_t)&scratch_len),
1501 "r" ((uint32_t)(uintptr_t)&activate_cb),
1503 :
"r0",
"r1",
"r2",
"r3"
1518 if (!activate_cb(scratch, scratch_len)) {
1533 :
"r" ((uint32_t)
id),
1534 "r" ((uint32_t)(uintptr_t)scratch),
1535 "r" ((uint32_t)scratch_len),
1539 return (
bool)result;
1556 :
"r" ((uint32_t)
id),
"r" ((uint32_t)(uintptr_t)out),
1560 return (int16_t)result;
1593 return (uint8_t)result;
1605 __asm__
volatile (
"svc %0\n" : :
"I" (
SVC_CS_INIT));
1635 :
"r" ((uint32_t)idx),
"r" ((uint32_t)(uintptr_t)addr),
1639 return (
bool)result;
1654 :
"r" ((uint32_t)idx),
"r" ((uint32_t)enabled),
1658 return (
bool)result;
1675 return (
bool)result;
1691 return (uint8_t)result;
1706 :
"r" ((uint32_t)idx),
"r" ((uint32_t)(uintptr_t)out),
1710 return (
bool)result;
1726 return (uint8_t)result;
1747 :
"r" ((uint32_t)(uintptr_t)src),
"r" (offset),
1751 return (
bool)result;
USB CDC receive ring buffer.
bool __cdc_rx_read_byte(uint8_t *out)
uint32_t __cdc_rx_available(void)
void __cdc_rx_push(const uint8_t *data, uint32_t len)
ICARUS OS — Background Checksum integrity monitor.
bool __cs_enable(uint8_t idx, bool enabled)
Privileged implementation of cs_enable().
void(* cs_mismatch_fn)(uint8_t region_idx, uint16_t expected, uint16_t actual)
Mismatch callback signature.
void __cs_set_callback(cs_mismatch_fn fn)
Privileged implementation of cs_set_callback().
bool __cs_get_region(uint8_t idx, cs_region_t *out)
Privileged implementation of cs_get_region().
uint8_t __cs_region_count(void)
Privileged implementation of cs_region_count().
bool __cs_add_region(uint8_t idx, const uint8_t *addr, uint32_t size)
Privileged implementation of cs_add_region().
void __cs_init(void)
Privileged implementation of cs_init().
uint8_t __cs_check_all(void)
Privileged implementation of cs_check_all().
bool __cs_rebaseline(uint8_t idx)
Privileged implementation of cs_rebaseline().
Generic structured event ring buffer for ICARUS OS.
event_severity_t __event_get_squelch(uint8_t module_id)
void __os_event(uint8_t module_id, event_severity_t severity, uint16_t event_id, const void *payload, uint8_t payload_len)
bool __event_drain(event_entry_t *out_buf, uint8_t max_entries, uint8_t *num_drained)
uint32_t __event_get_count(void)
void __event_set_squelch(uint8_t module_id, event_severity_t min_severity)
ICARUS OS — Internal RAM-backed flat-file filesystem.
bool __fs_write(fs_file_t *f, const uint8_t *data, uint16_t len)
Privileged implementation of fs_write().
void __fs_init(void)
Privileged implementation of fs_init().
uint8_t __fs_list(fs_file_info_t *out, uint8_t max)
Privileged implementation of fs_list().
bool __fs_open(const char *name, fs_file_t *out)
Privileged implementation of fs_open().
bool __fs_create(const char *name, fs_file_t *out)
Privileged implementation of fs_create().
void __fs_stats(fs_stats_t *out)
Privileged implementation of fs_stats().
uint16_t __fs_read(fs_file_t *f, uint8_t *buf, uint16_t len, uint16_t offset)
Privileged implementation of fs_read().
bool __fs_delete(const char *name)
Privileged implementation of fs_delete().
#define BSP_RAM_D3_BASE
AHB SRAM (RAM_D3) base address (64KB)
ICARUS Kernel Core - State and Initialization.
void * __kernel_protected_data(uint16_t num_words)
Privileged implementation of kernel_protected_data.
void __exit_critical(void)
Privileged implementation of exit_critical.
void __os_init(void)
Privileged implementation of os_init.
void __enter_critical(void)
Privileged implementation of enter_critical.
uint32_t * __kernel_get_data(uint8_t task_idx)
Privileged implementation of kernel_get_data.
void __os_start(void)
Privileged implementation of os_start.
uint32_t * __kernel_get_stack(uint8_t task_idx)
Privileged implementation of kernel_get_stack.
ICARUS Pipe - Message Pipes (Circular Buffer Queues)
uint16_t __pipe_get_count(uint8_t pipe_idx)
Privileged implementation of pipe_get_count.
bool __pipe_init(uint8_t pipe_idx, uint16_t pipe_capacity_bytes)
Privileged implementation of pipe_init.
uint16_t __pipe_get_max_count(uint8_t pipe_idx)
Privileged implementation of pipe_get_max_count.
bool __pipe_enqueue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Privileged implementation of pipe_enqueue.
bool __pipe_dequeue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Privileged implementation of pipe_dequeue.
void __pipe_write_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Privileged write gate: write bytes to pipe buffer.
bool __pipe_can_dequeue(uint8_t pipe_idx, uint8_t message_bytes)
Privileged call gate: can pipe deliver message_bytes bytes?
void __pipe_read_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Privileged write gate: read bytes from pipe buffer.
bool __pipe_can_enqueue(uint8_t pipe_idx, uint8_t message_bytes)
Privileged call gate: can pipe accept message_bytes bytes?
ICARUS OS — Lightweight Software Bus (pub/sub message router)
uint16_t sb_msg_id_t
Software Bus message identifier.
uint8_t __sb_subscriber_count(sb_msg_id_t msg_id)
Privileged implementation of sb_subscriber_count().
bool __sb_subscribe(sb_msg_id_t msg_id, uint8_t pipe_idx)
Privileged implementation of sb_subscribe().
void __sb_init(void)
Privileged implementation of sb_init().
uint8_t __sb_route_count(void)
Privileged implementation of sb_route_count().
uint8_t __sb_publish(sb_msg_id_t msg_id, const uint8_t *data, uint8_t len)
Privileged implementation of sb_publish().
bool __sb_unsubscribe(sb_msg_id_t msg_id, uint8_t pipe_idx)
Privileged implementation of sb_unsubscribe().
ICARUS Scheduler - Task Scheduling and Timing.
uint32_t __os_get_tick_count(void)
Privileged implementation of os_get_tick_count.
uint32_t __task_blocking_sleep(uint32_t ticks)
Privileged implementation of task_blocking_sleep.
uint8_t __os_get_running_task_count(void)
Privileged implementation of os_get_running_task_count.
uint8_t __os_get_num_created_tasks(void)
Privileged implementation of os_get_num_created_tasks.
icarus_task_state_t __os_get_task_state(uint8_t task_idx)
Privileged implementation of os_get_task_state.
const char * __os_get_current_task_name(void)
Privileged implementation of os_get_current_task_name.
uint8_t __os_is_running(void)
Privileged implementation of os_is_running.
uint32_t __os_get_task_dispatch_count(uint8_t task_idx)
Privileged implementation of os_get_task_dispatch_count.
const char * __os_get_task_name(uint8_t task_idx)
Privileged implementation of os_get_task_name.
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 waterma...
uint32_t __os_get_stack_watermark(uint8_t task_idx)
Privileged implementation of os_get_stack_watermark.
uint32_t __task_busy_wait(uint32_t ticks)
Privileged implementation of task_busy_wait.
uint32_t __task_active_sleep(uint32_t ticks)
Privileged implementation of task_active_sleep.
void __os_yield(void)
Privileged implementation of os_yield.
uint32_t __os_get_task_ticks_remaining(void)
Privileged implementation of os_get_task_ticks_remaining.
ICARUS Semaphore - Counting Semaphores.
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.
Descriptor for a monitored memory region.
Per-file metadata returned by fs_list().
Opaque file handle — callers hold one of these per open file.
Aggregate filesystem statistics.
Static descriptor registered by a table producer.
uint32_t semaphore_get_max_count(uint8_t semaphore_idx)
Get semaphore maximum count.
void os_yield(void)
Voluntarily yield CPU to scheduler.
void os_event(uint8_t module_id, event_severity_t severity, uint16_t event_id, const void *payload, uint8_t payload_len)
Emit a structured event into the ring buffer.
bool semaphore_consume(uint8_t semaphore_idx)
Decrement semaphore count — spin-wait in thread mode.
void cdc_rx_push(const uint8_t *data, uint32_t len)
Append bytes to the ring buffer.
uint16_t pipe_get_max_count(uint8_t pipe_idx)
Get pipe capacity.
bool pipe_enqueue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Enqueue bytes to pipe — spin-wait in thread mode.
bool sem_can_feed(uint8_t semaphore_idx)
Check if semaphore can accept a feed (count < max && engaged)
void os_start(void)
Start the ICARUS scheduler.
uint32_t semaphore_get_count(uint8_t semaphore_idx)
Get current semaphore count.
event_severity_t event_get_squelch(uint8_t module_id)
Get the current squelch level for a given module.
void os_task_suicide(void)
Terminate current task (suicide)
uint16_t pipe_get_count(uint8_t pipe_idx)
Get current byte count in pipe.
bool semaphore_consume_timeout(uint8_t semaphore_idx, uint32_t max_ticks)
Decrement semaphore count with timeout.
icarus_task_state_t os_get_task_state(uint8_t task_idx)
Get a task's current state.
const tbl_descriptor_t * tbl_get_descriptor(tbl_id_t id)
Look up a registered descriptor by id.
uint32_t cdc_rx_available(void)
bool cdc_rx_read_byte(uint8_t *out)
bool pipe_init(uint8_t pipe_idx, uint16_t pipe_capacity_bytes)
Initialize a message pipe.
uint32_t os_get_task_ticks_remaining(void)
Get remaining ticks in current time slice.
bool tbl_activate(tbl_id_t id)
Activate a staged table after CRC validation.
void sem_decrement(uint8_t semaphore_idx)
Decrement semaphore count atomically in privileged mode.
const char * os_get_current_task_name(void)
Get name of currently executing task.
void cs_set_callback(cs_mismatch_fn fn)
Register the mismatch callback.
bool cs_add_region(uint8_t idx, const uint8_t *addr, uint32_t size)
Add a memory region to the monitor.
void exit_critical(void)
Exit critical section (re-enable scheduler if outermost)
bool cs_enable(uint8_t idx, bool enabled)
Enable or disable scanning of a region.
void pipe_read_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Read bytes from pipe buffer atomically in privileged mode.
uint32_t * kernel_get_data(uint8_t task_idx)
Get data pointer for task index.
uint32_t * kernel_get_stack(uint8_t task_idx)
Get stack pointer for task index.
uint32_t os_get_stack_watermark(uint8_t task_idx)
Get a task's stack high-water mark.
void os_init(void)
Initialize the ICARUS kernel.
void event_init(void)
Initialize the event system.
void tbl_init(void)
Initialise the table registry.
bool tbl_register(const tbl_descriptor_t *desc)
Register a table descriptor.
void cs_init(void)
Initialize the checksum monitor.
bool tbl_load(tbl_id_t id, const uint8_t *data, uint16_t len, uint16_t schema_crc)
Load raw bytes into the staging buffer for a registered table.
void enter_critical(void)
Enter critical section (disable scheduler)
uint32_t task_blocking_sleep(uint32_t ticks)
Blocking sleep — spin-wait in thread mode (cannot run in SVC handler)
void event_set_squelch(uint8_t module_id, event_severity_t min_severity)
Set the minimum severity accepted for a given module.
uint32_t os_get_tick_count(void)
Get current system tick count.
const char * os_get_task_name(uint8_t task_idx)
Get task name by index (read from task_list in privileged mode)
bool event_drain(event_entry_t *out_buf, uint8_t max_entries, uint8_t *num_drained)
Drain queued events into a caller-provided buffer.
bool pipe_can_dequeue(uint8_t pipe_idx, uint8_t message_bytes)
Check if pipe has message_bytes available (count >= bytes && engaged)
uint8_t cs_region_count(void)
Return the number of registered (non-empty) regions.
void os_update_stack_watermark(uint8_t task_idx)
Scan and update a task's stack watermark.
bool pipe_dequeue(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Dequeue bytes from pipe — spin-wait in thread mode.
void * kernel_protected_data(uint16_t num_words)
Allocate protected data words for current task.
void os_exit_task(void)
Exit current task.
void SVC_Handler_C(uint32_t *stack_frame)
C-level SVC dispatcher called from SVC_Handler assembly trampoline.
uint32_t task_busy_wait(uint32_t ticks)
Busy-wait for specified ticks — spin in thread mode.
uint32_t task_active_sleep(uint32_t ticks)
Sleep for specified ticks (cooperative, via SVC)
bool cs_rebaseline(uint8_t idx)
Re-compute and store the baseline CRC for a region.
bool sem_can_consume(uint8_t semaphore_idx)
Check if semaphore can be consumed (count > 0 && engaged)
bool pipe_can_enqueue(uint8_t pipe_idx, uint8_t message_bytes)
Check if pipe has room for message_bytes (free >= bytes && engaged)
uint32_t event_get_count(void)
Number of events currently buffered.
uint8_t os_is_running(void)
Check if OS is running (safe from unprivileged mode)
uint8_t cs_check_all(void)
Scan all enabled regions and invoke the mismatch callback for any CRC failures.
bool semaphore_feed(uint8_t semaphore_idx)
Increment semaphore count — spin-wait in thread mode.
uint8_t os_get_num_created_tasks(void)
Get number of created tasks (read num_created_tasks in privileged mode)
bool semaphore_init(uint8_t semaphore_idx, uint32_t semaphore_count)
Initialize a counting semaphore.
uint32_t os_get_task_dispatch_count(uint8_t task_idx)
Get a task's dispatch count.
void sem_increment(uint8_t semaphore_idx)
Increment semaphore count atomically in privileged mode.
uint8_t os_get_running_task_count(void)
Get number of active tasks.
void os_kill_process(uint8_t task_index)
Kill a task by index.
uint8_t tbl_count(void)
Return the number of registered tables.
void pipe_write_bytes(uint8_t pipe_idx, uint8_t *message, uint8_t message_bytes)
Write bytes to pipe buffer atomically in privileged mode.
void os_restart_task(uint8_t task_index)
Restart a killed/finished task in-place (cold restart)
bool bkpram_write(const void *src, uint32_t offset, uint32_t len)
Copy data into battery-backed RAM (RAM_D3) via SVC.
void os_register_task(void(*function)(void), const char *name)
Register a task with the scheduler.
bool cs_get_region(uint8_t idx, cs_region_t *out)
Read back a region's configuration.
int16_t tbl_dump(tbl_id_t id, uint8_t *out, uint16_t max)
Copy the active table bytes into out.
ICARUS Supervisor Call (SVC) Definitions.
#define SVC_TASK_BLOCKING_SLEEP
#define SVC_ENTER_CRITICAL
#define SVC_SEMAPHORE_INIT
#define SVC_SEM_CAN_CONSUME
#define SVC_CDC_RX_AVAILABLE
#define SVC_TBL_ACTIVATE_PREPARE
#define SVC_TASK_BUSY_WAIT
#define SVC_OS_GET_CURRENT_TASK_NAME
#define SVC_OS_TASK_SUICIDE
#define SVC_SEMAPHORE_FEED
#define SVC_GET_TASK_DISPATCH_COUNT
#define SVC_OS_REGISTER_TASK
#define SVC_SEMAPHORE_CONSUME
#define SVC_OS_RESTART_TASK
#define SVC_GET_NUM_TASKS
#define SVC_GET_STACK_WATERMARK
#define SVC_TBL_GET_DESCRIPTOR
#define SVC_KERNEL_GET_STACK
#define SVC_CS_GET_REGION
#define SVC_EVENT_GET_SQUELCH
#define SVC_SB_ROUTE_COUNT
#define SVC_PIPE_GET_MAX_COUNT
#define SVC_CS_REBASELINE
#define SVC_EXIT_CRITICAL
#define SVC_CS_SET_CALLBACK
#define SVC_CS_REGION_COUNT
#define SVC_EVENT_GET_COUNT
#define SVC_OS_GET_RUNNING_TASK_COUNT
#define SVC_SEMAPHORE_GET_COUNT
#define SVC_KERNEL_GET_DATA
#define SVC_SB_UNSUBSCRIBE
#define SVC_OS_GET_TICK_COUNT
#define SVC_CS_ADD_REGION
#define SVC_PIPE_WRITE_BYTES
#define SVC_UPDATE_STACK_WATERMARK
#define SVC_EVENT_SET_SQUELCH
#define SVC_OS_KILL_PROCESS
#define SVC_GET_TASK_NAME
#define SVC_OS_IS_RUNNING
#define SVC_TASK_ACTIVE_SLEEP
#define SVC_OS_GET_TASK_TICKS_REMAINING
#define SVC_PIPE_READ_BYTES
#define SVC_KERNEL_PROTECTED_DATA
#define SVC_SEMAPHORE_CONSUME_TIMEOUT
#define SVC_SEM_DECREMENT
#define SVC_PIPE_GET_COUNT
#define SVC_SB_SUBSCRIBER_COUNT
#define SVC_TBL_ACTIVATE_COMMIT
#define SVC_GET_TASK_STATE
#define SVC_CDC_RX_READ_BYTE
#define SVC_SEM_INCREMENT
#define SVC_PIPE_CAN_ENQUEUE
#define SVC_SEMAPHORE_GET_MAX_COUNT
#define SVC_PIPE_CAN_DEQUEUE
ICARUS OS — Generic ground-loadable table engine.
bool __tbl_load(tbl_id_t id, const uint8_t *data, uint16_t len, uint16_t schema_crc)
uint8_t tbl_id_t
Generic table identifier.
uint8_t __tbl_count(void)
#define TBL_MAX_SIZE
Maximum bytes per table buffer
bool __tbl_register(const tbl_descriptor_t *desc)
bool __tbl_activate_prepare(tbl_id_t id, uint8_t *out_data, uint16_t *out_len, tbl_activate_fn *out_activate)
Validate a staged table and copy it into a caller-provided scratch buffer for the activate callback.
int16_t __tbl_dump(tbl_id_t id, uint8_t *out, uint16_t max)
bool(* tbl_activate_fn)(const void *data, uint16_t len)
Callback invoked when a staged table passes all CRC checks.
bool __tbl_activate_commit(tbl_id_t id, const uint8_t *data, uint16_t len)
Commit a previously prepared table into the active buffer.
const tbl_descriptor_t * __tbl_get_descriptor(tbl_id_t id)
ICARUS Task Management - Creation and Lifecycle.
void __os_kill_process(uint8_t task_index)
Privileged implementation of os_kill_process.
void __os_exit_task(void)
Privileged implementation of os_exit_task.
void __os_restart_task(uint8_t task_index)
Privileged implementation of os_restart_task.
void __os_register_task(void(*function)(void), const char *name)
Privileged implementation of os_register_task.
void __os_task_suicide(void)
Privileged implementation of os_task_suicide.
icarus_task_state_t
Task state enumeration.