source: rtems/c/src/exec/rtems/inline/timer.inl @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on 04/22/97 at 17:20:27

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 2.7 KB
Line 
1/*  timer.inl
2 *
3 *  This file contains the static inline implementation of the inlined routines
4 *  from the Timer Manager.
5 *
6 *  COPYRIGHT (c) 1989-1997.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may in
11 *  the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#ifndef __TIMER_inl
18#define __TIMER_inl
19
20/*PAGE
21 *
22 *  _Timer_Allocate
23 *
24 *  DESCRIPTION:
25 *
26 *  This function allocates a timer control block from
27 *  the inactive chain of free timer control blocks.
28 */
29
30RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
31{
32  return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
33}
34
35/*PAGE
36 *
37 *  _Timer_Free
38 *
39 *  DESCRIPTION:
40 *
41 *  This routine frees a timer control block to the
42 *  inactive chain of free timer control blocks.
43 */
44
45RTEMS_INLINE_ROUTINE void _Timer_Free (
46  Timer_Control *the_timer
47)
48{
49  _Objects_Free( &_Timer_Information, &the_timer->Object );
50}
51
52/*PAGE
53 *
54 *  _Timer_Get
55 *
56 *  DESCRIPTION:
57 *
58 *  This function maps timer IDs to timer control blocks.
59 *  If ID corresponds to a local timer, then it returns
60 *  the timer control pointer which maps to ID and location
61 *  is set to OBJECTS_LOCAL.  Otherwise, location is set
62 *  to OBJECTS_ERROR and the returned value is undefined.
63 */
64
65RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
66  Objects_Id         id,
67  Objects_Locations *location
68)
69{
70  return (Timer_Control *)
71    _Objects_Get( &_Timer_Information, id, location );
72}
73
74/*PAGE
75 *
76 *  _Timer_Is_interval_class
77 *
78 *  DESCRIPTION:
79 *
80 *  This function returns TRUE if the class is that of an INTERVAL
81 *  timer, and FALSE otherwise.
82 */
83
84RTEMS_INLINE_ROUTINE boolean _Timer_Is_interval_class (
85  Timer_Classes the_class
86)
87{
88  return ( the_class == TIMER_INTERVAL );
89}
90
91/*PAGE
92 *
93 *  _Timer_Is_time_of_day_class
94 *
95 *  DESCRIPTION:
96 *
97 *  This function returns TRUE if the class is that of an INTERVAL
98 *  timer, and FALSE otherwise.
99 */
100
101RTEMS_INLINE_ROUTINE boolean _Timer_Is_timer_of_day_class (
102  Timer_Classes the_class
103)
104{
105  return ( the_class == TIMER_TIME_OF_DAY );
106}
107
108/*PAGE
109 *
110 *  _Timer_Is_dormant_class
111 *
112 *  DESCRIPTION:
113 *
114 *  This function returns TRUE if the class is that of a DORMANT
115 *  timer, and FALSE otherwise.
116 */
117
118RTEMS_INLINE_ROUTINE boolean _Timer_Is_dormant_class (
119  Timer_Classes the_class
120)
121{
122  return ( the_class == TIMER_DORMANT );
123}
124
125/*PAGE
126 *
127 *  _Timer_Is_null
128 *
129 *  DESCRIPTION:
130 *
131 *  This function returns TRUE if the_timer is NULL and FALSE otherwise.
132 */
133
134RTEMS_INLINE_ROUTINE boolean _Timer_Is_null (
135  Timer_Control *the_timer
136)
137{
138  return ( the_timer == NULL );
139}
140
141#endif
142/* end of include file */
Note: See TracBrowser for help on using the repository browser.