Safe API Framework 0.1.0 build 384e6ae
Layered API framework for safety-related applications (ERTMS RBC reference targeting CENELEC EN 50128 SIL 4)
Loading...
Searching...
No Matches
rte_reboot.c
Go to the documentation of this file.
1
10
12
14
18
20
22
23
26{
27 rte_status_t lifecycle_status;
28
29 if (osadapter == NULL)
30 {
32 }
33 /* REQ-LIFECYCLE-001 (ADR-026): registering an OSAdapter is a setup-only
34 * action - refuse once the application's setup phase has been locked. */
35 lifecycle_status = rte_lifecycle_check_setup_allowed();
36 if (lifecycle_status != RTE_STATUS_OK)
37 {
38 return lifecycle_status;
39 }
40 s_osadapter = osadapter;
41 return RTE_STATUS_OK;
42}
43
44rte_status_t rte_reboot_request(uint16_t reason_code)
45{
46 if (s_osadapter == NULL)
47 {
49 }
50 if (s_osadapter->request == NULL)
51 {
53 }
54 return s_osadapter->request(reason_code);
55}
rte_status_t rte_lifecycle_check_setup_allowed(void)
Convenience check for a setup-only constructor: call this as one of the first checks in any function ...
rte_status_t rte_reboot_request(uint16_t reason_code)
Requests a controlled system restart.
Definition rte_reboot.c:44
rte_status_t
Common result/status codes.
Definition rte_status.h:27
@ RTE_STATUS_OK
Definition rte_status.h:28
@ RTE_STATUS_INVALID_PARAM
Definition rte_status.h:29
@ RTE_STATUS_NOT_SUPPORTED
Definition rte_status.h:34
@ RTE_STATUS_NOT_INITIALIZED
Definition rte_status.h:30
static const rte_osadapter_clocksync_t * s_osadapter
Process-wide application setup-phase lock (ADR-026).
OSAdapter interface for controlled system reboot.
rte_status_t rte_osadapter_reboot_register(const rte_osadapter_reboot_t *adapter)
Registers the OSAdapter reboot implementation.
Definition rte_reboot.c:25
OS Abstraction Layer - Controlled reboot service (ADR-004 section 3).
OSAdapter reboot operations vtable.