OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [inline/] [rtems/] [rtems/] [timer.inl] - Blame information for rev 30

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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-1999.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *
9
 *  The license and distribution terms for this file may be
10
 *  found in the file LICENSE in this distribution or at
11
 *  http://www.OARcorp.com/rtems/license.html.
12
 *
13
 *  $Id: timer.inl,v 1.2 2001-09-27 11:59:18 chris Exp $
14
 */
15
 
16
#ifndef __TIMER_inl
17
#define __TIMER_inl
18
 
19
/*PAGE
20
 *
21
 *  _Timer_Allocate
22
 *
23
 *  DESCRIPTION:
24
 *
25
 *  This function allocates a timer control block from
26
 *  the inactive chain of free timer control blocks.
27
 */
28
 
29
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void )
30
{
31
  return (Timer_Control *) _Objects_Allocate( &_Timer_Information );
32
}
33
 
34
/*PAGE
35
 *
36
 *  _Timer_Free
37
 *
38
 *  DESCRIPTION:
39
 *
40
 *  This routine frees a timer control block to the
41
 *  inactive chain of free timer control blocks.
42
 */
43
 
44
RTEMS_INLINE_ROUTINE void _Timer_Free (
45
  Timer_Control *the_timer
46
)
47
{
48
  _Objects_Free( &_Timer_Information, &the_timer->Object );
49
}
50
 
51
/*PAGE
52
 *
53
 *  _Timer_Get
54
 *
55
 *  DESCRIPTION:
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
 */
63
 
64
RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get (
65
  Objects_Id         id,
66
  Objects_Locations *location
67
)
68
{
69
  return (Timer_Control *)
70
    _Objects_Get( &_Timer_Information, id, location );
71
}
72
 
73
/*PAGE
74
 *
75
 *  _Timer_Is_interval_class
76
 *
77
 *  DESCRIPTION:
78
 *
79
 *  This function returns TRUE if the class is that of an INTERVAL
80
 *  timer, and FALSE otherwise.
81
 */
82
 
83
RTEMS_INLINE_ROUTINE boolean _Timer_Is_interval_class (
84
  Timer_Classes the_class
85
)
86
{
87
  return ( the_class == TIMER_INTERVAL );
88
}
89
 
90
/*PAGE
91
 *
92
 *  _Timer_Is_time_of_day_class
93
 *
94
 *  DESCRIPTION:
95
 *
96
 *  This function returns TRUE if the class is that of an INTERVAL
97
 *  timer, and FALSE otherwise.
98
 */
99
 
100
RTEMS_INLINE_ROUTINE boolean _Timer_Is_timer_of_day_class (
101
  Timer_Classes the_class
102
)
103
{
104
  return ( the_class == TIMER_TIME_OF_DAY );
105
}
106
 
107
/*PAGE
108
 *
109
 *  _Timer_Is_dormant_class
110
 *
111
 *  DESCRIPTION:
112
 *
113
 *  This function returns TRUE if the class is that of a DORMANT
114
 *  timer, and FALSE otherwise.
115
 */
116
 
117
RTEMS_INLINE_ROUTINE boolean _Timer_Is_dormant_class (
118
  Timer_Classes the_class
119
)
120
{
121
  return ( the_class == TIMER_DORMANT );
122
}
123
 
124
/*PAGE
125
 *
126
 *  _Timer_Is_null
127
 *
128
 *  DESCRIPTION:
129
 *
130
 *  This function returns TRUE if the_timer is NULL and FALSE otherwise.
131
 */
132
 
133
RTEMS_INLINE_ROUTINE boolean _Timer_Is_null (
134
  Timer_Control *the_timer
135
)
136
{
137
  return ( the_timer == NULL );
138
}
139
 
140
#endif
141
/* end of include file */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.