RTEMS CPU Kit with SuperCore
4.11.3
|
![]() |
Files | |
file | ratemonimpl.h |
Classic Rate Monotonic Scheduler Implementation. | |
Macros | |
#define | RTEMS_RATEMON_EXTERN extern |
This constant is defined to extern most of the time when using this header file. More... | |
#define | _Rate_monotonic_Reset_wall_time_statistics(_the_period) |
_Rate_monotonic_Reset_wall_time_statistics More... | |
#define | _Rate_monotonic_Reset_cpu_use_statistics(_the_period) |
Rate_monotonic_Reset_cpu_use_statistics. More... | |
#define | _Rate_monotonic_Reset_statistics(_the_period) |
Rate_monotonic_Reset_statistics. More... | |
Functions | |
void | _Rate_monotonic_Manager_initialization (void) |
Rate Monotonic Manager Initialization. More... | |
RTEMS_INLINE_ROUTINE Rate_monotonic_Control * | _Rate_monotonic_Allocate (void) |
Allocates a period control block from the inactive chain of free period control blocks. More... | |
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. More... | |
RTEMS_INLINE_ROUTINE Rate_monotonic_Control * | _Rate_monotonic_Get (Objects_Id id, Objects_Locations *location) |
Maps period IDs to period control blocks. More... | |
RTEMS_INLINE_ROUTINE bool | _Rate_monotonic_Is_active (Rate_monotonic_Control *the_period) |
Checks if the_period is in the ACTIVE state. More... | |
RTEMS_INLINE_ROUTINE bool | _Rate_monotonic_Is_inactive (Rate_monotonic_Control *the_period) |
Checks if the_period is in the ACTIVE state. More... | |
RTEMS_INLINE_ROUTINE bool | _Rate_monotonic_Is_expired (Rate_monotonic_Control *the_period) |
Checks if the_period is in the EXPIRED state. More... | |
void | _Rate_monotonic_Timeout (rtems_id id, void *ignored) |
Rate Monotonic Timeout. More... | |
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( More... | |
void | _Rate_monotonic_Initiate_statistics (Rate_monotonic_Control *the_period) |
Initiate Rate Monotonic Statistics. More... | |
Variables | |
RTEMS_RATEMON_EXTERN Objects_Information | _Rate_monotonic_Information |
Rate Monotonic Period Class Management Structure. More... | |
#define _Rate_monotonic_Reset_cpu_use_statistics | ( | _the_period | ) |
Rate_monotonic_Reset_cpu_use_statistics.
This helper method resets the period CPU usage statistics structure.
#define _Rate_monotonic_Reset_statistics | ( | _the_period | ) |
Rate_monotonic_Reset_statistics.
This helper method resets the period wall time statistics structure.
Referenced by rtems_rate_monotonic_create().
#define _Rate_monotonic_Reset_wall_time_statistics | ( | _the_period | ) |
_Rate_monotonic_Reset_wall_time_statistics
This method resets the statistics information for a period instance.
#define RTEMS_RATEMON_EXTERN extern |
This constant is defined to extern most of the time when using this header file.
However by defining it to nothing, the data declared in this header file can be instantiated. This is done in a single per manager file.
RTEMS_INLINE_ROUTINE Rate_monotonic_Control* _Rate_monotonic_Allocate | ( | void | ) |
Allocates a period control block from the inactive chain of free period control blocks.
This function allocates a period control block from the inactive chain of free period control blocks.
References _Objects_Allocate().
Referenced by rtems_rate_monotonic_create().
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.
This routine allocates a period control block from the inactive chain of free period control blocks.
References _Objects_Free(), and Rate_monotonic_Control::Object.
RTEMS_INLINE_ROUTINE Rate_monotonic_Control* _Rate_monotonic_Get | ( | Objects_Id | id, |
Objects_Locations * | location | ||
) |
Maps period IDs to period control blocks.
This function maps period IDs to period control blocks. If ID corresponds to a local period, then it returns the_period control pointer which maps to ID and location is set to OBJECTS_LOCAL. Otherwise, location is set to OBJECTS_ERROR and the_period is undefined.
References _Objects_Get().
Referenced by _Rate_monotonic_Timeout(), rtems_rate_monotonic_cancel(), rtems_rate_monotonic_delete(), and rtems_rate_monotonic_reset_statistics().
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(
This routine is invoked to compute the elapsed wall time and cpu time for a period.
[in] | the_period | points to the period being operated upon. |
[out] | wall_since_last_period | is set to the wall time elapsed since the period was initiated. |
[out] | cpu_since_last_period | is set to the cpu time used by the owning thread since the period was initiated. |
This | routine returns true if the status can be determined and false otherwise. |
References Rate_monotonic_Control::owner.
Referenced by _Rate_monotonic_Is_expired().
void _Rate_monotonic_Initiate_statistics | ( | Rate_monotonic_Control * | the_period | ) |
Initiate Rate Monotonic Statistics.
This routine is invoked when a period is initiated via an explicit call to rtems_rate_monotonic_period for the period's first iteration or from _Rate_monotonic_Timeout for period iterations 2-n.
[in] | the_period | points to the period being operated upon. |
References Rate_monotonic_Control::owner.
Referenced by _Rate_monotonic_Is_expired().
RTEMS_INLINE_ROUTINE bool _Rate_monotonic_Is_active | ( | Rate_monotonic_Control * | the_period | ) |
Checks if the_period is in the ACTIVE state.
This function returns TRUE if the_period is in the ACTIVE state, and FALSE otherwise.
References RATE_MONOTONIC_ACTIVE, and Rate_monotonic_Control::state.
RTEMS_INLINE_ROUTINE bool _Rate_monotonic_Is_expired | ( | Rate_monotonic_Control * | the_period | ) |
Checks if the_period is in the EXPIRED state.
This function returns TRUE if the_period is in the EXPIRED state, and FALSE otherwise.
References _Rate_monotonic_Get_status(), _Rate_monotonic_Initiate_statistics(), _Rate_monotonic_Timeout(), RATE_MONOTONIC_EXPIRED, and Rate_monotonic_Control::state.
RTEMS_INLINE_ROUTINE bool _Rate_monotonic_Is_inactive | ( | Rate_monotonic_Control * | the_period | ) |
Checks if the_period is in the ACTIVE state.
This function returns TRUE if the_period is in the ACTIVE state, and FALSE otherwise.
References RATE_MONOTONIC_INACTIVE, and Rate_monotonic_Control::state.
void _Rate_monotonic_Manager_initialization | ( | void | ) |
Rate Monotonic Manager Initialization.
This routine performs the initialization necessary for this manager.
References _Objects_Initialize_information(), and _Rate_monotonic_Information.
void _Rate_monotonic_Timeout | ( | rtems_id | id, |
void * | ignored | ||
) |
Rate Monotonic Timeout.
This routine is invoked when the period represented by ID expires. If the thread which owns this period is blocked waiting for the period to expire, then it is readied and the period is restarted. If the owning thread is not waiting for the period to expire, then the period is placed in the EXPIRED state and not restarted.
[in] | id | is the period id |
References _Rate_monotonic_Get().
Referenced by _Rate_monotonic_Is_expired().
RTEMS_RATEMON_EXTERN Objects_Information _Rate_monotonic_Information |
Rate Monotonic Period Class Management Structure.
This instance of Objects_Information is used to manage the set of rate monotonic period instances.
Referenced by _Rate_monotonic_Manager_initialization(), rtems_rate_monotonic_create(), and rtems_rate_monotonic_reset_all_statistics().