source: rtems/cpukit/rtems/inline/rtems/rtems/timer.inl @ 1a8fde6c

4.104.114.84.95
Last change on this file since 1a8fde6c was 1a8fde6c, checked in by Joel Sherrill <joel.sherrill@…>, on 03/06/96 at 21:34:57

Removed prototyes for static inline routines and moved the comments into
the inline implementation. The impetus for this was twofold. First,
it is incorrect to have static inline prototypes when using the macro
implementation. Second, this reduced the number of lines in the include
files seen by rtems.h by about 2000 lines.

Next we restricted visibility for the inline routines to inside the
executive itself EXCEPT for a handful of objects. This reduced the
number of include files included by rtems.h by 40 files and reduced
the lines in the include files seen by rtems.h by about 6000 lines.

In total, these reduced the compile time of the entire RTEMS tree by 20%.
This results in about 8 minutes savings on the SparcStation? 10 morgana.

  • 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, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
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
30STATIC INLINE 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
45STATIC INLINE 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
65STATIC INLINE 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
84STATIC INLINE 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
101STATIC INLINE 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
118STATIC INLINE 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
134STATIC INLINE 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.