From 0a1b60c34e55018e233c64b292e16c3479d2145c Mon Sep 17 00:00:00 2001 From: Marty Gloff Date: Tue, 17 Oct 2017 08:23:52 -0500 Subject: Concurrent code update of HBRT - Update Structure Update Hostboot targeting data in the new targeting structure from the current targeting data. It will have the logic to save and restore values as appropriate. Change-Id: I7ae4a0c2e58548f6f1a6229f40b9fda833670e86 RTC: 180908 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48504 Reviewed-by: Roland Veloz Reviewed-by: Matt Derksen Reviewed-by: Brian E. Bakke Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/include/usr/targeting/common/target.H | 30 ++++++++++ src/include/usr/targeting/common/targetservice.H | 69 +++++++++++++++++++++- src/include/usr/targeting/common/targreasoncodes.H | 1 + 3 files changed, 98 insertions(+), 2 deletions(-) (limited to 'src/include/usr/targeting/common') diff --git a/src/include/usr/targeting/common/target.H b/src/include/usr/targeting/common/target.H index 9e1c23b85..6d7a0dafd 100644 --- a/src/include/usr/targeting/common/target.H +++ b/src/include/usr/targeting/common/target.H @@ -58,6 +58,8 @@ namespace RT_TARG { void adjustTargeting4Runtime(); + int saveRestoreAttrs(void *i_rsvdMemPtr, + void *io_lidStructPtr); } #endif @@ -98,6 +100,7 @@ namespace TARGETING // Type Aliases //****************************************************************************** class AttributeTank; +class AttrRP; class Target; typedef const Target* ConstTargetHandle_t; typedef Target* TargetHandle_t; @@ -479,6 +482,31 @@ class Target ATTRIBUTE_ID i_attr, void*& o_pAttr) const; + /** + * @brief Gets a pointer to the target's associated attribute + * + * Gets a pointer to the target's associated attribute + * + * @param[in] i_attr Attribute to retrieve + * @param[in] i_attrRP Pointer to attribute resource provider + * @param[in] i_pAttrId Pointer to array of attribute IDs for target + * @param[in] i_ppAttrAddr Pointer to array of attribute addresses + * @param[out] o_pAttr Pointer to data location to hold the attribute + * data + * + * @pre Target service must be initialized + * + * @post If attribute exists for the associated target, caller's + * pointer updated with associated attribute pointer. Otherwise, + * caller's pointer updated to NULL. + */ + void _getAttrPtr( + ATTRIBUTE_ID i_attr, + AttrRP* i_attrRP, + ATTRIBUTE_ID* i_pAttrId, + AbstractPointer* i_ppAttrAddr, + void*& o_pAttr) const; + /** * @brief Returns pointer to a mutex attribute associated with the * target @@ -632,6 +660,8 @@ class Target #ifdef __HOSTBOOT_RUNTIME friend void RT_TARG::adjustTargeting4Runtime(); + friend int RT_TARG::saveRestoreAttrs(void *, + void *); #endif diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H index 5eae01fc7..f1126bf21 100644 --- a/src/include/usr/targeting/common/targetservice.H +++ b/src/include/usr/targeting/common/targetservice.H @@ -63,6 +63,9 @@ namespace TARGETING { + // Forward declaration of attribute resource provider class. + class AttrRP; + class TargetService; /* @@ -710,6 +713,60 @@ class TargetService */ void getMasterNodeTarget(Target*& o_masterNodeTarget) const; + /** + * @brief Returns Target Range Filter information. + * + * @par Detailed Description: + * Returns the Target Range Filter information for the specified + * attribute data and resource provider. + * + * @param[in] i_attrData pointer to attribute data + * + * @param[in] i_attrRP pointer to attribute resource provider + * + * @param[out] o_maxTargets maximum targets in the range + * + * @param[in] i_nodeId, node ID for the target. Defaults to 0. + * + * @pre TargetService must be initialized. + * + * @post Returns the Target Range Filter information for the specified + * attribute data and resource provider. + * + * @return TargetRangeFilter + */ + TargetRangeFilter getTargetRangeFilter(void *i_attrData, + AttrRP *i_attrRP, + uint32_t &o_maxTargets, + NODE_ID i_nodeId = 0); + + /** + * @brief Returns Target Attribute information. + * + * @par Detailed Description: + * Returns the Target Attribute information for the specified + * target and resource provider. + * + * @param[in] i_target pointer to target + * + * @param[in] i_attrRP pointer to attribute resource provider + * + * @param[out] o_pAttrId pointer to array of attribute IDs + * + * @param[out] o_ppAttrAddr pointer to array of attribute addresses + * + * @pre TargetService must be initialized. + * + * @post Returns the Target Attribute information for the specified + * target and resource provider. + * + * @return Number of attributes in the arrays + */ + uint32_t getTargetAttributes(Target*i_target, + AttrRP *i_attrRP, + ATTRIBUTE_ID* &o_pAttrId, + AbstractPointer* &o_ppAttrAddr); + private: @@ -768,11 +825,15 @@ class TargetService * specific information of the type NodeSpecificInfo. May refer to * structure definition * + * @param[in] i_attrRP, attribute resource provider to use if address + * translation is required. Defaults to NULL, ie, AttrRP Singleton. + * * @pre Target service must not be initialized * * @post Target service target pool configured for access */ - void _configureTargetPool(NodeSpecificInfo& i_nodeInfoContainer); + void _configureTargetPool(NodeSpecificInfo& i_nodeInfoContainer, + AttrRP *i_attrRP = NULL); /** * @brief Computes the maximum number of targets, caches the value @@ -785,13 +846,17 @@ class TargetService * specific information of the type NodeSpecificInfo. May refer to * structure definition * + * @param[in] i_attrRP, attribute resource provider to use if address + * translation is required. Defaults to NULL, ie, AttrRP Singleton. + * * @pre Target service must not already be initialized * * @post Target service updated with maximum target count in * nodeContainer. * */ - void _maxTargets(NodeSpecificInfo & io_nodeInfoContainer); + void _maxTargets(NodeSpecificInfo & io_nodeInfoContainer, + AttrRP *i_attrRP = NULL); //@NEBA diff --git a/src/include/usr/targeting/common/targreasoncodes.H b/src/include/usr/targeting/common/targreasoncodes.H index 92d9611c4..1c0fb4c8c 100644 --- a/src/include/usr/targeting/common/targreasoncodes.H +++ b/src/include/usr/targeting/common/targreasoncodes.H @@ -50,6 +50,7 @@ enum TargetingModuleId TARG_APPLY_ATTR_OVER = 0x0A, TARG_HANDLE_ENUM_CHECK_FAILURE = 0x0B, TARG_HANDLE_RANGE_CHECK_FAILURE = 0x0C, + TARG_RT_SAVE_RESTORE_ATTRS = 0x0D, }; enum TargetingReasonCode -- cgit v1.2.1