Sound Open Firmware
Loading...
Searching...
No Matches
watchdog.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright(c) 2023 Intel Corporation. All rights reserved.
4 *
5 * Author: Adrian Warecki <adrian.warecki@intel.com>
6 */
7
8/*
9 * A set of functions that allows implement a watchdog protection for ll scheduler tasks. The
10 * watchdog_enable function is called after creating a ll thread for specified core. Its task is to
11 * start the watchdog for a given core. When all tasks are finished, function watchdog_disable will
12 * be called before stopping the thread. It should stop the watchdog on the given core.
13 * Periodically, after each tick has been handled, the watchdog counter is reseted by calling
14 * watchdog_feed.
15 */
16
17#ifndef __SOF_LIB_WATCHDOG_H__
18#define __SOF_LIB_WATCHDOG_H__
19
20#include <sof/common.h>
21
22#if IS_ENABLED(CONFIG_LL_WATCHDOG)
27void watchdog_enable(int core);
28
33void watchdog_disable(int core);
34
39void watchdog_feed(int core);
40
44void watchdog_init(void);
45
55#else /* IS_ENABLED(CONFIG_LL_WATCHDOG) */
56static inline void watchdog_enable(int core) {}
57static inline void watchdog_disable(int core) {}
58static inline void watchdog_feed(int core) {}
59static inline void watchdog_init(void) {}
60static inline void watchdog_secondary_core_timeout(int core) {}
61#endif /* IS_ENABLED(CONFIG_LL_WATCHDOG) */
62
63#endif /* __SOF_LIB_WATCHDOG_H__ */
static void watchdog_init(void)
Definition watchdog.h:59
static void watchdog_enable(int core)
Definition watchdog.h:56
static void watchdog_disable(int core)
Definition watchdog.h:57
static void watchdog_secondary_core_timeout(int core)
Definition watchdog.h:60
static void watchdog_feed(int core)
Definition watchdog.h:58