Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
sapi_task.h File Reference

OS Abstraction Layer - Task/thread scheduling service. More...

Include dependency graph for sapi_task.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  sapi_task_config_t
 Configuration for sapi_task_create(). More...

Typedefs

typedef struct sapi_task_impl_s * sapi_task_handle_t
 Opaque handle to a created task, returned by sapi_task_create().
typedef void(*) sapi_task_entry_t(void *user_ctx)
 Task entry point, invoked cyclically at the configured period.

Functions

 SAFEAPI_DECLARE_STORAGE (sapi_task_storage_t, 128U)
 Caller-owned, fixed-size storage backing one sapi_task_handle_t.
sapi_status_t sapi_task_create (sapi_task_storage_t *storage, const sapi_task_config_t *config, sapi_task_handle_t *out_handle)
 Creates a task in the suspended state.
sapi_status_t sapi_task_start (sapi_task_handle_t handle)
 Starts a created task.
sapi_status_t sapi_task_suspend (sapi_task_handle_t handle)
 Suspends a running task.
sapi_status_t sapi_task_destroy (sapi_task_handle_t handle)
 Terminates and destroys a task.

Detailed Description

OS Abstraction Layer - Task/thread scheduling service.

Creation of periodic/cyclic safety tasks with fixed priorities, matching the cyclic processing model typical of RBC implementations. See ADR-001.

REQ-OAL-TASK-001: no dynamic allocation; caller supplies storage and a fixed-size stack/context region (backend-defined use). REQ-OAL-TASK-002: priorities are fixed at creation time; no dynamic priority inheritance/inversion handling is assumed by this API - that is a backend/RTOS concern.

Definition in file sapi_task.h.