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