|
Safe API Framework
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
|
OS Abstraction Layer - Real-time platform configuration service (ADR-035). More...
Go to the source code of this file.
Functions | |
| sapi_status_t | sapi_platform_realtime_init (uint32_t rt_priority) |
| Applies the registered backend's real-time platform configuration for the calling process/thread. Call once at process startup, after the backend is registered and before any sapi_timer_* / sapi_task_* thread is created. | |
OS Abstraction Layer - Real-time platform configuration service (ADR-035).
A one-shot startup hook for the platform-level execution characteristics a cyclic safety application needs in place before it creates any timer/task threads: locking process memory resident so later execution is free of demand-paging jitter, and raising the calling thread to a real-time scheduling policy/priority. What that means concretely is entirely backend-defined (a PREEMPT_RT Linux backend uses mlockall()/SCHED_FIFO; a bare-metal backend may do nothing at all) - this header is only the backend-agnostic seam, so application startup code never has to name a concrete backend to ask for it (ADR-005).
REQ-OAL-PLATFORM-001: sapi_platform_realtime_init() is best-effort - a backend that cannot obtain some or all of the requested capabilities (unprivileged host, no RT scheduler, a bounded lockable-memory limit) shall still return SAPI_STATUS_OK, having applied what it could; it never fails the caller's startup.
Definition in file sapi_platform.h.