universalisos/microkernel/include/uos_sched_table.h
Fábio Coutada 62e8454f91 build: add UEFI ISO builder, test boot scripts, EIM config
- make-uefi-iso.sh: UEFI ISO image builder
- test_boot.S, test_boot.ld: test boot assembly and linker script
- eim_config.toml: EIM (External Interface Module) configuration
- edk2-ovmf RPM for UEFI firmware
- GAP_ANALYSIS_PIKEOS_PARITY.md: PikeOS parity gap analysis
2026-07-15 15:33:07 +01:00

53 lines
1.9 KiB
C

/*
* UniversalisOS Microkernel — Static Schedule Tables (HRT-3.2)
*
* Time-triggered task dispatch: a pre-computed table defines exactly
* which tasks run at which ticks. This is the ARINC 653 / AUTOSAR OS
* pattern for hard real-time partition scheduling.
*
* Entries store task POINTERS (not pool indices) so they survive
* task deletion and out-of-order creation.
*/
#ifndef UOS_SCHED_TABLE_H
#define UOS_SCHED_TABLE_H
#include "uos_types.h"
#include "uos_api.h"
#define UOS_SCHED_TABLE_MAX 4
#define UOS_SCHED_TABLE_MAX_ENTRIES 16
/* One entry in a schedule table */
typedef struct {
uos_tick_t offset; /* Tick offset from table start */
uos_task_t* task; /* Task to activate (pointer, not index) */
uos_flags_t event_mask; /* Event to set (0 = no event) */
uint8_t flags; /* UOS_SCHED_ENTRY_* flags */
} uos_sched_entry_t;
#define UOS_SCHED_ENTRY_ACTIVATE 0x01
#define UOS_SCHED_ENTRY_SET_EVENT 0x02
#define UOS_SCHED_ENTRY_CLEAR_EVENT 0x04
/* A schedule table */
typedef struct {
const char* name;
uint32_t period; /* Table period in ticks (0 = one-shot) */
uint32_t current_tick;
uint32_t num_entries;
const uos_sched_entry_t* entries;
uint8_t running;
uint8_t started;
} uos_sched_table_t;
void uos_sched_table_init(void);
void uos_sched_table_start(uos_sched_table_t* table, uos_tick_t offset);
void uos_sched_table_stop(uos_sched_table_t* table);
void uos_sched_table_tick(void);
uint32_t uos_sched_table_get_position(const uos_sched_table_t* table);
void uos_sched_table_register(uos_sched_table_t* table);
/* Check if a task is still valid (not deleted) before activating */
uint8_t uos_sched_table_task_valid(const uos_task_t* task);
#endif /* UOS_SCHED_TABLE_H */