37#ifndef RTE_WATCHDOG_MAX_COUNT
41#define RTE_WATCHDOG_MAX_COUNT 8U
221 return lifecycle_status;
290 else if ((slot->
active == 0U) || (slot->
fired != 0U))
490 (int32_t)__LINE__, name);
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 ...
void rte_log_write(rte_log_level_t level, const char *tag, const char *message)
Emits one log message. Non-blocking; never fails the caller's control flow even if the message is dro...
#define RTE_SAFESTATE_REASON_CLOCK_FAILED
void rte_safestate_enter(rte_safestate_level_t level, rte_safestate_reason_t reason, const char *file, int32_t line, const char *message)
Enters a safe-state level: invokes the registered handler (if any), then, for RTE_SAFESTATE_LEVEL_SAF...
#define RTE_SAFESTATE_REASON_UNSPECIFIED
@ RTE_SAFESTATE_LEVEL_REBOOT
@ RTE_SAFESTATE_LEVEL_SAFE
rte_status_t
Common result/status codes.
@ RTE_STATUS_INTERNAL_ERROR
@ RTE_STATUS_INVALID_PARAM
@ RTE_STATUS_NOT_INITIALIZED
@ RTE_STATUS_RESOURCE_EXHAUSTED
rte_status_t rte_timer_now(rte_timestamp_ms_t *out_now_ms)
Returns the current monotonic time base used by all timers.
uint32_t rte_duration_ms_t
uint64_t rte_timestamp_ms_t
rte_status_t rte_watchdog_start(rte_watchdog_t watchdog)
Start watchdog timer.
rte_status_t rte_watchdog_manager_shutdown(void)
Shutdown watchdog manager (call once at shutdown).
void rte_watchdog_timeout_handler(uint32_t watchdog_id)
Watchdog timeout handler (INTERNAL - called by framework).
rte_status_t rte_watchdog_kick(rte_watchdog_t watchdog)
Kick (pet) watchdog - prove liveness.
rte_status_t rte_watchdog_destroy(rte_watchdog_t watchdog)
Destroy watchdog.
rte_status_t rte_watchdog_manager_initialize(void)
Initialize watchdog manager (call once at startup).
rte_watchdog_action_t
Recovery action when watchdog fires.
rte_status_t rte_watchdog_get_status(rte_watchdog_t watchdog, rte_watchdog_status_t *status_out)
Get watchdog status.
rte_status_t rte_watchdog_stop(rte_watchdog_t watchdog)
Stop watchdog timer.
void rte_watchdog_timer_tick(void)
Poll all active watchdogs for expiry (call periodically).
rte_status_t rte_watchdog_create(rte_watchdog_t *handle_out, const rte_watchdog_config_t *config)
Create a watchdog.
@ RTE_WATCHDOG_ACTION_REBOOT
@ RTE_WATCHDOG_ACTION_SAFESTATE
@ RTE_WATCHDOG_ACTION_LOG
@ RTE_WATCHDOG_ACTION_FAILOVER
@ RTE_WATCHDOG_ACTION_CUSTOM
Process-wide application setup-phase lock (ADR-026).
OS Abstraction Layer - Logging/diagnostics service.
Safe-state transitions and checked assertions (ADR-004).
OS Abstraction Layer - Timer service.
static bool is_supervising(const rte_watchdog_s *slot)
Checks whether slot is currently supervising: allocated, started (not stopped) and not yet fired - i....
static bool is_valid_action(rte_watchdog_action_t action)
Checks whether action is one of the defined rte_watchdog_action_t enumerators.
#define RTE_WATCHDOG_MAX_COUNT
static uint32_t first_supervising_index(void)
Finds the first supervising slot (see is_supervising()).
static uint8_t g_manager_initialized
1 once rte_watchdog_manager_initialize() has been called.
static bool is_valid_handle(rte_watchdog_t watchdog)
Defensive check that handle actually points at one of this module's own live pool slots,...
static rte_watchdog_s g_watchdog_pool[RTE_WATCHDOG_MAX_COUNT]
Fixed-size static pool backing every rte_watchdog_t handle.
Watchdog mechanism for detecting system/task hang conditions.
rte_duration_ms_t timeout_ms
rte_watchdog_action_t action
void(*) custom_action(void *ctx)
Watchdog handle (opaque).
rte_timestamp_ms_t deadline_ms
rte_watchdog_config_t config
rte_timestamp_ms_t last_kick_ms
Watchdog health/status information.
rte_duration_ms_t time_since_last_kick
rte_duration_ms_t time_until_fire