summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2017-02-28 21:46:27 -0600
committerZane C. Shelley <zshelle@us.ibm.com>2017-03-07 15:37:23 -0500
commit3ea9bd9bf1effe6b5b45938d08ec7975e62b693a (patch)
treebdadf7e37b04171663b9a5b4eaeb17f214c7881c
parent24fea601c0c2b04093572a2975b39635429f8dfb (diff)
downloadtalos-hostboot-3ea9bd9bf1effe6b5b45938d08ec7975e62b693a.tar.gz
talos-hostboot-3ea9bd9bf1effe6b5b45938d08ec7975e62b693a.zip
PRD: updates to prdfCalloutMap.H
Change-Id: Ia66755795db6cfc23cff381383640fb5bd9b3bb3 RTC: 137911 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37306 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37600 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
-rw-r--r--src/usr/diag/prdf/common/framework/resolution/prdfCalloutMap.H98
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/resolution/prdfCallouts.H6
-rw-r--r--src/usr/diag/prdf/common/rule/prdfRuleMetaData.C26
-rw-r--r--src/usr/diag/prdf/common/rule/prdrCompile.C45
4 files changed, 98 insertions, 77 deletions
diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfCalloutMap.H b/src/usr/diag/prdf/common/framework/resolution/prdfCalloutMap.H
index de932cac4..d4a68391b 100644
--- a/src/usr/diag/prdf/common/framework/resolution/prdfCalloutMap.H
+++ b/src/usr/diag/prdf/common/framework/resolution/prdfCalloutMap.H
@@ -32,7 +32,7 @@
//------------------------------------------------------------------------------
-#ifndef PRDF_SIM_ENUMS // needed to compile prdfsimEnumMap.C
+#if !defined(PRDF_RULE_COMPILER_ENUMS) && !defined(PRDF_SIM_ENUMS)
namespace PRDF
{
#endif
@@ -44,21 +44,27 @@ namespace PRDF
// Used only in the rule compiler. Sets up a map between string keywords in
// the rule code to the enum name.
- #define PRDF_SYM_CALLOUT_MAP_BEGIN \
- struct SymCallout_t { const char * str; SymbolicFru val; }; \
- SymCallout_t symCalloutArray[] = \
- {
+ #define PRDF_SYM_CALLOUT_MAP_BEGIN
#define PRDF_SYM_CALLOUT_ALIAS(name1, name2) \
- { #name1 , name1 },
+ g_ActionArgMap[ #name1 ] = name2;
+
+ #define PRDF_SYM_CALLOUT_MAP_END
- #define PRDF_SYM_CALLOUT_MAP_END \
- { NULL , (SymbolicFru) 0 } \
- };
#elif defined PRDF_SIM_ENUMS
- // included from prdfsimEnumMap.C, nothing for now
+ #define PRDF_SYM_CALLOUT_MAP_BEGIN \
+ { \
+ ENUMNAMES * l_calloutEnum = new ENUMNAMES(); \
+ ivEnumTypes["calloutNames"] = l_calloutEnum; \
+ std::string s;
+
+ #define PRDF_SYM_CALLOUT_ALIAS(n1,n2) \
+ s = #n1; ToUpper(s); ivEnumValue[s] = n2; (*l_calloutEnum)[n2] = s;
+
+ #define PRDF_SYM_CALLOUT_MAP_END \
+ }
#else
@@ -98,27 +104,31 @@ PRDF_SYM_CALLOUT_MAP_END
// Used only in the rule compiler. Sets up a map between string keywords in
// the rule code to the enum name.
- #define PRDF_CALLOUT_PRIORITY_MAP_BEGIN \
- struct CalloutPriority_t \
- { const char * str; CalloutPriorityEnum val; }; \
- CalloutPriority_t calloutPriorityArray[] = \
- {
+ #define PRDF_CALLOUT_PRIORITY_MAP_BEGIN
#define PRDF_CALLOUT_PRIORITY_ALIAS(name1, name2) \
- { #name1 , name1 },
+ g_ActionArgMap[ #name1 ] = name2;
- #define PRDF_CALLOUT_PRIORITY_MAP_END \
- { NULL , (CalloutPriorityEnum) 0 } \
- };
+ #define PRDF_CALLOUT_PRIORITY_MAP_END
#elif defined PRDF_SIM_ENUMS
- // included from prdfsimEnumMap.C, nothing for now
+ #define PRDF_CALLOUT_PRIORITY_MAP_BEGIN \
+ { \
+ ENUMNAMES * l_priorityEnum = new ENUMNAMES(); \
+ ivEnumTypes["priorityNames"] = l_priorityEnum; \
+ std::string s;
+
+ #define PRDF_CALLOUT_PRIORITY_ALIAS(n1,n2) \
+ s = #n1; ToUpper(s); ivEnumValue[s] = n2; (*l_priorityEnum)[n2] = s;
+
+ #define PRDF_CALLOUT_PRIORITY_MAP_END \
+ }
#else
#define PRDF_CALLOUT_PRIORITY_MAP_BEGIN \
- enum CalloutPriorityEnum \
+ enum PRDpriority \
{
#define PRDF_CALLOUT_PRIORITY_ALIAS(n1,n2) \
@@ -146,7 +156,51 @@ PRDF_CALLOUT_PRIORITY_MAP_END
//------------------------------------------------------------------------------
-#ifndef PRDF_SIM_ENUMS
+#ifdef PRDF_RULE_COMPILER_ENUMS
+
+ #define PRDF_TARGET_TYPE_ALIAS(n1, n2) \
+ g_ActionArgMap[ #n1 ] = n2;
+
+#elif defined PRDF_SIM_ENUMS
+
+ #define PRDF_TARGET_TYPE_ALIAS(n1, n2) \
+ ivEnumValue[ #n1 ] = n2;
+
+#else
+
+ #define PRDF_TARGET_TYPE_ALIAS(n1, n2)
+
+#endif
+
+PRDF_TARGET_TYPE_ALIAS( TYPE_SYS, TARGETING::TYPE_SYS )
+PRDF_TARGET_TYPE_ALIAS( TYPE_NODE, TARGETING::TYPE_NODE )
+PRDF_TARGET_TYPE_ALIAS( TYPE_PROC, TARGETING::TYPE_PROC )
+PRDF_TARGET_TYPE_ALIAS( TYPE_EQ, TARGETING::TYPE_EQ )
+PRDF_TARGET_TYPE_ALIAS( TYPE_EX, TARGETING::TYPE_EX )
+PRDF_TARGET_TYPE_ALIAS( TYPE_CORE, TARGETING::TYPE_CORE )
+PRDF_TARGET_TYPE_ALIAS( TYPE_CAPP, TARGETING::TYPE_CAPP )
+PRDF_TARGET_TYPE_ALIAS( TYPE_PEC, TARGETING::TYPE_PEC )
+PRDF_TARGET_TYPE_ALIAS( TYPE_PHB, TARGETING::TYPE_PHB )
+PRDF_TARGET_TYPE_ALIAS( TYPE_OBUS, TARGETING::TYPE_OBUS )
+PRDF_TARGET_TYPE_ALIAS( TYPE_XBUS, TARGETING::TYPE_XBUS )
+PRDF_TARGET_TYPE_ALIAS( TYPE_NX, TARGETING::TYPE_NX )
+PRDF_TARGET_TYPE_ALIAS( TYPE_OCC, TARGETING::TYPE_OCC )
+PRDF_TARGET_TYPE_ALIAS( TYPE_PSI, TARGETING::TYPE_PSI )
+PRDF_TARGET_TYPE_ALIAS( TYPE_MCBIST, TARGETING::TYPE_MCBIST )
+PRDF_TARGET_TYPE_ALIAS( TYPE_MCS, TARGETING::TYPE_MCS )
+PRDF_TARGET_TYPE_ALIAS( TYPE_MCA, TARGETING::TYPE_MCA )
+PRDF_TARGET_TYPE_ALIAS( TYPE_MEMBUF, TARGETING::TYPE_MEMBUF )
+PRDF_TARGET_TYPE_ALIAS( TYPE_L4, TARGETING::TYPE_L4 )
+PRDF_TARGET_TYPE_ALIAS( TYPE_MBA, TARGETING::TYPE_MBA )
+PRDF_TARGET_TYPE_ALIAS( TYPE_DIMM, TARGETING::TYPE_DIMM )
+PRDF_TARGET_TYPE_ALIAS( TYPE_OSCREFCLK, TARGETING::TYPE_OSCREFCLK )
+PRDF_TARGET_TYPE_ALIAS( TYPE_NA, TARGETING::TYPE_NA )
+
+#undef PRDF_TARGET_TYPE_ALIAS
+
+//------------------------------------------------------------------------------
+
+#if !defined(PRDF_RULE_COMPILER_ENUMS) && !defined(PRDF_SIM_ENUMS)
} // end namespace PRDF
#endif
diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfCallouts.H b/src/usr/diag/prdf/common/framework/resolution/prdfCallouts.H
index eaff2c842..1ee3a2d32 100755
--- a/src/usr/diag/prdf/common/framework/resolution/prdfCallouts.H
+++ b/src/usr/diag/prdf/common/framework/resolution/prdfCallouts.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -30,7 +30,7 @@
// Includes
//------------------------------------------------------------------------------
-#include <prdfCalloutMap.H>
+#include <prdfCalloutMap.H> // for enums
#include <prdfCalloutsData.H>
#include <prdfEnums.H>
#include <prdfMemoryMru.H>
@@ -41,8 +41,6 @@ namespace PRDF
//------------------------------------------------------------------------------
-typedef CalloutPriorityEnum PRDpriority;
-
/**
* @brief Wrapper class for PRD callouts (TargetHandle_t, MemoryMru, and
* SymbolicFru).
diff --git a/src/usr/diag/prdf/common/rule/prdfRuleMetaData.C b/src/usr/diag/prdf/common/rule/prdfRuleMetaData.C
index 7b3c6e51f..1909ba739 100644
--- a/src/usr/diag/prdf/common/rule/prdfRuleMetaData.C
+++ b/src/usr/diag/prdf/common/rule/prdfRuleMetaData.C
@@ -941,42 +941,42 @@ Resolution * RuleMetaData::createResolution( Prdr::Expr * i_action,
{
case Prdr::CALLOUT_GARD_CHIP: // connected callout with gard
l_rc = &i_data.cv_reslFactory.getConnCalloutGardResol(
- (TARGETING::TYPE) i_action->cv_value[2].i,
- i_action->cv_value[3].i,
- (CalloutPriorityEnum) i_action->cv_value[1].i,
+ (TARGETING::TYPE) i_action->cv_value[2].i,
+ i_action->cv_value[3].i,
+ (PRDpriority) i_action->cv_value[1].i,
( NULL == i_action->cv_value[4].p ? NULL :
( this->createResolution(
i_action->cv_value[4].p, i_data ) ) ),
- TARGETING::TYPE_NA,
- (GARD_POLICY) i_action->cv_value[6].i );
+ TARGETING::TYPE_NA,
+ (GARD_POLICY) i_action->cv_value[6].i );
break;
// connected callout and gard with connection type
case Prdr::CALLOUT_GARD_PEER:
l_rc = &i_data.cv_reslFactory.getConnCalloutGardResol(
- (TARGETING::TYPE) i_action->cv_value[2].i,
- i_action->cv_value[3].i,
- (CalloutPriorityEnum) i_action->cv_value[1].i,
+ (TARGETING::TYPE) i_action->cv_value[2].i,
+ i_action->cv_value[3].i,
+ (PRDpriority) i_action->cv_value[1].i,
( NULL == i_action->cv_value[4].p ? NULL :
( this->createResolution(
i_action->cv_value[4].p, i_data ) ) ),
- (TARGETING::TYPE) i_action->cv_value[5].i,
- (GARD_POLICY) i_action->cv_value[6].i );
+ (TARGETING::TYPE) i_action->cv_value[5].i,
+ (GARD_POLICY) i_action->cv_value[6].i );
break;
case Prdr::CALLOUT_PROC: // Procedure callout
l_rc = &i_data.cv_reslFactory.getCalloutGardResol(
(SymbolicFru) i_action->cv_value[2].i,
- (CalloutPriorityEnum) i_action->cv_value[1].i,
+ (PRDpriority) i_action->cv_value[1].i,
(GARD_POLICY) i_action->cv_value[6].i );
break;
case Prdr::CALLOUT_GARD_SELF: // self callout with gard option
default:
l_rc = &i_data.cv_reslFactory.getCalloutGardResol(
- NULL ,
- (CalloutPriorityEnum) i_action->cv_value[1].i,
+ NULL,
+ (PRDpriority) i_action->cv_value[1].i,
(GARD_POLICY) i_action->cv_value[6].i );
break;
diff --git a/src/usr/diag/prdf/common/rule/prdrCompile.C b/src/usr/diag/prdf/common/rule/prdrCompile.C
index 77ed17d70..23d4dda83 100644
--- a/src/usr/diag/prdf/common/rule/prdrCompile.C
+++ b/src/usr/diag/prdf/common/rule/prdrCompile.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -39,7 +39,7 @@
#include <prdrCommon.H>
#include <prdrToken.H>
#include <UtilHash.H>
-#include <prdfEnums.H>
+#include <prdfCalloutMap.H> // for enums
using namespace PRDR_COMPILER;
@@ -404,12 +404,6 @@ uint32_t prdrCaptureTypeMap(const std::string & i_arg)
} // end namespace PRDR_COMPILER
-#include <prdfCalloutMap.H> // for enums
-#undef __prdfCalloutMap_H
-#define PRDF_RULE_COMPILER_ENUMS
-#include <prdfCalloutMap.H> // for string-to-enum arrays
-#undef PRDF_RULE_COMPILER_ENUMS
-
namespace PRDR_COMPILER
{
@@ -427,36 +421,11 @@ uint32_t prdrActionArgMap(const std::string & i_arg)
if (l_initialized)
break;
- // Initialize Callout priorities.
- for (CalloutPriority_t * i = calloutPriorityArray; NULL != i->str; i++)
- {
- g_ActionArgMap[i->str] = i->val;
- }
-
- // Initialize target types.
- g_ActionArgMap["TYPE_PROC"] = TARGETING::TYPE_PROC;
- g_ActionArgMap["TYPE_EQ"] = TARGETING::TYPE_EQ;
- g_ActionArgMap["TYPE_EX"] = TARGETING::TYPE_EX;
- g_ActionArgMap["TYPE_CORE"] = TARGETING::TYPE_CORE;
- g_ActionArgMap["TYPE_CAPP"] = TARGETING::TYPE_CAPP;
- g_ActionArgMap["TYPE_PEC"] = TARGETING::TYPE_PEC;
- g_ActionArgMap["TYPE_PHB"] = TARGETING::TYPE_PHB;
- g_ActionArgMap["TYPE_OBUS"] = TARGETING::TYPE_OBUS;
- g_ActionArgMap["TYPE_XBUS"] = TARGETING::TYPE_XBUS;
- g_ActionArgMap["TYPE_MCBIST"] = TARGETING::TYPE_MCBIST;
- g_ActionArgMap["TYPE_MCS"] = TARGETING::TYPE_MCS;
- g_ActionArgMap["TYPE_MCA"] = TARGETING::TYPE_MCA;
- g_ActionArgMap["TYPE_MEMBUF"] = TARGETING::TYPE_MEMBUF;
- g_ActionArgMap["TYPE_L4"] = TARGETING::TYPE_L4;
- g_ActionArgMap["TYPE_MBA"] = TARGETING::TYPE_MBA;
- g_ActionArgMap["TYPE_DIMM"] = TARGETING::TYPE_DIMM;
- g_ActionArgMap["TYPE_NA"] = TARGETING::TYPE_NA;
-
- // Initialize symbolic callouts.
- for ( SymCallout_t * i = symCalloutArray; NULL != i->str; i++ )
- {
- g_ActionArgMap[i->str] = i->val;
- }
+ // Include procedure callouts, callout priorities, and target types.
+ #define PRDF_RULE_COMPILER_ENUMS
+ #undef __prdfCalloutMap_H
+ #include <prdfCalloutMap.H> // for string-to-enum map
+ #undef PRDF_RULE_COMPILER_ENUMS
// Initialize SDC Flags.
// FIXME: RTC 119976
OpenPOWER on IntegriCloud