source: rtems/cpukit/rtems/inline/rtems/rtems/timer.inl @ 484a769

4.104.114.95
Last change on this file since 484a769 was 484a769, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/04/08 at 17:46:39

Convert to "bool".

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