summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-06-22 17:15:25 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-06-23 10:23:54 +0200
commit2863db306e02b14c31dd7ea1fa4857bc3675e42c (patch)
treeb6cb1d3696ee2feeaba16a1d214ac58ded0ed2c6 /include
parent0b944fce55f4750000a6a0df477034a9e4971b6f (diff)
downloadbarebox-2863db306e02b14c31dd7ea1fa4857bc3675e42c.tar.gz
barebox-2863db306e02b14c31dd7ea1fa4857bc3675e42c.tar.xz
startup: inhibit watchdogs on non-interactive autoboot abort
nv.autoboot=abort has been added as development aid to have barebox stop at the shell prompt automatically. It makes sense to inhibit all watchdogs in this mode, so the user can later use the shell in peace. This also applies to fastboot aborting the shell prompt. If this happens, watchdog will be automatically inhibited as well. Behavior on user aborting the shell prompt via keypad or uart input remains unchanged for backwards-compatibility. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/watchdog.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/watchdog.h b/include/watchdog.h
index 419c1cdf46..81414ef8ec 100644
--- a/include/watchdog.h
+++ b/include/watchdog.h
@@ -45,6 +45,7 @@ int watchdog_deregister(struct watchdog *);
struct watchdog *watchdog_get_default(void);
struct watchdog *watchdog_get_by_name(const char *name);
int watchdog_set_timeout(struct watchdog*, unsigned);
+int watchdog_inhibit_all(void);
#else
static inline int watchdog_register(struct watchdog *w)
{
@@ -70,6 +71,11 @@ static inline int watchdog_set_timeout(struct watchdog*w, unsigned t)
{
return 0;
}
+
+static inline int watchdog_inhibit_all(void)
+{
+ return -ENOSYS;
+}
#endif
#define WATCHDOG_DEFAULT_PRIORITY 100