diff options
author | Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com> | 2018-04-03 06:55:55 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-04-16 10:16:17 -0400 |
commit | 9bce359ec222a64e713ab8f5fa992e7bdb575015 (patch) | |
tree | deff5200ac5644d98ef9691f8d53d131f3082182 | |
parent | 15777e178a40228e43bb981942ef0661956e08f8 (diff) | |
download | talos-hostboot-9bce359ec222a64e713ab8f5fa992e7bdb575015.tar.gz talos-hostboot-9bce359ec222a64e713ab8f5fa992e7bdb575015.zip |
Add an option disable fsp to sm sync for some attributes.
A new XML file with list of attributes need not be synced is
accepted by the script. The attributes in the list is excluded
from the output XML processed to create system model tables.
Change-Id: If1d3a02d574988ce5e0fa503bab2fd0e4accdb8d
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56636
CI-Ready: DHRUVARAJ SUBHASH CHANDRAN <dhruvaraj@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r-- | src/include/usr/targeting/common/target.H | 73 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 22 |
2 files changed, 95 insertions, 0 deletions
diff --git a/src/include/usr/targeting/common/target.H b/src/include/usr/targeting/common/target.H index 21f3d7fba..ab22a62bb 100644 --- a/src/include/usr/targeting/common/target.H +++ b/src/include/usr/targeting/common/target.H @@ -159,6 +159,30 @@ class Target bool tryGetAttr(typename AttributeTraits<A>::Type& o_attrValue) const; /** + * @brief Try to get the target's specified not synced attribute value + * + * A special tryGetAttr function for getting the attribute values + * of the attributes which are not synced to system model on FSP. + * It returns false (with invalid o_attrValue) if the specified + * attribute does not exist for the associated target, true (with a + * valid o_attrValue) otherwise. + * + * @param[out] o_attrValue Value of the attribute + * + * @pre Target service must be initialized + * + * @post See "return" + * + * @return bool indicating whether the specified attribute was returned + * or not + * + * @retval true Attribute returned in o_attrValue + * @retval false Attribute not found; o_attValue not valid + */ + template<const ATTRIBUTE_ID A> + bool tryGetAttrNotSynced( + typename AttributeTraits<A>::Type& o_attrValue) const; + /** * @brief Get the target's specified attribute value * * Returns the target's specified attribute value. If the specified @@ -250,6 +274,31 @@ class Target bool trySetAttr(typename AttributeTraits<A>::Type const& i_attrValue); /** + * @brief Tries to set the target's specified not synced attribute value + * + * This special function need to be used on FSP to set the value of + * an attribute which is not synced to system model. + * It returns false if the specified attribute does not exist for the + * associated target, true otherwise. + * + * @param[in] i_attrValue Value of the attribute + * + * @pre Target service must be initialized + * + * @post Target's attribute value updated (if it exists), and caller + * notified whether the update occurred or not. + * + * @return bool indicating whether the specified attribute was updated + * or not + * + * @retval true Attribute updated + * @retval false Attribute not updated + */ + template<const ATTRIBUTE_ID A> + bool trySetAttrNotSynced( + typename AttributeTraits<A>::Type const& i_attrValue); + + /** * @brief Returns pointer to a mutex attribute associated with the * target * @@ -795,11 +844,24 @@ class Target } PACKED; template<const ATTRIBUTE_ID A> +bool Target::tryGetAttrNotSynced( + typename AttributeTraits<A>::Type& o_attrValue) const +{ + if(AttributeTraits<A>::readable) { } + if(AttributeTraits<A>::notHbMutex) { } + if(AttributeTraits<A>::notFspMutex) { } + return _tryGetAttr(A,sizeof(o_attrValue),&o_attrValue); +} + +template<const ATTRIBUTE_ID A> bool Target::tryGetAttr(typename AttributeTraits<A>::Type& o_attrValue) const { if(AttributeTraits<A>::readable) { } if(AttributeTraits<A>::notHbMutex) { } +#if !defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) if(AttributeTraits<A>::notFspMutex) { } +#endif //!defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) + if(AttributeTraits<A>::fspAccessible) { } return _tryGetAttr(A,sizeof(o_attrValue),&o_attrValue); } @@ -808,9 +870,20 @@ bool Target::trySetAttr(typename AttributeTraits<A>::Type const& i_attrValue) { if(AttributeTraits<A>::writeable) { } if(AttributeTraits<A>::notHbMutex) { } +#if !defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) + if(AttributeTraits<A>::fspAccessible) { } +#endif //!defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) return _trySetAttr(A,sizeof(i_attrValue),&i_attrValue); } +template<const ATTRIBUTE_ID A> +bool Target::trySetAttrNotSynced( + typename AttributeTraits<A>::Type const& i_attrValue) +{ + if(AttributeTraits<A>::writeable) { } + if(AttributeTraits<A>::notHbMutex) { } + return _trySetAttr(A,sizeof(i_attrValue),&i_attrValue); +} template<const ATTRIBUTE_ID A> typename AttributeTraits<A>::Type Target::getAttr() const diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index 43906fd12..8d8ac765b 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -82,6 +82,7 @@ my $cfgBigEndian = 1; my $cfgIncludeFspAttributes = 0; my $CfgSMAttrFile = ""; my $cfgAddVersionPage = 0; +my $nonSyncAttribFile = ""; my $cfgBiosXmlFile = undef; my $cfgBiosSchemaFile = undef; @@ -103,6 +104,7 @@ GetOptions("hb-xml-file:s" => \$cfgHbXmlFile, "bios-xml-file:s" => \$cfgBiosXmlFile, "bios-schema-file:s" => \$cfgBiosSchemaFile, "bios-output-file:s" => \$cfgBiosOutputFile, + "non-sync-attrib-file:s" => \$nonSyncAttribFile, "help" => \$cfgHelp, "man" => \$cfgMan, "verbose" => \$cfgVerbose ) || pod2usage(-verbose => 0); @@ -135,6 +137,7 @@ if($cfgVerbose) print STDOUT "bios-schema-file = $cfgBiosSchemaFile\n"; print STDOUT "bios-xml-file = $cfgBiosXmlFile\n"; print STDOUT "bios-output-file = $cfgBiosOutputFile\n"; + print STDOUT "Non Sync Attributes file = $nonSyncAttribFile\n"; } ################################################################################ @@ -199,6 +202,15 @@ if ($cfgFapiAttributesXmlFile ne "") $fapiAttributes = $xml->XMLin($cfgFapiAttributesXmlFile, forcearray => ['attribute']); } + +my @nonSyncAttributes = {}; +if ($nonSyncAttribFile ne "") +{ + my $nsa = $xml->XMLin($nonSyncAttribFile, + KeyAttr => 'id', ForceArray=>1); + @nonSyncAttributes = values %$nsa; +} + # save attributes defined as Target_t type my %Target_t = (); @@ -2489,6 +2501,11 @@ sub writeTraitFileTraits { $traits .= " notFspMutex,"; } + if (!($attribute->{id} ~~ @nonSyncAttributes)) + { + $traits .= " fspAccessible,"; + } + chop($traits); # Build value type @@ -7009,6 +7026,11 @@ print SM_TARGET_FILE " <attributes>"; for (my $i = 0; $i < $Count; $i++) { + if ($attrDataforSM[$i][ATTRNAME] ~~ @nonSyncAttributes) + { + next; + } + print SM_TARGET_FILE " <attribute> <id>0x$attrDataforSM[$i][ATTRID]</id> |