diff options
Diffstat (limited to 'cpukit/include/rtems/score/priorityimpl.h')
-rw-r--r-- | cpukit/include/rtems/score/priorityimpl.h | 99 |
1 files changed, 38 insertions, 61 deletions
diff --git a/cpukit/include/rtems/score/priorityimpl.h b/cpukit/include/rtems/score/priorityimpl.h index 1463bf6c2a..2a95ea605c 100644 --- a/cpukit/include/rtems/score/priorityimpl.h +++ b/cpukit/include/rtems/score/priorityimpl.h @@ -10,7 +10,7 @@ */ /* - * Copyright (c) 2016 embedded brains GmbH. All rights reserved. + * Copyright (c) 2016 embedded brains GmbH & Co. KG * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -78,7 +78,7 @@ typedef enum { * * @param[out] actions The actions to be initialized empty. */ -RTEMS_INLINE_ROUTINE void _Priority_Actions_initialize_empty( +static inline void _Priority_Actions_initialize_empty( Priority_Actions *actions ) { @@ -93,7 +93,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Actions_initialize_empty( * @param node The action node for the @a actions to be initialized. * @param type The action type for the @a actions to be initialized. */ -RTEMS_INLINE_ROUTINE void _Priority_Actions_initialize_one( +static inline void _Priority_Actions_initialize_one( Priority_Actions *actions, Priority_Aggregation *aggregation, Priority_Node *node, @@ -117,7 +117,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Actions_initialize_one( * @retval true The priority actions @a actions is empty. * @retval false The priority actions @a actions is empty. */ -RTEMS_INLINE_ROUTINE bool _Priority_Actions_is_empty( +static inline bool _Priority_Actions_is_empty( const Priority_Actions *actions ) { @@ -125,33 +125,13 @@ RTEMS_INLINE_ROUTINE bool _Priority_Actions_is_empty( } /** - * @brief Checks if the priority actions is valid. - * - * @param aggregation The aggregation of the priority action. - * - * @retval true The @a aggregation is valid. - * @retval false The @a aggregation is not valid. - */ -RTEMS_INLINE_ROUTINE bool _Priority_Actions_is_valid( - const Priority_Aggregation *aggregation -) -{ -#if defined(RTEMS_SMP) - return aggregation != NULL; -#else - (void) aggregation; - return false; -#endif -} - -/** * @brief Moves the priority actions' actions. * * @param[in, out] actions The priority actions to move the actions away from. * * @return The former actions of @a actions that were moved. */ -RTEMS_INLINE_ROUTINE Priority_Aggregation *_Priority_Actions_move( +static inline Priority_Aggregation *_Priority_Actions_move( Priority_Actions *actions ) { @@ -169,7 +149,7 @@ RTEMS_INLINE_ROUTINE Priority_Aggregation *_Priority_Actions_move( * @param[in, out] actions The priority actions to add actions to. * @param[out] aggregation The actions to add to @a actions. */ -RTEMS_INLINE_ROUTINE void _Priority_Actions_add( +static inline void _Priority_Actions_add( Priority_Actions *actions, Priority_Aggregation *aggregation ) @@ -190,7 +170,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Actions_add( * @param[out] node The priority node to be initialized. * @param priority The priority to initialize @a node to. */ -RTEMS_INLINE_ROUTINE void _Priority_Node_initialize( +static inline void _Priority_Node_initialize( Priority_Node *node, Priority_Control priority ) @@ -205,7 +185,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Node_initialize( * @param[out] node The priority node to set the priority of. * @param priority The new priority for @a node. */ -RTEMS_INLINE_ROUTINE void _Priority_Node_set_priority( +static inline void _Priority_Node_set_priority( Priority_Node *node, Priority_Control priority ) @@ -218,7 +198,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Node_set_priority( * * @param[in, out] node The priority node to set inactive. */ -RTEMS_INLINE_ROUTINE void _Priority_Node_set_inactive( +static inline void _Priority_Node_set_inactive( Priority_Node *node ) { @@ -233,7 +213,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Node_set_inactive( * @retval true The priority node is active. * @retval false The priority node is inactive. */ -RTEMS_INLINE_ROUTINE bool _Priority_Node_is_active( +static inline bool _Priority_Node_is_active( const Priority_Node *node ) { @@ -245,7 +225,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Node_is_active( * * @param[out] aggregation The priority aggregaton to initialize empty. */ -RTEMS_INLINE_ROUTINE void _Priority_Initialize_empty( +static inline void _Priority_Initialize_empty( Priority_Aggregation *aggregation ) { @@ -266,7 +246,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Initialize_empty( * @param[out] aggregation The priority aggregaton to initialize. * @param node The priority node to initialize @a aggregation with. */ -RTEMS_INLINE_ROUTINE void _Priority_Initialize_one( +static inline void _Priority_Initialize_one( Priority_Aggregation *aggregation, Priority_Node *node ) @@ -290,7 +270,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Initialize_one( * @retval true The priority aggregation is empty. * @retval false The priority aggregation is not empty. */ -RTEMS_INLINE_ROUTINE bool _Priority_Is_empty( +static inline bool _Priority_Is_empty( const Priority_Aggregation *aggregation ) { @@ -304,7 +284,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Is_empty( * * @return The priority of @a aggregation. */ -RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_priority( +static inline Priority_Control _Priority_Get_priority( const Priority_Aggregation *aggregation ) { @@ -318,7 +298,7 @@ RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_priority( * * @return The scheduler of @a aggregation. */ -RTEMS_INLINE_ROUTINE const Scheduler_Control *_Priority_Get_scheduler( +static inline const Scheduler_Control *_Priority_Get_scheduler( const Priority_Aggregation *aggregation ) { @@ -336,7 +316,7 @@ RTEMS_INLINE_ROUTINE const Scheduler_Control *_Priority_Get_scheduler( * * @return The minimum node of @a aggregation */ -RTEMS_INLINE_ROUTINE Priority_Node *_Priority_Get_minimum_node( +static inline Priority_Node *_Priority_Get_minimum_node( const Priority_Aggregation *aggregation ) { @@ -349,7 +329,7 @@ RTEMS_INLINE_ROUTINE Priority_Node *_Priority_Get_minimum_node( * @param[out] aggregation The priority aggregation to set the action node of. * @param node The new priority node for @a aggregation. */ -RTEMS_INLINE_ROUTINE void _Priority_Set_action_node( +static inline void _Priority_Set_action_node( Priority_Aggregation *aggregation, Priority_Node *node ) @@ -363,7 +343,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Set_action_node( * @param[out] aggregation The priority aggregation to set the action type of. * @param type The new action type for @a aggregation. */ -RTEMS_INLINE_ROUTINE void _Priority_Set_action_type( +static inline void _Priority_Set_action_type( Priority_Aggregation *aggregation, Priority_Action_type type ) @@ -379,7 +359,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Set_action_type( * @param node The new action node for @a aggregation. * @param type The new action type for @a aggregation. */ -RTEMS_INLINE_ROUTINE void _Priority_Set_action( +static inline void _Priority_Set_action( Priority_Aggregation *aggregation, Priority_Node *node, Priority_Action_type type @@ -389,25 +369,22 @@ RTEMS_INLINE_ROUTINE void _Priority_Set_action( aggregation->Action.type = type; } +#if defined(RTEMS_SMP) /** * @brief Gets the next action of the priority aggregation. * - * @param aggregation The priority aggregation to get the next action of. + * @param aggregation is the priority aggregation to get the next action of. * - * @retval next_action The next action of @a aggregation if RTEMS_SMP is defined. - * @retval NULL RTEMS_SMP is not defined. + * @return Returns the next action of the priority aggregation or NULL if there + * is no next action. */ -RTEMS_INLINE_ROUTINE Priority_Aggregation *_Priority_Get_next_action( +static inline Priority_Aggregation *_Priority_Get_next_action( const Priority_Aggregation *aggregation ) { -#if defined(RTEMS_SMP) return aggregation->Action.next; -#else - (void) aggregation; - return NULL; -#endif } +#endif /** * @brief Compares two priorities. @@ -418,7 +395,7 @@ RTEMS_INLINE_ROUTINE Priority_Aggregation *_Priority_Get_next_action( * @retval true The priority on the left hand side of the comparison is smaller. * @retval false The priority on the left hand side of the comparison is greater of equal. */ -RTEMS_INLINE_ROUTINE bool _Priority_Less( +static inline bool _Priority_Less( const void *left, const RBTree_Node *right ) @@ -426,7 +403,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Less( const Priority_Control *the_left; const Priority_Node *the_right; - the_left = left; + the_left = (const Priority_Control *) left; the_right = RTEMS_CONTAINER_OF( right, Priority_Node, Node.RBTree ); return *the_left < the_right->priority; @@ -445,7 +422,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Less( * @retval true The inserted node with its priority is the minimum of the RBTree. * @retval false The inserted node with its priority is not the minimum of the RBTree. */ -RTEMS_INLINE_ROUTINE bool _Priority_Plain_insert( +static inline bool _Priority_Plain_insert( Priority_Aggregation *aggregation, Priority_Node *node, Priority_Control priority @@ -467,7 +444,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Plain_insert( * @param[in, out] aggregation The aggregation to extract the node from. * @param node The node to be extracted. */ -RTEMS_INLINE_ROUTINE void _Priority_Plain_extract( +static inline void _Priority_Plain_extract( Priority_Aggregation *aggregation, Priority_Node *node ) @@ -484,7 +461,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Plain_extract( * @param[in, out] aggregation The aggregation to change the node in. * @param node The node that has a new priority and will be reinserted in the aggregation. */ -RTEMS_INLINE_ROUTINE void _Priority_Plain_changed( +static inline void _Priority_Plain_changed( Priority_Aggregation *aggregation, Priority_Node *node ) @@ -522,7 +499,7 @@ typedef void ( *Priority_Remove_handler )( * @param actions Is ignored by the method. * @param arg Is ignored by the method. */ -RTEMS_INLINE_ROUTINE void _Priority_Change_nothing( +static inline void _Priority_Change_nothing( Priority_Aggregation *aggregation, Priority_Group_order group_order, Priority_Actions *actions, @@ -544,7 +521,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Change_nothing( * @param actions Is ignored by the method. * @param arg Is ignored by the method. */ -RTEMS_INLINE_ROUTINE void _Priority_Remove_nothing( +static inline void _Priority_Remove_nothing( Priority_Aggregation *aggregation, Priority_Actions *actions, void *arg @@ -568,7 +545,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Remove_nothing( * @param arg Arguments for @a change that is used if the node is the new * minimum. */ -RTEMS_INLINE_ROUTINE void _Priority_Non_empty_insert( +static inline void _Priority_Non_empty_insert( Priority_Aggregation *aggregation, Priority_Node *node, Priority_Actions *actions, @@ -599,7 +576,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Non_empty_insert( * insert and @a node is the new minimum of the aggregation. * @param arg The arguments for @a change. */ -RTEMS_INLINE_ROUTINE void _Priority_Insert( +static inline void _Priority_Insert( Priority_Aggregation *aggregation, Priority_Node *node, Priority_Actions *actions, @@ -633,7 +610,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Insert( * @param change Is called in the case that the minimal node was extracted. * @param arg The arguments for @a remove and @a change. */ -RTEMS_INLINE_ROUTINE void _Priority_Extract( +static inline void _Priority_Extract( Priority_Aggregation *aggregation, Priority_Node *node, Priority_Actions *actions, @@ -673,7 +650,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Extract( * @param change Is called in the case that the minimal node was extracted. * @param arg The arguments for @a change. */ -RTEMS_INLINE_ROUTINE void _Priority_Extract_non_empty( +static inline void _Priority_Extract_non_empty( Priority_Aggregation *aggregation, Priority_Node *node, Priority_Actions *actions, @@ -708,7 +685,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Extract_non_empty( * @param change Is called if the minimal priority is incorrectly set after the change. * @param arg The arguments for @a change. */ -RTEMS_INLINE_ROUTINE void _Priority_Changed( +static inline void _Priority_Changed( Priority_Aggregation *aggregation, Priority_Node *node, Priority_Group_order group_order, @@ -744,7 +721,7 @@ RTEMS_INLINE_ROUTINE void _Priority_Changed( * @param[out] replacement The node that replaces @a victim. It obtains its priority * from @a victim. */ -RTEMS_INLINE_ROUTINE void _Priority_Replace( +static inline void _Priority_Replace( Priority_Aggregation *aggregation, Priority_Node *victim, Priority_Node *replacement |