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
Reboot Module - Architecture

Design Overview

Minimal layer providing single entry point: rte_reboot_request(reason). Integrator registers platform-specific OSAdapter via rte_osadapter_reboot_register(). No dynamic allocation; single OSAdapter pointer storage.

Public API

rte_status_t rte_reboot_request(uint16_t reason_code);
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

Requests controlled system restart. Does not return on success (CPU resets).

rte_status_t rte_osadapter_reboot_register(const rte_osadapter_reboot_t *adapter)
Registers the OSAdapter reboot implementation.
Definition rte_reboot.c:25
OSAdapter reboot operations vtable.

Registers platform-specific reboot implementation. Called at startup.

OSAdapter Interface

typedef struct {
rte_status_t (*request)(uint16_t reason_code);

OSAdapter implements platform-specific reset mechanism:

  • Trigger hardware watchdog
  • Execute CPU reset instruction
  • Send command to supervisory processor
  • etc.

Reboot Flow

rte_reboot_request(reason)
    │
    └─ Retrieve registered OSAdapter
       ├─ If no OSAdapter: return NOT_INITIALIZED
       └─ If has OSAdapter: call osadapter->request(reason)
              │
              ├─ On success: CPU resets (no return)
              └─ On failure: return error code

Reason Code Handling

16-bit reason code identifies why reboot requested. OSAdapter can:

  • Log to syslog
  • Persist to NVM/flash (black box)
  • Send to supervisory processor
  • Use in post-reboot diagnostics

Reason code is osadapter-interpreted; framework defines none.

Resource Model

Single static OSAdapter pointer. No allocation. Minimal state:

osadapter_ptr: NULL or pointer to rte_osadapter_reboot_t

MISRA Compliance

✓ No dynamic allocation ✓ Single responsibility (request only) ✓ Function pointer via struct (vtable pattern) ✓ No global function pointers

See Also