diff options
author | Brian Horton <brianh@linux.ibm.com> | 2013-04-30 09:33:17 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-05-17 09:59:11 -0500 |
commit | 4f753ed80d5caf3646fcb2e9bead2938d9ca7ade (patch) | |
tree | 11e8a681533f3e6743e6890a8f8db687dc8c85bf /src/usr/targeting/common/predicates | |
parent | 4927c80d6604832db0d9b2a030ed44682fabb947 (diff) | |
download | blackbird-hostboot-4f753ed80d5caf3646fcb2e9bead2938d9ca7ade.tar.gz blackbird-hostboot-4f753ed80d5caf3646fcb2e9bead2938d9ca7ade.zip |
add support for ChangeSinceLastChecked bits
replace hwas changedSinceLastIpl bit to a bit for different services
(ie, GARD, mem diag, psi diag, etc) and a subscription mask; this will
be used by hcdb code - when a target changes, the mask will be copied
into the bits field, and then services will clear their bits when they
process the change.
also update and create new hwas predicate to handle new attributes, as
well as targeting utilities to set and clear the bits.
Change-Id: Ie4a29500d07d7722f77ae2e89459e79a8b1e535b
RTC: 63434
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/4343
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/common/predicates')
-rw-r--r-- | src/usr/targeting/common/predicates/predicatehwas.C | 65 | ||||
-rw-r--r-- | src/usr/targeting/common/predicates/predicatehwaschanged.C | 111 |
2 files changed, 143 insertions, 33 deletions
diff --git a/src/usr/targeting/common/predicates/predicatehwas.C b/src/usr/targeting/common/predicates/predicatehwas.C index d92536269..6f95cb9d7 100644 --- a/src/usr/targeting/common/predicates/predicatehwas.C +++ b/src/usr/targeting/common/predicates/predicatehwas.C @@ -1,31 +1,30 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/targeting/common/predicates/predicatehwas.C $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/targeting/common/predicates/predicatehwas.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /** * @file targeting/common/predicates/predicatehwas.C * - * @brief Implementation for a predicate which fiters a target based on its + * @brief Implementation for a predicate which fiters a target based on its * HWAS state */ @@ -45,7 +44,7 @@ #include <targeting/adapters/assertadapter.H> //****************************************************************************** -// Macros +// Macros //****************************************************************************** #undef TARG_NAMESPACE @@ -53,7 +52,7 @@ #undef TARG_FN //****************************************************************************** -// Interface +// Interface //****************************************************************************** namespace TARGETING @@ -66,7 +65,7 @@ namespace TARGETING // PredicateHwas::~PredicateHwas() //****************************************************************************** -PredicateHwas::~PredicateHwas() +PredicateHwas::~PredicateHwas() { #define TARG_FUNC "~PredicateHwas()" #undef TARG_FUNC @@ -90,15 +89,15 @@ PredicateHwas& PredicateHwas::reset() bool PredicateHwas::operator()( const Target* const i_pTarget) const { - #define TARG_FUNC "operator()(...)" - + #define TARG_FUNC "operator()(...)" + hwasState actual = { rawValue: 0}; CPPASSERT(sizeof(actual.attribute) <= sizeof(actual.rawValue)); actual.attribute = i_pTarget->getAttr<ATTR_HWAS_STATE>(); - - return ( (actual.rawValue & iv_valid.rawValue) - == (iv_desired.rawValue & iv_valid.rawValue)); - + + return ( (actual.rawValue & iv_valid.rawValue) == + (iv_desired.rawValue & iv_valid.rawValue)); + #undef TARG_FUNC } diff --git a/src/usr/targeting/common/predicates/predicatehwaschanged.C b/src/usr/targeting/common/predicates/predicatehwaschanged.C new file mode 100644 index 000000000..47e228309 --- /dev/null +++ b/src/usr/targeting/common/predicates/predicatehwaschanged.C @@ -0,0 +1,111 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/targeting/common/predicates/predicatehwaschanged.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +/** + * @file targeting/common/predicates/predicatehwaschanged.C + * + * @brief Implementation for a predicate which fiters a target based on its + * HWAS state + */ + +//****************************************************************************** +// Includes +//****************************************************************************** + +// STD +#include <string.h> + +// Other Host Boot Components + +// Targeting Component +#include <targeting/common/attributes.H> +#include <targeting/common/target.H> +#include <targeting/common/predicates/predicates.H> +#include <targeting/adapters/assertadapter.H> + +//****************************************************************************** +// Macros +//****************************************************************************** + +#undef TARG_NAMESPACE +#undef TARG_CLASS +#undef TARG_FN + +//****************************************************************************** +// Interface +//****************************************************************************** + +namespace TARGETING +{ + +#define TARG_NAMESPACE "TARGETING::" +#define TARG_CLASS "PredicateHwasChanged::" + +//****************************************************************************** +// PredicateHwasChanged::~PredicateHwasChanged() +//****************************************************************************** + +PredicateHwasChanged::~PredicateHwasChanged() +{ + #define TARG_FUNC "~PredicateHwasChanged()" + #undef TARG_FUNC +} + +//****************************************************************************** +// PredicateHwasChanged::reset +//****************************************************************************** + +PredicateHwasChanged& PredicateHwasChanged::reset() +{ + memset(&iv_valid,0x00,sizeof(iv_valid)); + memset(&iv_desired,0x00,sizeof(iv_desired)); + return *this; +} + +//****************************************************************************** +// PredicateHwasChanged::operator() +//****************************************************************************** + +bool PredicateHwasChanged::operator()( + const Target* const i_pTarget) const +{ + #define TARG_FUNC "operator()(...)" + + hwasStateChangedFlag actual = { rawValue: 0}; + CPPASSERT(sizeof(actual.attribute) <= + sizeof(actual.rawValue)); + actual.attribute = + i_pTarget->getAttr<ATTR_HWAS_STATE_CHANGED_FLAG>(); + ATTR_HWAS_STATE_CHANGED_SUBSCRIPTION_MASK_type subscriptionMask = + i_pTarget->getAttr<ATTR_HWAS_STATE_CHANGED_SUBSCRIPTION_MASK>(); + + return ((actual.rawValue & (iv_valid.rawValue & subscriptionMask)) == + (iv_desired.rawValue & (iv_valid.rawValue & subscriptionMask))); + + #undef TARG_FUNC +} + +#undef TARG_CLASS +#undef TARG_NAMESPACE + +} // End namespace TARGETING + |