source: rtems/cpukit/rtems/inline/rtems/rtems/timer.inl @ 27b299d9

4.104.114.84.95
Last change on this file since 27b299d9 was 27b299d9, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/21/05 at 07:39:58

New header guards.

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