RTEMS CPU Kit with SuperCore  4.11.3
ratemonimpl.h
Go to the documentation of this file.
1 
9 /* COPYRIGHT (c) 1989-2008.
10  * On-Line Applications Research Corporation (OAR).
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifndef _RTEMS_RTEMS_RATEMONIMPL_H
18 #define _RTEMS_RTEMS_RATEMONIMPL_H
19 
20 #include <rtems/rtems/ratemon.h>
21 #include <rtems/score/objectimpl.h>
22 
23 #include <string.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
43 #ifndef RTEMS_RATEMON_EXTERN
44 #define RTEMS_RATEMON_EXTERN extern
45 #endif
46 
54 
63 
72 {
73  return (Rate_monotonic_Control *)
74  _Objects_Allocate( &_Rate_monotonic_Information );
75 }
76 
85  Rate_monotonic_Control *the_period
86 )
87 {
88  _Objects_Free( &_Rate_monotonic_Information, &the_period->Object );
89 }
90 
101  Objects_Id id,
102  Objects_Locations *location
103 )
104 {
105  return (Rate_monotonic_Control *)
106  _Objects_Get( &_Rate_monotonic_Information, id, location );
107 }
108 
116  Rate_monotonic_Control *the_period
117 )
118 {
119  return (the_period->state == RATE_MONOTONIC_ACTIVE);
120 }
121 
129  Rate_monotonic_Control *the_period
130 )
131 {
132  return (the_period->state == RATE_MONOTONIC_INACTIVE);
133 }
134 
142  Rate_monotonic_Control *the_period
143 )
144 {
145  return (the_period->state == RATE_MONOTONIC_EXPIRED);
146 }
147 
161  rtems_id id,
162  void *ignored
163 );
164 
181  Rate_monotonic_Control *the_period,
182  Rate_monotonic_Period_time_t *wall_since_last_period,
183  Thread_CPU_usage_t *cpu_since_last_period
184 );
185 
196  Rate_monotonic_Control *the_period
197 );
198 
204 #define _Rate_monotonic_Reset_wall_time_statistics( _the_period ) \
205  do { \
206  /* set the minimums to a large value */ \
207  _Timestamp_Set( \
208  &(_the_period)->Statistics.min_wall_time, \
209  0x7fffffff, \
210  0x7fffffff \
211  ); \
212  } while (0)
213 
219 #define _Rate_monotonic_Reset_cpu_use_statistics( _the_period ) \
220  do { \
221  /* set the minimums to a large value */ \
222  _Timestamp_Set( \
223  &(_the_period)->Statistics.min_cpu_time, \
224  0x7fffffff, \
225  0x7fffffff \
226  ); \
227  } while (0)
228 
234 #define _Rate_monotonic_Reset_statistics( _the_period ) \
235  do { \
236  memset( \
237  &(_the_period)->Statistics, \
238  0, \
239  sizeof( rtems_rate_monotonic_period_statistics ) \
240  ); \
241  _Rate_monotonic_Reset_cpu_use_statistics( _the_period ); \
242  _Rate_monotonic_Reset_wall_time_statistics( _the_period ); \
243  } while (0)
244 
247 #ifdef __cplusplus
248 }
249 #endif
250 
251 #endif
252 /* end of include file */
void _Objects_Free(Objects_Information *information, Objects_Control *the_object)
Frees an object.
Definition: objectfree.c:25
This value indicates the period is off the watchdog chain, and has never been initialized.
Definition: ratemon.h:86
Objects_Control Object
This field is the object management portion of a Period instance.
Definition: ratemon.h:205
Objects_Id rtems_id
Used to manage and manipulate RTEMS object identifiers.
Definition: types.h:80
RTEMS_RATEMON_EXTERN Objects_Information _Rate_monotonic_Information
Rate Monotonic Period Class Management Structure.
Definition: ratemonimpl.h:53
Timestamp_Control Rate_monotonic_Period_time_t
This is the internal type used for the rate monotonic timing statistics.
Definition: ratemon.h:75
Objects_Control * _Objects_Allocate(Objects_Information *information)
Allocates an object.
Definition: objectallocate.c:101
RTEMS_INLINE_ROUTINE void _Rate_monotonic_Free(Rate_monotonic_Control *the_period)
Allocates a period control block from the inactive chain of free period control blocks.
Definition: ratemonimpl.h:84
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
void _Rate_monotonic_Timeout(rtems_id id, void *ignored)
Rate Monotonic Timeout.
Definition: ratemontimeout.c:25
Objects_Control * _Objects_Get(Objects_Information *information, Objects_Id id, Objects_Locations *location)
Maps object ids to object control blocks.
Definition: objectget.c:23
#define RTEMS_RATEMON_EXTERN
This constant is defined to extern most of the time when using this header file.
Definition: ratemonimpl.h:44
This value indicates the period is on the watchdog chain, and running.
Definition: ratemon.h:99
void _Rate_monotonic_Initiate_statistics(Rate_monotonic_Control *the_period)
Initiate Rate Monotonic Statistics.
Definition: ratemonperiod.c:80
RTEMS_INLINE_ROUTINE bool _Rate_monotonic_Is_active(Rate_monotonic_Control *the_period)
Checks if the_period is in the ACTIVE state.
Definition: ratemonimpl.h:115
This value indicates the period is off the watchdog chain, and has expired.
Definition: ratemon.h:112
RTEMS_INLINE_ROUTINE Rate_monotonic_Control * _Rate_monotonic_Get(Objects_Id id, Objects_Locations *location)
Maps period IDs to period control blocks.
Definition: ratemonimpl.h:100
RTEMS_INLINE_ROUTINE bool _Rate_monotonic_Is_expired(Rate_monotonic_Control *the_period)
Checks if the_period is in the EXPIRED state.
Definition: ratemonimpl.h:141
The following defines the structure for the information used to manage each class of objects...
Definition: objectimpl.h:136
rtems_rate_monotonic_period_states state
This field indicates the current state of the period.
Definition: ratemon.h:211
The following structure defines the control block used to manage each period.
Definition: ratemon.h:203
void _Rate_monotonic_Manager_initialization(void)
Rate Monotonic Manager Initialization.
Definition: ratemon.c:29
RTEMS_INLINE_ROUTINE bool _Rate_monotonic_Is_inactive(Rate_monotonic_Control *the_period)
Checks if the_period is in the ACTIVE state.
Definition: ratemonimpl.h:128
Objects_Locations
This enumerated type lists the locations which may be returned by _Objects_Get.
Definition: objectimpl.h:117
bool _Rate_monotonic_Get_status(Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period)
_Rate_monotonic_Get_status(
Definition: ratemonperiod.c:27
Inlined Routines in the Object Handler.
uint32_t Objects_Id
The following type defines the control block used to manage object IDs.
Definition: object.h:122
RTEMS_INLINE_ROUTINE Rate_monotonic_Control * _Rate_monotonic_Allocate(void)
Allocates a period control block from the inactive chain of free period control blocks.
Definition: ratemonimpl.h:71