source: rtems/cpukit/rtems/include/rtems/rtems/timer.h @ 3a4ae6c

4.104.114.84.95
Last change on this file since 3a4ae6c was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • Property mode set to 100644
File size: 6.3 KB
Line 
1/*  timer.h
2 *
3 *  This include file contains all the constants, structures, and
4 *  prototypes associated with the Timer Manager.  This manager provides
5 *  facilities to configure, initiate, cancel, and delete timers which will
6 *  fire at specified intervals of time.
7 *
8 *  Directives provided are:
9 *
10 *     + create a timer
11 *     + get an ID of a timer
12 *     + delete a timer
13 *     + set a timer to fire after a number of ticks have passed
14 *     + set a timer to fire when a specified date and time has been reached
15 *     + reset a timer
16 *     + cancel a time
17 *
18 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
19 *  On-Line Applications Research Corporation (OAR).
20 *  All rights assigned to U.S. Government, 1994.
21 *
22 *  This material may be reproduced by or for the U.S. Government pursuant
23 *  to the copyright license under the clause at DFARS 252.227-7013.  This
24 *  notice must appear in all copies of this file and its derivatives.
25 *
26 *  $Id$
27 */
28
29#ifndef __RTEMS_TIMER_h
30#define __RTEMS_TIMER_h
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#include <rtems/core/object.h>
37#include <rtems/core/tod.h>
38#include <rtems/core/watchdog.h>
39
40/*
41 *  The following enumerated type details the classes to which a timer
42 *  may belong.
43 */
44
45typedef enum {
46  TIMER_INTERVAL,
47  TIMER_TIME_OF_DAY,
48  TIMER_DORMANT
49} Timer_Classes;
50
51/*
52 *  The following types define a pointer to a timer service routine.
53 */
54 
55typedef void rtems_timer_service_routine;
56 
57typedef rtems_timer_service_routine ( *rtems_timer_service_routine_entry )(
58                 rtems_id,
59                 void *
60             );
61
62/*
63 *  The following defines the information control block used to manage
64 *  this class of objects.
65 */
66
67EXTERN Objects_Information  _Timer_Information;
68
69/*
70 *  The following records define the control block used to manage
71 *  each timer.
72 */
73
74typedef struct {
75  Objects_Control  Object;
76  Watchdog_Control Ticker;
77  Timer_Classes    the_class;
78}   Timer_Control;
79
80/*
81 *  _Timer_Manager_initialization
82 *
83 *  DESCRIPTION:
84 *
85 *  This routine performs the initialization necessary for this manager.
86 */
87
88void _Timer_Manager_initialization(
89  unsigned32 maximum_timers
90);
91
92/*
93 *  rtems_timer_create
94 *
95 *  DESCRIPTION:
96 *
97 *  This routine implements the rtems_timer_create directive.  The
98 *  timer will have the name name.  It returns the id of the
99 *  created timer in ID.
100 */
101
102rtems_status_code rtems_timer_create(
103  rtems_name    name,
104  Objects_Id   *id
105);
106
107/*
108 *  rtems_timer_ident
109 *
110 *  DESCRIPTION:
111 *
112 *  This routine implements the rtems_timer_ident directive.
113 *  This directive returns the timer ID associated with name.
114 *  If more than one timer is named name, then the timer
115 *  to which the ID belongs is arbitrary.
116 */
117
118rtems_status_code rtems_timer_ident(
119  rtems_name    name,
120  Objects_Id   *id
121);
122
123/*
124 *  rtems_timer_cancel
125 *
126 *  DESCRIPTION:
127 *
128 *  This routine implements the rtems_timer_cancel directive.  It is used
129 *  to stop the timer associated with ID from firing.
130 */
131
132rtems_status_code rtems_timer_cancel(
133  Objects_Id id
134);
135
136/*
137 *  rtems_timer_delete
138 *
139 *  DESCRIPTION:
140 *
141 *  This routine implements the rtems_timer_delete directive.  The
142 *  timer indicated by ID is deleted.
143 */
144
145rtems_status_code rtems_timer_delete(
146  Objects_Id id
147);
148
149/*
150 *  rtems_timer_fire_after
151 *
152 *  DESCRIPTION:
153 *
154 *  This routine implements the rtems_timer_fire_after directive.  It
155 *  initiates the timer associated with ID to fire in ticks clock
156 *  ticks.  When the timer fires, the routine will be invoked.
157 */
158
159rtems_status_code rtems_timer_fire_after(
160  Objects_Id                         id,
161  rtems_interval                     ticks,
162  rtems_timer_service_routine_entry  routine,
163  void                              *user_data
164);
165
166/*
167 *  rtems_timer_fire_when
168 *
169 *  DESCRIPTION:
170 *
171 *  This routine implements the rtems_timer_fire_when directive.  It
172 *  initiates the timer associated with ID to fire at wall_time
173 *  When the timer fires, the routine will be invoked.
174 */
175
176rtems_status_code rtems_timer_fire_when(
177  Objects_Id                          id,
178  rtems_time_of_day                  *wall_time,
179  rtems_timer_service_routine_entry   routine,
180  void                               *user_data
181);
182
183/*
184 *  rtems_timer_reset
185 *
186 *  DESCRIPTION:
187 *
188 *  This routine implements the rtems_timer_reset directive.  It is used
189 *  to reinitialize the interval timer associated with ID just as if
190 *  rtems_timer_fire_after were re-invoked with the same arguments that
191 *  were used to initiate this timer.
192 */
193
194rtems_status_code rtems_timer_reset(
195  Objects_Id id
196);
197
198/*
199 *  _Timer_Allocate
200 *
201 *  DESCRIPTION:
202 *
203 *  This function allocates a timer control block from
204 *  the inactive chain of free timer control blocks.
205 */
206
207STATIC INLINE Timer_Control *_Timer_Allocate( void );
208
209/*
210 *  _Timer_Free
211 *
212 *  DESCRIPTION:
213 *
214 *  This routine frees a timer control block to the
215 *  inactive chain of free timer control blocks.
216 */
217
218STATIC INLINE void _Timer_Free (
219  Timer_Control *the_timer
220);
221
222/*
223 *  _Timer_Get
224 *
225 *  DESCRIPTION:
226 *
227 *  This function maps timer IDs to timer control blocks.
228 *  If ID corresponds to a local timer, then it returns
229 *  the timer control pointer which maps to ID and location
230 *  is set to OBJECTS_LOCAL.  Otherwise, location is set
231 *  to OBJECTS_ERROR and the returned value is undefined.
232 */
233
234STATIC INLINE Timer_Control *_Timer_Get (
235  Objects_Id         id,
236  Objects_Locations *location
237);
238
239/*
240 *  _Timer_Is_interval_class
241 *
242 *  DESCRIPTION:
243 *
244 *  This function returns TRUE if the class is that of an INTERVAL
245 *  timer, and FALSE otherwise.
246 */
247
248STATIC INLINE boolean _Timer_Is_interval_class (
249  Timer_Classes the_class
250);
251
252/*
253 *  _Timer_Is_time_of_day_class
254 *
255 *  DESCRIPTION:
256 *
257 *  This function returns TRUE if the class is that of an INTERVAL
258 *  timer, and FALSE otherwise.
259 */
260
261STATIC INLINE boolean _Timer_Is_timer_of_day_class (
262  Timer_Classes the_class
263);
264
265/*
266 *  _Timer_Is_dormant_class
267 *
268 *  DESCRIPTION:
269 *
270 *  This function returns TRUE if the class is that of a DORMANT
271 *  timer, and FALSE otherwise.
272 */
273
274STATIC INLINE boolean _Timer_Is_dormant_class (
275  Timer_Classes the_class
276);
277
278/*
279 *  _Timer_Is_null
280 *
281 *  DESCRIPTION:
282 *
283 *  This function returns TRUE if the_timer is NULL and FALSE otherwise.
284 */
285
286STATIC INLINE boolean _Timer_Is_null (
287  Timer_Control *the_timer
288);
289
290#include <rtems/rtems/timer.inl>
291
292#ifdef __cplusplus
293}
294#endif
295
296#endif
297/* end of include file */
Note: See TracBrowser for help on using the repository browser.