source: rtems/cpukit/include/rtems/score/watchdog.h @ 3a4e044

5
Last change on this file since 3a4e044 was 2afb22b, checked in by Chris Johns <chrisj@…>, on 12/23/17 at 07:18:56

Remove make preinstall

A speciality of the RTEMS build system was the make preinstall step. It
copied header files from arbitrary locations into the build tree. The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

  • The make preinstall step itself needs time and disk space.
  • Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error.
  • There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult.
  • The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit.
  • An introduction of a new build system is difficult.
  • Include paths specified by the -B option are system headers. This may suppress warnings.
  • The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step. All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

  • cpukit/include
  • cpukit/score/cpu/@RTEMS_CPU@/include
  • cpukit/libnetworking

The new BSP include directories are:

  • bsps/include
  • bsps/@RTEMS_CPU@/include
  • bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed. The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.

  • Property mode set to 100644
File size: 4.0 KB
Line 
1/**
2 *  @file  rtems/score/watchdog.h
3 *
4 *  @brief Constants and Structures Associated with Watchdog Timers
5 *
6 *  This include file contains all the constants and structures associated
7 *  with watchdog timers.   This Handler provides mechanisms which can be
8 *  used to initialize and manipulate watchdog timers.
9 */
10
11/*
12 *  COPYRIGHT (c) 1989-2009.
13 *  On-Line Applications Research Corporation (OAR).
14 *
15 *  The license and distribution terms for this file may be
16 *  found in the file LICENSE in this distribution or at
17 *  http://www.rtems.org/license/LICENSE.
18 */
19
20#ifndef _RTEMS_SCORE_WATCHDOG_H
21#define _RTEMS_SCORE_WATCHDOG_H
22
23#include <rtems/score/basedefs.h>
24#include <rtems/score/chain.h>
25#include <rtems/score/rbtree.h>
26
27struct Per_CPU_Control;
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/**
34 *  @defgroup ScoreWatchdog Watchdog Handler
35 *
36 *  @ingroup Score
37 *
38 *  This handler encapsulates functionality related to the scheduling of
39 *  watchdog functions to be called at specific times in the future.
40 *
41 *  @note This handler does not have anything to do with hardware watchdog
42 *        timers.
43 */
44/**@{*/
45
46typedef struct Watchdog_Control Watchdog_Control;
47
48/**
49 *  @brief Type is used to specify the length of intervals.
50 *
51 *  This type is used to specify the length of intervals.
52 */
53typedef uint32_t   Watchdog_Interval;
54
55/**
56 * @brief Special watchdog ticks value to indicate an infinite wait.
57 */
58#define WATCHDOG_NO_TIMEOUT 0
59
60/**
61 *  @brief Return type from a Watchdog Service Routine.
62 *
63 *  This type defines the return type from a Watchdog Service Routine.
64 */
65typedef void Watchdog_Service_routine;
66
67/**
68 *  @brief Pointer to a watchdog service routine.
69 *
70 *  This type define a pointer to a watchdog service routine.
71 */
72typedef Watchdog_Service_routine
73  ( *Watchdog_Service_routine_entry )( Watchdog_Control * );
74
75/**
76 * @brief The watchdog header to manage scheduled watchdogs.
77 */
78typedef struct {
79  /**
80   * @brief Red-black tree of scheduled watchdogs sorted by expiration time.
81   */
82  RBTree_Control Watchdogs;
83
84  /**
85   * @brief The scheduled watchdog with the earliest expiration time or NULL in
86   * case no watchdog is scheduled.
87   */
88  RBTree_Node *first;
89} Watchdog_Header;
90
91/**
92 *  @brief The control block used to manage each watchdog timer.
93 *
94 *  The following record defines the control block used
95 *  to manage each watchdog timer.
96 */
97struct Watchdog_Control {
98  /**
99   * @brief Nodes for the watchdog.
100   */
101  union {
102    /**
103     * @brief this field is a red-black tree node structure and allows this to
104     * be placed on a red-black tree used to manage the scheduled watchdogs.
105     */
106    RBTree_Node RBTree;
107
108    /**
109     * @brief this field is a chain node structure and allows this to be placed
110     * on a chain used to manage pending watchdogs by the timer server.
111     */
112    Chain_Node Chain;
113  } Node;
114
115#if defined(RTEMS_SMP)
116  /** @brief This field references the processor of this watchdog control. */
117  struct Per_CPU_Control *cpu;
118#endif
119
120  /** @brief This field is the function to invoke. */
121  Watchdog_Service_routine_entry routine;
122
123  /** @brief This field is the expiration time point. */
124  uint64_t expire;
125};
126
127/**
128 * @brief The watchdog ticks counter.
129 *
130 * With a 1ms watchdog tick, this counter overflows after 50 days since boot.
131 */
132extern volatile Watchdog_Interval _Watchdog_Ticks_since_boot;
133
134/**
135 * @brief The watchdog nanoseconds per tick.
136 *
137 * This constant is defined by the application configuration via
138 * <rtems/confdefs.h>.
139 */
140extern const uint32_t _Watchdog_Nanoseconds_per_tick;
141
142/**
143 * @brief The watchdog ticks per second.
144 *
145 * This constant is defined by the application configuration via
146 * <rtems/confdefs.h>.
147 */
148extern const uint32_t _Watchdog_Ticks_per_second;
149
150/**
151 * @brief The maximum number of seconds representable in the monotonic watchdog
152 * format.
153 *
154 * This constant is defined by the application configuration via
155 * <rtems/confdefs.h>.
156 */
157extern const uint64_t _Watchdog_Monotonic_max_seconds;
158
159/**@}*/
160
161#ifdef __cplusplus
162}
163#endif
164
165#endif
166/* end of include file */
Note: See TracBrowser for help on using the repository browser.