summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2012-05-30 15:18:33 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-06-11 15:22:24 -0500
commitfffa10e2abde6ee52b9d3dec77ca669867625d87 (patch)
tree433d15df7034cddb0f200e3528129aec67755a51 /src
parent13bb136b9d635d3737ae270d8dc9c0924a5495cf (diff)
downloadtalos-hostboot-fffa10e2abde6ee52b9d3dec77ca669867625d87.tar.gz
talos-hostboot-fffa10e2abde6ee52b9d3dec77ca669867625d87.zip
HWAS code common between hostboot and FSP
Corrections to common and hostboot platform-specific code to make this code work for both hostboot and FSP. In addition, make printing of HUID consistant with other previous changes. Also, added hwas/common files to fsp distribution tools so that they are included in the fsp.tar for common usage. Change-Id: Ia761606ab446dd794bf8e112430cc2e072f46991 RTC: 39793 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1130 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/build/mkrules/dist_targets.mk6
-rwxr-xr-xsrc/build/mkrules/hbfw/fsp/makefile2
-rw-r--r--src/include/usr/hwas/common/hwas.H (renamed from src/include/usr/hwas/hwas.H)2
-rw-r--r--src/include/usr/hwas/common/hwasCommon.H (renamed from src/include/usr/hwas/hwasCommon.H)52
-rw-r--r--src/include/usr/hwas/common/hwasError.H40
-rw-r--r--src/include/usr/hwas/common/hwas_reasoncodes.H (renamed from src/include/usr/hwas/hwas_reasoncodes.H)0
-rw-r--r--src/include/usr/hwas/deconfigGard.H1
-rw-r--r--src/include/usr/hwas/hostbootIstep.H (renamed from src/include/usr/hwas/plat/hostbootIstep.H)45
-rw-r--r--src/include/usr/hwas/hwasError.H39
-rw-r--r--src/include/usr/hwas/hwasPlatAssert.H60
-rw-r--r--src/include/usr/hwas/hwasPlatError.H (renamed from src/include/usr/hwas/plat/error.H)49
-rw-r--r--src/include/usr/hwas/hwasPlatTrace.H (renamed from src/include/usr/hwas/plat/hwasPlatTrace.H)55
-rw-r--r--src/include/usr/isteps/istep06list.H6
-rw-r--r--src/usr/hwas/common/common.mk41
-rw-r--r--src/usr/hwas/common/hwas.C (renamed from src/usr/hwas/hwas.C)77
-rw-r--r--src/usr/hwas/deconfigGard.C4
-rw-r--r--src/usr/hwas/hostbootIstep.C (renamed from src/usr/hwas/plat/hostbootIstep.C)51
-rw-r--r--src/usr/hwas/hwasPlat.C (renamed from src/usr/hwas/plat/hwasPlat.C)64
-rw-r--r--src/usr/hwas/makefile10
-rw-r--r--src/usr/hwas/test/hwasGardTest.H2
-rw-r--r--src/usr/hwas/testHWP.C4
21 files changed, 364 insertions, 246 deletions
diff --git a/src/build/mkrules/dist_targets.mk b/src/build/mkrules/dist_targets.mk
index 441ceb54e..e5089c4a1 100644
--- a/src/build/mkrules/dist_targets.mk
+++ b/src/build/mkrules/dist_targets.mk
@@ -159,7 +159,11 @@ fsp.tar_CONTENTS = \
$(addsuffix :targeting/,\
$(call ROOTPATH_WILDCARD_RECURSIVE,src/usr/targeting/common))\
$(addsuffix :targeting/,\
- $(call ROOTPATH_WILDCARD_RECURSIVE,src/include/usr/targeting/common))
+ $(call ROOTPATH_WILDCARD_RECURSIVE,src/include/usr/targeting/common)) \
+ $(addsuffix :hwas/,\
+ $(call ROOTPATH_WILDCARD_RECURSIVE,src/usr/hwas/common))\
+ $(addsuffix :hwas/,\
+ $(call ROOTPATH_WILDCARD_RECURSIVE,src/include/usr/hwas/common))
#
# Portions of the FSP sandbox which must be rebuilt based on file changes.
diff --git a/src/build/mkrules/hbfw/fsp/makefile b/src/build/mkrules/hbfw/fsp/makefile
index 2bba0d394..e7feea64d 100755
--- a/src/build/mkrules/hbfw/fsp/makefile
+++ b/src/build/mkrules/hbfw/fsp/makefile
@@ -32,7 +32,7 @@
.if(${CONTEXT:R} == "ppc")
-EXPINC_SUBDIRS += targeting
+EXPINC_SUBDIRS += targeting hwas
OBJECTS_SUBDIRS +=
EXPLIB_SUBDIRS +=
EXPSHLIB_SUBDIRS += targeting
diff --git a/src/include/usr/hwas/hwas.H b/src/include/usr/hwas/common/hwas.H
index 8d5c7fbb6..d1f56885e 100644
--- a/src/include/usr/hwas/hwas.H
+++ b/src/include/usr/hwas/common/hwas.H
@@ -39,7 +39,7 @@
// Includes
/******************************************************************************/
#include <stdint.h>
-#include <errl/errlentry.H>
+#include <hwas/common/hwasError.H>
namespace HWAS
{
diff --git a/src/include/usr/hwas/hwasCommon.H b/src/include/usr/hwas/common/hwasCommon.H
index 412fe81ef..00eab2f55 100644
--- a/src/include/usr/hwas/hwasCommon.H
+++ b/src/include/usr/hwas/common/hwasCommon.H
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwas/hwasCommon.H $
-//
-// 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
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/hwas/common/hwasCommon.H $
+ *
+ * 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
+ */
/**
* @file hwasCommon.H
*
@@ -32,7 +33,6 @@
// 'system' headers
#include <stdint.h>
-#include <errl/errlentry.H>
#include <targeting/common/target.H>
#include <targeting/common/targetservice.H>
@@ -41,7 +41,11 @@
// following file needs to do
// #define HWAS_DBG(_fmt_, _args_...)
// #define HWAS_ERR(_fmt_, _args_...)
-#include <hwasPlatTrace.H>
+#include <hwas/hwasPlatTrace.H>
+
+// following file needs to do
+// #define HWAS_ASSERT(_expr_...)
+#include <hwas/hwasPlatAssert.H>
namespace HWAS
{
diff --git a/src/include/usr/hwas/common/hwasError.H b/src/include/usr/hwas/common/hwasError.H
new file mode 100644
index 000000000..d2ced14e0
--- /dev/null
+++ b/src/include/usr/hwas/common/hwasError.H
@@ -0,0 +1,40 @@
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/hwas/common/hwasError.H $
+ *
+ * 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
+ */
+#ifndef __HWAS_ERROR_H
+#define __HWAS_ERROR_H
+
+/**
+* @file hwas/hwasError.H
+*
+* @brief Common header to abstract away error handling differences between
+* platforms
+*/
+
+//******************************************************************************
+// Includes
+//******************************************************************************
+
+#include <hwas/hwasPlatError.H>
+
+#endif // __HWAS_ERROR_H
diff --git a/src/include/usr/hwas/hwas_reasoncodes.H b/src/include/usr/hwas/common/hwas_reasoncodes.H
index a7ad56aae..a7ad56aae 100644
--- a/src/include/usr/hwas/hwas_reasoncodes.H
+++ b/src/include/usr/hwas/common/hwas_reasoncodes.H
diff --git a/src/include/usr/hwas/deconfigGard.H b/src/include/usr/hwas/deconfigGard.H
index c3208e71e..b3045d8b4 100644
--- a/src/include/usr/hwas/deconfigGard.H
+++ b/src/include/usr/hwas/deconfigGard.H
@@ -35,6 +35,7 @@
#include <sys/sync.h>
#include <util/singleton.H>
#include <errl/errlentry.H>
+#include <hwas/common/hwasCommon.H>
#include <targeting/common/attributes.H>
namespace HWAS
diff --git a/src/include/usr/hwas/plat/hostbootIstep.H b/src/include/usr/hwas/hostbootIstep.H
index b0338b543..f770a0bfd 100644
--- a/src/include/usr/hwas/plat/hostbootIstep.H
+++ b/src/include/usr/hwas/hostbootIstep.H
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwas/plat/hostbootIstep.H $
-//
-// 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
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/hwas/hostbootIstep.H $
+ *
+ * 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
+ */
/**
* @file hostbootIstep.H
*
diff --git a/src/include/usr/hwas/hwasError.H b/src/include/usr/hwas/hwasError.H
deleted file mode 100644
index 884575093..000000000
--- a/src/include/usr/hwas/hwasError.H
+++ /dev/null
@@ -1,39 +0,0 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwas/hwasError.H $
-//
-// 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
-#ifndef __HWAS_ERROR_H
-#define __HWAS_ERROR_H
-
-/**
-* @file hwas/hwasError.H
-*
-* @brief Common header to abstract away error handling differences between
-* platforms
-*/
-
-//******************************************************************************
-// Includes
-//******************************************************************************
-
-#include <hwas/plat/error.H>
-
-#endif // __HWAS_ERROR_H
diff --git a/src/include/usr/hwas/hwasPlatAssert.H b/src/include/usr/hwas/hwasPlatAssert.H
new file mode 100644
index 000000000..cc53f2a4d
--- /dev/null
+++ b/src/include/usr/hwas/hwasPlatAssert.H
@@ -0,0 +1,60 @@
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/hwas/hwasPlatAssert.H $
+ *
+ * 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
+ */
+#ifndef __HWAS_PLAT_ASSERT_H
+#define __HWAS_PLAT_ASSERT_H
+
+/**
+ * @file hwas/hwasPlatAssert.H
+ * @brief Forward common hwas assert requests to the platform specific
+ * handlers
+ *
+ * There are two different assert types provided:
+ * Standard assert behavior:
+ * assert(foo)
+ *
+ * Standard assert behavior with a custom trace message:
+ * assert(foo, "This is a trace %d", 1234)
+ */
+
+//******************************************************************************
+// Includes
+//******************************************************************************
+
+#include <assert.h>
+
+/**
+ * @brief Forward common hwas assert requests to platform specific handler
+ *
+ * @par Detailed Description:
+ * Forwards assert request to platform specific assert macro which verifies
+ * condition, calls custom trace if provided, and ultimately calls platform
+ * assert
+ *
+ * @param[in] expr,...
+ * Printf-like expression to act as the assert message
+ */
+#define HWAS_ASSERT(expr,...) \
+ assert(expr,__VA_ARGS__)
+
+#endif // __HWAS_PLAT_ASSERT_H
diff --git a/src/include/usr/hwas/plat/error.H b/src/include/usr/hwas/hwasPlatError.H
index c578f5efa..be382e290 100644
--- a/src/include/usr/hwas/plat/error.H
+++ b/src/include/usr/hwas/hwasPlatError.H
@@ -1,30 +1,31 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwas/plat/error.H $
-//
-// 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
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/hwas/hwasPlatError.H $
+ *
+ * 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
+ */
#ifndef __HWAS_PLAT_ERROR_H
#define __HWAS_PLAT_ERROR_H
/**
-* @file hwas/plat/error.H
+* @file hwas/hwasPlatError.H
*
* @brief Adapts platform neutral error log requests to the platform
*/
@@ -36,7 +37,7 @@
// Include the platform specific errlentry.H file and pick up the platform
// specific errlHndlt_t typedef. This is enough for common code to use pass
// errlHndl_t pointers around and check for NULL
-#include <errl/errlentry.H>
+#include <errl/errlmanager.H>
namespace HWAS
{
diff --git a/src/include/usr/hwas/plat/hwasPlatTrace.H b/src/include/usr/hwas/hwasPlatTrace.H
index a82687c30..fcabb9ba6 100644
--- a/src/include/usr/hwas/plat/hwasPlatTrace.H
+++ b/src/include/usr/hwas/hwasPlatTrace.H
@@ -1,27 +1,28 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwas/plat/hwasPlatTrace.H $
-//
-// 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
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/include/usr/hwas/hwasPlatTrace.H $
+ *
+ * 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
+ */
/**
- * @file hwasPlatTrace.H
+ * @file hwas/hwasPlatTrace.H
*
* @brief Defines platform interfaces and whatnot needed for trace in the
* HWAS common and platform specific functions
@@ -36,8 +37,12 @@
//******************************************************************************
// Trace descriptors that are defined in a C file
//******************************************************************************
-extern trace_desc_t *g_trac_dbg_hwas; // debug - fast
-extern trace_desc_t *g_trac_imp_hwas; // important - slow
+namespace HWAS
+{
+ typedef trace_desc_t* HWAS_TD_t;
+ extern HWAS_TD_t g_trac_dbg_hwas; // debug - fast
+ extern HWAS_TD_t g_trac_imp_hwas; // important - slow
+}
// Debug traces (go into fast trace buffer that can wrap often)
#define HWAS_DBG(_fmt_, _args_...) \
diff --git a/src/include/usr/isteps/istep06list.H b/src/include/usr/isteps/istep06list.H
index 69465b7ab..d736356e9 100644
--- a/src/include/usr/isteps/istep06list.H
+++ b/src/include/usr/isteps/istep06list.H
@@ -5,7 +5,7 @@
*
* IBM CONFIDENTIAL
*
- * COPYRIGHT International Business Machines Corp. 2011 - 2012
+ * COPYRIGHT International Business Machines Corp. 2011-2012
*
* p1
*
@@ -37,8 +37,8 @@
#include <initservice/initsvcstructs.H>
#include <initservice/initsvcreasoncodes.H>
-#include <hwas/hwas.H>
-#include <hwas/plat/hostbootIstep.H>
+#include <hwas/common/hwas.H>
+#include <hwas/hostbootIstep.H>
namespace INITSERVICE
diff --git a/src/usr/hwas/common/common.mk b/src/usr/hwas/common/common.mk
new file mode 100644
index 000000000..bbe51e885
--- /dev/null
+++ b/src/usr/hwas/common/common.mk
@@ -0,0 +1,41 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/hwas/common/common.mk $
+#
+# 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
+################################################################################
+#
+# @file hwas/common.mk
+#
+# @brief Common hwas makefile to be included in
+# hwas/makefile
+#
+################################################################################
+
+HWAS_OBJS = \
+ hwas.o
+
+OTHER_OBJS =
+
+# Common
+COMMON_HWAS_OBJS = \
+ ${HWAS_OBJS} \
+ ${OTHER_OBJS}
+
diff --git a/src/usr/hwas/hwas.C b/src/usr/hwas/common/hwas.C
index 2baf602ec..9080f64c0 100644
--- a/src/usr/hwas/hwas.C
+++ b/src/usr/hwas/common/hwas.C
@@ -1,26 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/hwas/hwas.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// 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
-
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/usr/hwas/common/hwas.C $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2011-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
+ */
/**
* @file hwas.C
*
@@ -34,20 +34,25 @@
// Includes
/******************************************************************************/
#include <stdint.h>
-#include <assert.h>
-#include <initservice/taskargs.H>
#include <targeting/common/commontargeting.H>
-#include <hwas/hwas.H>
-#include <hwas/hwasCommon.H>
-#include <hwas/hwasError.H>
+#include <hwas/common/hwas.H>
+#include <hwas/common/hwasCommon.H>
+#include <hwas/common/hwasError.H>
namespace HWAS
{
using namespace TARGETING;
+using namespace HWAS::COMMON;
+// trace setup; used by HWAS_DBG and HWAS_ERR macros
+HWAS_TD_t g_trac_dbg_hwas = NULL; // debug - fast
+HWAS_TD_t g_trac_imp_hwas = NULL; // important - slow
+
+TRAC_INIT(&g_trac_dbg_hwas, "HWAS", 1024 );
+TRAC_INIT(&g_trac_imp_hwas, "HWAS_I", 1024 );
/**
* @brief simple helper fn to get and set hwas state to poweredOn,
@@ -100,11 +105,11 @@ errlHndl_t discoverTargets()
Target* pSys;
targetService().getTopLevelTarget(pSys);
- assert(pSys, "HWAS discoverTargets: no CLASS_SYS TopLevelTarget found");
+ HWAS_ASSERT(pSys, "HWAS discoverTargets: no CLASS_SYS TopLevelTarget found");
// mark this as present
enableHwasState(pSys, true);
- HWAS_DBG("pSys %x (%p) - marked present",
+ HWAS_DBG("pSys %.8X (%p) - marked present",
pSys->getAttr<ATTR_HUID>(), pSys);
// find CLASS_ENC
@@ -121,7 +126,7 @@ errlHndl_t discoverTargets()
// mark it as present
enableHwasState(pEnc, true);
- HWAS_DBG("pEnc %x (%p) - marked present",
+ HWAS_DBG("pEnc %.8X (%p) - marked present",
pEnc->getAttr<ATTR_HUID>(), pEnc);
} // for pEnc_it
@@ -177,7 +182,7 @@ errlHndl_t discoverTargets()
// errl is now NULL
}
- HWAS_DBG("pTarget %x (%p) - detected present %s functional",
+ HWAS_DBG("pTarget %.8X (%p) - detected present %s functional",
pTarget->getAttr<ATTR_HUID>(), pTarget,
isFunctional ? "and" : "NOT");
@@ -195,7 +200,7 @@ errlHndl_t discoverTargets()
{
TargetHandle_t pDesc = *pDesc_it;
enableHwasState(pDesc, isFunctional);
- HWAS_DBG("pDesc %x (%p) - marked present %s functional",
+ HWAS_DBG("pDesc %.8X (%p) - marked present %s functional",
pDesc->getAttr<ATTR_HUID>(), pDesc,
isFunctional ? "and" : "NOT");
}
@@ -203,13 +208,13 @@ errlHndl_t discoverTargets()
} while (0);
- if (errl != NULL)
+ if (errl == NULL)
{
- HWAS_ERR("discoverTargets returning errl %p", errl);
+ HWAS_INF("discoverTargets exit with no error");
}
else
{
- HWAS_INF("discoverTargets exit with no error");
+ HWAS_ERR("discoverTargets returning errl %p", errl);
}
return errl;
} // discoverTargets
diff --git a/src/usr/hwas/deconfigGard.C b/src/usr/hwas/deconfigGard.C
index 7e3c936ed..28a7b917d 100644
--- a/src/usr/hwas/deconfigGard.C
+++ b/src/usr/hwas/deconfigGard.C
@@ -31,11 +31,10 @@
#include <errl/errlmanager.H>
#include <errl/errludtarget.H>
#include <hwas/deconfigGard.H>
-#include <hwas/hwas_reasoncodes.H>
+#include <hwas/common/hwas_reasoncodes.H>
#include <pnor/pnorif.H>
// Trace definition
-trace_desc_t* g_trac_deconf = NULL;
#define __COMP_TD__ g_trac_deconf
// TODO The DeconfigGard code needs to trace a target. The current recommended
@@ -54,6 +53,7 @@ trace_desc_t* g_trac_deconf = NULL;
namespace HWAS
{
+HWAS_TD_t g_trac_deconf = NULL;
errlHndl_t collectGard()
{
diff --git a/src/usr/hwas/plat/hostbootIstep.C b/src/usr/hwas/hostbootIstep.C
index 292b4ee3c..99b4d9ff2 100644
--- a/src/usr/hwas/plat/hostbootIstep.C
+++ b/src/usr/hwas/hostbootIstep.C
@@ -1,35 +1,36 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/hwas/plat/hostbootIstep.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
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/usr/hwas/hostbootIstep.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
+ */
/**
* @file hostbootIstep.C
*
* @brief hostboot istep-called functions
*/
-#include <hwas/hwas.H>
-#include <hwas/hwasCommon.H>
+#include <hwas/common/hwas.H>
+#include <hwas/common/hwasCommon.H>
-#include <hwas/plat/hostbootIstep.H>
+#include <hwas/hostbootIstep.H>
#include <hwas/deconfigGard.H>
#include <fsi/fsiif.H>
diff --git a/src/usr/hwas/plat/hwasPlat.C b/src/usr/hwas/hwasPlat.C
index c3d315078..c47a134af 100644
--- a/src/usr/hwas/plat/hwasPlat.C
+++ b/src/usr/hwas/hwasPlat.C
@@ -1,45 +1,39 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/hwas/plat/hwasPlat.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
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/usr/hwas/hwasPlat.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
+ */
/**
* @file hwasPlat.C
*
* @brief Platform specifics
*/
-#include <hwas/hwas.H>
-#include <hwas/hwasCommon.H>
-#include <hwas/hwasError.H>
+#include <hwas/common/hwas.H>
+#include <hwas/common/hwasCommon.H>
+#include <hwas/common/hwasError.H>
#include <devicefw/driverif.H>
#include <initservice/taskargs.H>
-// trace setup; used by HWAS_DBG and HWAS_ERR macros
-trace_desc_t *g_trac_dbg_hwas = NULL; // debug - fast
-trace_desc_t *g_trac_imp_hwas = NULL; // important - slow
-
-TRAC_INIT(&g_trac_dbg_hwas, "HWAS", 2048 );
-TRAC_INIT(&g_trac_imp_hwas, "HWAS_I", 2048 );
-
namespace HWAS
{
@@ -73,12 +67,12 @@ errlHndl_t platReadIDEC(const TargetHandle_t &i_target)
((id_ec & 0x000F000000000000ull) >> 44) |
((id_ec & 0x0000F00000000000ull) >> 44));
i_target->setAttr<ATTR_CHIP_ID>(id);
- HWAS_DBG( "i_target %x (%p) - id %x ec %x",
+ HWAS_DBG( "i_target %.8X (%p) - id %x ec %x",
i_target->getAttr<ATTR_HUID>(), i_target, id, ec);
}
else
{ // errl was set - this is an error condition.
- HWAS_ERR( "i_target %x (%p) - failed ID/EC read",
+ HWAS_ERR( "i_target %.8X (%p) - failed ID/EC read",
i_target->getAttr<ATTR_HUID>(), i_target);
}
@@ -106,7 +100,7 @@ errlHndl_t platPresenceDetect(TargetHandleList &io_targets)
errl = deviceRead(pTarget, &present, presentSize,
DEVICE_PRESENT_ADDRESS());
- if (errl != NULL)
+ if (unlikely(errl != NULL))
{ // errl was set - this is an error condition.
HWAS_ERR( "pTarget %.8X (%p) - failed presence detect",
pTarget->getAttr<ATTR_HUID>(), pTarget);
diff --git a/src/usr/hwas/makefile b/src/usr/hwas/makefile
index 1c7223a9e..57958474a 100644
--- a/src/usr/hwas/makefile
+++ b/src/usr/hwas/makefile
@@ -1,11 +1,11 @@
-# IBM_PROLOG_BEGIN_TAG
+# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: src/usr/hwas/makefile $
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011
+# COPYRIGHT International Business Machines Corp. 2011-2012
#
# p1
#
@@ -19,14 +19,14 @@
#
# Origin: 30
#
-# IBM_PROLOG_END
-
+# IBM_PROLOG_END_TAG
ROOTPATH = ../../..
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwas
-EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwas/plat
+EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwas/common
VPATH += ${ROOTPATH}/src/usr/hwas/plat
+VPATH += ${ROOTPATH}/src/usr/hwas/common
MODULE = hwas
diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H
index ad143ff19..9338678e9 100644
--- a/src/usr/hwas/test/hwasGardTest.H
+++ b/src/usr/hwas/test/hwasGardTest.H
@@ -38,7 +38,7 @@
#include <errl/errlmanager.H>
#include <targeting/common/targetservice.H>
#include <hwas/deconfigGard.H>
-#include <hwas/hwas_reasoncodes.H>
+#include <hwas/common/hwas_reasoncodes.H>
class HwasGardTest: public CxxTest::TestSuite
{
diff --git a/src/usr/hwas/testHWP.C b/src/usr/hwas/testHWP.C
index a3895d388..05d928762 100644
--- a/src/usr/hwas/testHWP.C
+++ b/src/usr/hwas/testHWP.C
@@ -62,11 +62,11 @@ using namespace fapi;
/******************************************************************************/
// Globals/Constants
/******************************************************************************/
-extern trace_desc_t *g_trac_imp_hwas;
-
namespace HWAS
{
+extern HWAS_TD_t g_trac_imp_hwas;
+
void testHWP( void * io_pArgs )
{
errlHndl_t l_err = NULL;
OpenPOWER on IntegriCloud