Files
OpenCellular/include/watchdog.h
Jeff Andersen 0fd0dfe0e7 Include "config.h" in include/watchdog.h.
Without this include, the `watchdog_reload()` function will be compiled
as a noop unless "config.h" is included before "watchdog.h" in whatever
compilation unit requires watchdog functionality.

BUG=none
BRANCH=none
TEST=make buildall -j

Change-Id: I311019753f6d61890be1e475664bd528e5250729
Reviewed-on: https://chromium-review.googlesource.com/449694
Commit-Ready: Jeff Andersen <jeffandersen@google.com>
Tested-by: Jeff Andersen <jeffandersen@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-03-10 19:52:31 -08:00

49 lines
1.2 KiB
C

/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Watchdog driver */
#ifndef __CROS_EC_WATCHDOG_H
#define __CROS_EC_WATCHDOG_H
#include <stdint.h>
#include "config.h"
/**
* Initialize the watchdog.
*
* This will cause the CPU to reboot if it has been more than 2 watchdog
* periods since watchdog_reload() has been called.
*/
int watchdog_init(void);
/**
* Display a trace with information about an expired watchdog timer
*
* This shows the location in the code where the expiration happened.
* Usually this helps locate a loop which is blocking execution of the
* watchdog task.
*
* @param excep_lr Value of lr to indicate caller return
* @param excep_sp Value of sp to indicate caller task id
*/
void watchdog_trace(uint32_t excep_lr, uint32_t excep_sp);
/**
* Watchdog has not been tickled recently warning. This function should be
* called when the watchdog is close to firing.
*/
void watchdog_warning_irq(void);
/* Reload the watchdog counter */
#ifdef CONFIG_WATCHDOG
void watchdog_reload(void);
#else
static inline void watchdog_reload(void) { }
#endif
#endif /* __CROS_EC_WATCHDOG_H */