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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [rtems/] [inline/] [rtems/] [rtems/] [ratemon.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
/*  ratemon.inl
2
 *
3
 *  This file contains the static inline  implementation of the inlined
4
 *  routines in the Rate Monotonic 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: ratemon.inl,v 1.2 2001-09-27 11:59:18 chris Exp $
14
 */
15
 
16
#ifndef __RATE_MONOTONIC_inl
17
#define __RATE_MONOTONIC_inl
18
 
19
/*PAGE
20
 *
21
 *  _Rate_monotonic_Allocate
22
 *
23
 *  DESCRIPTION:
24
 *
25
 *  This function allocates a period control block from
26
 *  the inactive chain of free period control blocks.
27
 */
28
 
29
RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void )
30
{
31
  return (Rate_monotonic_Control *)
32
    _Objects_Allocate( &_Rate_monotonic_Information );
33
}
34
 
35
/*PAGE
36
 *
37
 *  _Rate_monotonic_Free
38
 *
39
 *  DESCRIPTION:
40
 *
41
 *  This routine allocates a period control block from
42
 *  the inactive chain of free period control blocks.
43
 */
44
 
45
RTEMS_INLINE_ROUTINE void _Rate_monotonic_Free (
46
  Rate_monotonic_Control *the_period
47
)
48
{
49
  _Objects_Free( &_Rate_monotonic_Information, &the_period->Object );
50
}
51
 
52
/*PAGE
53
 *
54
 *  _Rate_monotonic_Get
55
 *
56
 *  DESCRIPTION:
57
 *
58
 *  This function maps period IDs to period control blocks.
59
 *  If ID corresponds to a local period, then it returns
60
 *  the_period control pointer which maps to ID and location
61
 *  is set to OBJECTS_LOCAL.  Otherwise, location is set
62
 *  to OBJECTS_ERROR and the_period is undefined.
63
 */
64
 
65
RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get (
66
  Objects_Id         id,
67
  Objects_Locations *location
68
)
69
{
70
  return (Rate_monotonic_Control *)
71
    _Objects_Get( &_Rate_monotonic_Information, id, location );
72
}
73
 
74
/*PAGE
75
 *
76
 *  _Rate_monotonic_Is_active
77
 *
78
 *  DESCRIPTION:
79
 *
80
 *  This function returns TRUE if the_period is in the ACTIVE state,
81
 *  and FALSE otherwise.
82
 */
83
 
84
RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_active (
85
  Rate_monotonic_Control *the_period
86
)
87
{
88
  return (the_period->state == RATE_MONOTONIC_ACTIVE);
89
}
90
 
91
/*PAGE
92
 *
93
 *  _Rate_monotonic_Is_inactive
94
 *
95
 *  DESCRIPTION:
96
 *
97
 *  This function returns TRUE if the_period is in the ACTIVE state,
98
 *  and FALSE otherwise.
99
 */
100
 
101
RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_inactive (
102
  Rate_monotonic_Control *the_period
103
)
104
{
105
  return (the_period->state == RATE_MONOTONIC_INACTIVE);
106
}
107
 
108
/*PAGE
109
 *
110
 *  _Rate_monotonic_Is_expired
111
 *
112
 *  DESCRIPTION:
113
 *
114
 *  This function returns TRUE if the_period is in the EXPIRED state,
115
 *  and FALSE otherwise.
116
 */
117
 
118
RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_expired (
119
  Rate_monotonic_Control *the_period
120
)
121
{
122
  return (the_period->state == RATE_MONOTONIC_EXPIRED);
123
}
124
 
125
/*PAGE
126
 *
127
 *  _Rate_monotonic_Is_null
128
 *
129
 *  DESCRIPTION:
130
 *
131
 *  This function returns TRUE if the_period is NULL and FALSE otherwise.
132
 */
133
 
134
RTEMS_INLINE_ROUTINE boolean _Rate_monotonic_Is_null (
135
  Rate_monotonic_Control *the_period
136
)
137
{
138
  return (the_period == NULL);
139
}
140
 
141
#endif
142
/* end of include file */

powered by: WebSVN 2.1.0

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