|
RTEMS CPU Kit with SuperCore
4.10.99.0
|
Classic API Rate Monotonic Manager. More...
|
Data Structures | |
| struct | rtems_rate_monotonic_period_statistics |
| The following defines the PUBLIC data structure that has the statistics kept on each period instance. More... | |
| struct | Rate_monotonic_Statistics |
| The following defines the INTERNAL data structure that has the statistics kept on each period instance. More... | |
| struct | rtems_rate_monotonic_period_status |
| The following defines the period status structure. More... | |
| struct | Rate_monotonic_Control |
| The following structure defines the control block used to manage each period. More... | |
Defines | |
| #define | RTEMS_PERIOD_STATUS WATCHDOG_NO_TIMEOUT |
| The following constant is the interval passed to the rate_monontonic_period directive to obtain status information. | |
| #define | _Rate_monotonic_Reset_wall_time_statistics(_the_period) |
| _Rate_monotonic_Reset_wall_time_statistics | |
| #define | _Rate_monotonic_Reset_cpu_use_statistics(_the_period) |
| Rate_monotonic_Reset_cpu_use_statistics. | |
| #define | _Rate_monotonic_Reset_statistics(_the_period) |
| Rate_monotonic_Reset_statistics. | |
Typedefs | |
| typedef struct timespec | rtems_rate_monotonic_period_time_t |
| This is the public type used for the rate monotonic timing statistics. | |
| typedef Timestamp_Control | Rate_monotonic_Period_time_t |
| This is the internal type used for the rate monotonic timing statistics. | |
Enumerations | |
| enum | rtems_rate_monotonic_period_states { RATE_MONOTONIC_INACTIVE, RATE_MONOTONIC_OWNER_IS_BLOCKING, RATE_MONOTONIC_ACTIVE, RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING, RATE_MONOTONIC_EXPIRED } |
| The following enumerated type defines the states in which a period may be. More... | |
Functions | |
| void | _Rate_monotonic_Manager_initialization (void) |
| Rate Monotonic Manager Initialization. | |
| rtems_status_code | rtems_rate_monotonic_create (rtems_name name, rtems_id *id) |
| Create a Period. | |
| rtems_status_code | rtems_rate_monotonic_ident (rtems_name name, rtems_id *id) |
| RTEMS Rate Monotonic Name to Id. | |
| rtems_status_code | rtems_rate_monotonic_cancel (rtems_id id) |
| RTEMS Rate Monotonic Cancel. | |
| rtems_status_code | rtems_rate_monotonic_delete (rtems_id id) |
| RTEMS Delete Rate Monotonic. | |
| rtems_status_code | rtems_rate_monotonic_get_status (rtems_id id, rtems_rate_monotonic_period_status *status) |
| RTEMS Rate Monotonic Get Status. | |
| rtems_status_code | rtems_rate_monotonic_get_statistics (rtems_id id, rtems_rate_monotonic_period_statistics *statistics) |
| RTEMS Rate Monotonic Get Statistics. | |
| rtems_status_code | rtems_rate_monotonic_reset_statistics (rtems_id id) |
| RTEMS Rate Monotonic Reset Statistics. | |
| void | rtems_rate_monotonic_reset_all_statistics (void) |
| rtems_rate_monotonic_reset_all_statistics | |
| void | rtems_rate_monotonic_report_statistics_with_plugin (void *context, rtems_printk_plugin_t print) |
| RTEMS Report Rate Monotonic Statistics. | |
| void | rtems_rate_monotonic_report_statistics (void) |
| RTEMS Report Rate Monotonic Statistics. | |
| rtems_status_code | rtems_rate_monotonic_period (rtems_id id, rtems_interval length) |
| RTEMS Rate Monotonic Period. | |
| void | _Rate_monotonic_Timeout (rtems_id id, void *ignored) |
| Rate Monotonic Timeout. | |
| 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( | |
| void | _Rate_monotonic_Initiate_statistics (Rate_monotonic_Control *the_period) |
| Initiate Rate Monotonic Statistics. | |
| RTEMS_INLINE_ROUTINE Rate_monotonic_Control * | _Rate_monotonic_Allocate (void) |
| Allocates a period control block from the inactive chain of free period control blocks. | |
| 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. | |
| RTEMS_INLINE_ROUTINE Rate_monotonic_Control * | _Rate_monotonic_Get (Objects_Id id, Objects_Locations *location) |
| Maps period IDs to period control blocks. | |
| RTEMS_INLINE_ROUTINE bool | _Rate_monotonic_Is_active (Rate_monotonic_Control *the_period) |
| Checks if the_period is in the ACTIVE state. | |
| RTEMS_INLINE_ROUTINE bool | _Rate_monotonic_Is_inactive (Rate_monotonic_Control *the_period) |
| Checks if the_period is in the ACTIVE state. | |
| RTEMS_INLINE_ROUTINE bool | _Rate_monotonic_Is_expired (Rate_monotonic_Control *the_period) |
| Checks if the_period is in the EXPIRED state. | |
| RTEMS_INLINE_ROUTINE bool | _Rate_monotonic_Is_null (Rate_monotonic_Control *the_period) |
| Checks if the_period is NULL. | |
Variables | |
| RTEMS_RATEMON_EXTERN Objects_Information | _Rate_monotonic_Information |
| Rate Monotonic Period Class Management Structure. | |
Classic API Rate Monotonic Manager.
This encapsulates functionality related to the Classic API Rate Monotonic Manager.
This include file contains all the constants, structures, and prototypes associated with the Rate Monotonic Manager. This manager provides facilities to implement threads which execute in a periodic fashion.
Directives provided are:
Statistics are kept for each period and can be obtained or printed via API calls. The statistics kept include minimum, maximum and average times for both cpu usage and wall time. The statistics indicate the execution time used by the owning thread between successive calls to rtems_rate_monotonic_period.
Rate Monotonic Manager -- Reset Statistics for All Periods
| #define _Rate_monotonic_Reset_cpu_use_statistics | ( | _the_period | ) |
do { \ /* set the minimums to a large value */ \ _Timestamp_Set( \ &(_the_period)->Statistics.min_cpu_time, \ 0x7fffffff, \ 0x7fffffff \ ); \ } while (0)
Rate_monotonic_Reset_cpu_use_statistics.
This helper method resets the period CPU usage statistics structure.
| #define _Rate_monotonic_Reset_statistics | ( | _the_period | ) |
do { \ memset( \ &(_the_period)->Statistics, \ 0, \ sizeof( rtems_rate_monotonic_period_statistics ) \ ); \ _Rate_monotonic_Reset_cpu_use_statistics( _the_period ); \ _Rate_monotonic_Reset_wall_time_statistics( _the_period ); \ } while (0)
Rate_monotonic_Reset_statistics.
This helper method resets the period wall time statistics structure.
| #define _Rate_monotonic_Reset_wall_time_statistics | ( | _the_period | ) |
do { \ /* set the minimums to a large value */ \ _Timestamp_Set( \ &(_the_period)->Statistics.min_wall_time, \ 0x7fffffff, \ 0x7fffffff \ ); \ } while (0)
_Rate_monotonic_Reset_wall_time_statistics
This method resets the statistics information for a period instance.
The following enumerated type defines the states in which a period may be.
| 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(), and _Rate_monotonic_Information.
| 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(), _Rate_monotonic_Information, 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(), and _Rate_monotonic_Information.
| 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. |
| 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. |
| 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_Control::state, and RATE_MONOTONIC_ACTIVE.
| 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_Control::state, and RATE_MONOTONIC_EXPIRED.
| 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_Control::state, and RATE_MONOTONIC_INACTIVE.
| RTEMS_INLINE_ROUTINE bool _Rate_monotonic_Is_null | ( | Rate_monotonic_Control * | the_period | ) |
Checks if the_period is NULL.
This function returns TRUE if the_period is NULL and FALSE otherwise.
| void _Rate_monotonic_Manager_initialization | ( | void | ) |
Rate Monotonic Manager Initialization.
This routine performs the initialization necessary for this manager.
| 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 |
| rtems_status_code rtems_rate_monotonic_cancel | ( | rtems_id | id | ) |
RTEMS Rate Monotonic Cancel.
This routine implements the rtems_rate_monotonic_cancel directive. This directive stops the period associated with ID from continuing to run.
| [in] | id | is the rate monotonic id |
| RTEMS_SUCCESSFUL | if successful and caller is not the owning thread or error code if unsuccessful |
| rtems_status_code rtems_rate_monotonic_create | ( | rtems_name | name, |
| rtems_id * | id | ||
| ) |
Create a Period.
Rate Monotonic Manager
This routine implements the rate_monotonic_create directive. The period will have the name name. It returns the id of the created period in ID.
| rtems_status_code rtems_rate_monotonic_delete | ( | rtems_id | id | ) |
RTEMS Delete Rate Monotonic.
This routine implements the rtems_rate_monotonic_delete directive. The period indicated by ID is deleted.
| [in] | id | is the rate monotonic id |
| This | method returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error. |
| rtems_status_code rtems_rate_monotonic_get_statistics | ( | rtems_id | id, |
| rtems_rate_monotonic_period_statistics * | statistics | ||
| ) |
RTEMS Rate Monotonic Get Statistics.
This routine implements the rtems_rate_monotonic_get_statistics directive. Statistics gathered from the use of this period are returned.
| [in] | id | is the rate monotonic id |
| [in] | statistics | is the pointer to statistics control block |
| RTEMS_SUCCESSFUL | if successful or error code if unsuccessful |
| rtems_status_code rtems_rate_monotonic_get_status | ( | rtems_id | id, |
| rtems_rate_monotonic_period_status * | status | ||
| ) |
RTEMS Rate Monotonic Get Status.
This routine implements the rtems_rate_monotonic_get_status directive. Information about the period indicated by ID is returned.
| [in] | id | is the rate monotonic id |
| [in] | status | is the pointer to status control block |
| This | method returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error. |
| rtems_status_code rtems_rate_monotonic_ident | ( | rtems_name | name, |
| rtems_id * | id | ||
| ) |
RTEMS Rate Monotonic Name to Id.
This routine implements the rtems_rate_monotonic_ident directive. It returns the period ID associated with name. If more than one period is named name, then the period to which the ID belongs is arbitrary.
| [in] | name | is the user defined period name |
| [in] | id | is the pointer to period id |
| This | method returns RTEMS_SUCCESSFUL if there was not an error. Otherwise, a status code is returned indicating the source of the error. If successful, the id will be filled in with the region id. |
| rtems_status_code rtems_rate_monotonic_period | ( | rtems_id | id, |
| rtems_interval | length | ||
| ) |
RTEMS Rate Monotonic Period.
This routine implements the rtems_rate_monotonic_period directive. When length is non-zero, this directive initiates the period associated with ID from continuing for a period of length. If length is zero, then result is set to indicate the current state of the period.
| [in] | id | is the rate monotonic id |
| [in] | length | is the length of period (in ticks) |
| RTEMS_SUCCESSFUL | if successful or error code if unsuccessful |
| void rtems_rate_monotonic_report_statistics | ( | void | ) |
RTEMS Report Rate Monotonic Statistics.
This routine allows a thread to print the statistics information on ALL period instances which have non-zero counts using printk.
| void rtems_rate_monotonic_report_statistics_with_plugin | ( | void * | context, |
| rtems_printk_plugin_t | |||
| ) |
RTEMS Report Rate Monotonic Statistics.
This routine allows a thread to print the statistics information on ALL period instances which have non-zero counts using printk. The implementation of this directive straddles the fence between inside and outside of RTEMS. It is presented as part of the Manager but actually uses other services of the Manager.
| void rtems_rate_monotonic_reset_all_statistics | ( | void | ) |
rtems_rate_monotonic_reset_all_statistics
This routine allows a thread to reset the statistics information on ALL period instances.
| rtems_status_code rtems_rate_monotonic_reset_statistics | ( | rtems_id | id | ) |
RTEMS Rate Monotonic Reset Statistics.
Rate Monotonic Manager -- Reset Statistics
This routine allows a thread to reset the statistics information on a specific period instance.
| 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_Allocate(), _Rate_monotonic_Free(), and _Rate_monotonic_Get().
1.7.5