summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2013-09-17 16:05:23 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-10-17 11:18:29 -0500
commit63245d62a4ffe99ad2eaf6b4f1a88862065ceedf (patch)
tree96d359d201573efda392b6ed89287c458cd34acc
parentd3c269a1dcc30483654ae1f3ec37e842880c7db4 (diff)
downloadtalos-hostboot-63245d62a4ffe99ad2eaf6b4f1a88862065ceedf.tar.gz
talos-hostboot-63245d62a4ffe99ad2eaf6b4f1a88862065ceedf.zip
Port Targeting to Hostboot Runtime.
Change-Id: I29ce91dce52d1c6ff6df131ae0b94bf3c4ab99f2 RTC: 79408 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6262 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/usr/targeting/attrrp.H9
-rw-r--r--src/include/usr/targeting/common/util.H6
-rw-r--r--src/makefile4
-rw-r--r--src/usr/targeting/attrrp.C157
-rw-r--r--src/usr/targeting/attrrp_common.C177
-rw-r--r--src/usr/targeting/common/targetservice.C2
-rw-r--r--src/usr/targeting/hostboot_common.mk33
-rw-r--r--src/usr/targeting/makefile13
-rw-r--r--src/usr/targeting/runtime/attrrp_rt.C37
-rw-r--r--src/usr/targeting/runtime/makefile38
-rw-r--r--src/usr/targeting/runtime/start_rt.C37
-rw-r--r--src/usr/targeting/runtime/test/makefile29
-rw-r--r--src/usr/targeting/runtime/test/testtargeting.H45
-rw-r--r--src/usr/targeting/targplatutil.C2
14 files changed, 425 insertions, 164 deletions
diff --git a/src/include/usr/targeting/attrrp.H b/src/include/usr/targeting/attrrp.H
index f1d8388f3..af27b6359 100644
--- a/src/include/usr/targeting/attrrp.H
+++ b/src/include/usr/targeting/attrrp.H
@@ -133,6 +133,7 @@ class AttrRP
return i_pAddress;
}
+#ifndef __HOSTBOOT_RUNTIME
/**
* @brief Initializes and starts the AttrRP daemon.
*
@@ -146,6 +147,7 @@ class AttrRP
* service.
*/
static void init(errlHndl_t& io_taskRetErrl);
+#endif
protected:
@@ -156,7 +158,11 @@ class AttrRP
* Ensures member variables are initialized to sane values.
*/
AttrRP()
+#ifndef __HOSTBOOT_RUNTIME
: iv_msgQ(NULL), iv_sections(NULL), iv_sectionCount(0)
+#else
+ : iv_sections(NULL), iv_sectionCount(0)
+#endif
{
};
@@ -205,6 +211,7 @@ class AttrRP
private:
+#ifndef __HOSTBOOT_RUNTIME
/**
* @brief Performs the startup of the daemon instance.
*
@@ -272,7 +279,7 @@ class AttrRP
// Message Queue for VMM requests
msg_q_t iv_msgQ;
-
+#endif
// Parsed structures of the attribute sections.
AttrRP_Section* iv_sections;
diff --git a/src/include/usr/targeting/common/util.H b/src/include/usr/targeting/common/util.H
index 301e521d5..34b95784e 100644
--- a/src/include/usr/targeting/common/util.H
+++ b/src/include/usr/targeting/common/util.H
@@ -42,17 +42,21 @@ class Target;
*
* @par Detailed Description:
* If PPC platform (FSP or Hostboot), if 8 byte pointers then it's
- * Hostboot, so don't translate. If 4 byte pointers then it's FSP so
+ * Hostboot, so don't translate. If 4 byte pointers then it's FSP so
* translate. If !PPC (x86 32 or 64 bit), then always translate
*
* @note List of preprocessor macros defined can be determined by calling:
* ppc64-mcp6-gcc -dM -E - < /dev/null
*/
#ifdef __PPC__
+#ifndef __HOSTBOOT_RUNTIME
#define TARG_ADDR_TRANSLATION_REQUIRED (sizeof(void*)==4)
#else
#define TARG_ADDR_TRANSLATION_REQUIRED (1)
#endif
+#else
+#define TARG_ADDR_TRANSLATION_REQUIRED (1)
+#endif
namespace PLAT
{
diff --git a/src/makefile b/src/makefile
index 8067cd4e7..bccb0965c 100644
--- a/src/makefile
+++ b/src/makefile
@@ -71,9 +71,9 @@ TESTCASE_MODULES = cxxtest testtrace testerrl testdevicefw testsyslib \
RUNTIME_OBJECTS = rt_start.o rt_main.o rt_console.o rt_stdlib.o rt_sync.o \
rt_assert.o rt_vfs.o
-RUNTIME_MODULES = trace_rt
+RUNTIME_MODULES = trace_rt targeting_rt
RUNTIME_DATA_MODULES =
-RUNTIME_TESTCASE_MODULES = cxxtest_rt testsyslib_rt
+RUNTIME_TESTCASE_MODULES = cxxtest_rt testsyslib_rt testtargeting_rt
RELOCATABLE_IMAGE_LDFLAGS = -pie --export-dynamic
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C
index eaff4fd2b..de2a6b21f 100644
--- a/src/usr/targeting/attrrp.C
+++ b/src/usr/targeting/attrrp.C
@@ -47,26 +47,10 @@
using namespace INITSERVICE;
using namespace ERRORLOG;
+#include "attrrp_common.C"
+
namespace TARGETING
{
- /** @struct AttrRP_Section
- * @brief Contains parsed information about each attribute section.
- */
- struct AttrRP_Section
- {
- // Section type
- SECTION_TYPE type;
-
- // Desired address in Attribute virtual address space
- uint64_t vmmAddress;
-
- // Location in PNOR virtual address space
- uint64_t pnorAddress;
-
- // Section size
- uint64_t size;
- };
-
void AttrRP::init(errlHndl_t &io_taskRetErrl)
{
// Call startup on singleton instance.
@@ -86,17 +70,6 @@ namespace TARGETING
return NULL;
}
- AttrRP::~AttrRP()
- {
- if (iv_sections)
- {
- delete[] iv_sections;
- }
- msg_q_destroy(iv_msgQ);
-
- TARG_ASSERT(false);
- }
-
void AttrRP::startup(errlHndl_t& io_taskRetErrl)
{
errlHndl_t l_errl = NULL;
@@ -105,7 +78,7 @@ namespace TARGETING
{
// Parse PNOR headers.
l_errl = this->parseAttrSectHeader();
- if (l_errl)
+ if (l_errl)
{
break;
}
@@ -342,7 +315,7 @@ namespace TARGETING
{
iv_sections[i].type = l_section->sectionType;
- // Conversion cast for templated abstract pointer object only
+ // Conversion cast for templated abstract pointer object only
// works when casting to pointer of the templated type. Since
// cache is of a different type, we first cast to extract the
// real pointer, then recast it into the cache
@@ -402,7 +375,7 @@ namespace TARGETING
break;
default:
-
+
/*@
* @errortype
* @moduleid TARG_MOD_ATTRRP
@@ -422,7 +395,7 @@ namespace TARGETING
{
break;
}
-
+
int rc = 0;
msg_q_t l_msgQ = iv_msgQ;
@@ -494,7 +467,7 @@ namespace TARGETING
break;
}
- } // End iteration through each section
+ } // End iteration through each section
if(l_errl)
{
@@ -506,120 +479,4 @@ namespace TARGETING
return l_errl;
}
- bool AttrRP::writeSectionData(
- const std::vector<TARGETING::sectionRefData>& i_pages) const
- {
- TARG_INF(ENTER_MRK "AttrRP::writeSectionData");
-
- uint8_t * l_dataPtr = NULL; // ptr to Attribute virtual address space
- bool l_rc = true; // true if write to section is successful
-
- // for each page
- for (std::vector<TARGETING::sectionRefData>::const_iterator
- pageIter = i_pages.begin();
- (pageIter != i_pages.end()) && (true == l_rc);
- ++pageIter)
- {
- // search for the section we need
- for ( size_t j = 0; j < iv_sectionCount; ++j )
- {
- if ( iv_sections[j].type == (*pageIter).sectionId )
- {
- // found it..
- TARG_DBG( "Writing Attribute Section: ID: %u, "
- "address: 0x%lx size: 0x%lx page: %u",
- iv_sections[j].type,
- iv_sections[j].vmmAddress,
- iv_sections[j].size,
- (*pageIter).pageNumber);
-
- // check that page number is within range
- uint64_t l_pageOffset = (*pageIter).pageNumber * PAGESIZE;
- if ( iv_sections[j].size < (l_pageOffset + PAGESIZE) )
- {
- TARG_ERR("page offset 0x%lx is greater than "
- "size 0x%lx of section %u",
- l_pageOffset,
- iv_sections[j].size,
- iv_sections[j].type);
-
- l_rc = false;
- break;
- }
-
- // adjust the pointer out by page size * page number
- l_dataPtr =
- reinterpret_cast<uint8_t *>
- (iv_sections[j].vmmAddress) + l_pageOffset;
-
- memcpy( l_dataPtr, (*pageIter).dataPtr, PAGESIZE );
- break;
- }
- }
-
- if (false == l_rc)
- {
- break;
- }
- }
-
- TARG_INF( EXIT_MRK "AttrRP::writeSectionData" );
- return l_rc;
- }
-
- void AttrRP::readSectionData(
- std::vector<TARGETING::sectionRefData>& o_pages,
- const TARGETING::SECTION_TYPE i_sectionId,
- const NODE_ID i_nodeId) const
- {
- sectionRefData sectionData;
- uint16_t count = 0;
- uint16_t pages = 0;
-
- // search for the section we need
- for (size_t i = 0; i < iv_sectionCount; ++i )
- {
- if ( iv_sections[i].type == i_sectionId )
- {
- // found it..
- // now figure out how many pages - rounding up to the
- // the next full page and dividing by the page size
- pages = ALIGN_PAGE( iv_sections[i].size )/PAGESIZE;
-
- TRACFCOMP(g_trac_targeting,
- "Reading Attribute Section: ID: %d, \
- address: 0x%lx size: 0x%lx pages: %d",
- iv_sections[i].type,
- iv_sections[i].vmmAddress,
- iv_sections[i].size,
- pages);
-
- // populate and push the structure for each page
- while( count != pages )
- {
- // duplicate the same section id in each structure
- sectionData.sectionId = i_sectionId;
-
- // update the current page number
- sectionData.pageNumber = count;
-
- // addjust the pointer out by page size * count each
- // iteration
- sectionData.dataPtr =
- reinterpret_cast<uint8_t *>
- (iv_sections[i].vmmAddress) + (count * PAGESIZE );
-
- count++;
-
- // pushing the actual structure to the vector
- o_pages.push_back( sectionData );
-
- }
-
- break;
- }
- }
- // $TODO what if we dont find it??
- }
-
};
diff --git a/src/usr/targeting/attrrp_common.C b/src/usr/targeting/attrrp_common.C
new file mode 100644
index 000000000..84f864b10
--- /dev/null
+++ b/src/usr/targeting/attrrp_common.C
@@ -0,0 +1,177 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/targeting/attrrp_common.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 */
+#include <targeting/attrrp.H>
+#include <targeting/common/trace.H>
+#include <util/align.H>
+
+namespace TARGETING
+{
+ /** @struct AttrRP_Section
+ * @brief Contains parsed information about each attribute section.
+ */
+ struct AttrRP_Section
+ {
+ // Section type
+ SECTION_TYPE type;
+
+ // Desired address in Attribute virtual address space
+ uint64_t vmmAddress;
+
+ // Location in PNOR virtual address space
+ uint64_t pnorAddress;
+
+ // Section size
+ uint64_t size;
+ };
+
+ AttrRP::~AttrRP()
+ {
+ if (iv_sections)
+ {
+ delete[] iv_sections;
+ }
+#ifndef __HOSTBOOT_RUNTIME
+ msg_q_destroy(iv_msgQ);
+#endif
+
+ TARG_ASSERT(false);
+ }
+
+ bool AttrRP::writeSectionData(
+ const std::vector<TARGETING::sectionRefData>& i_pages) const
+ {
+ TARG_INF(ENTER_MRK "AttrRP::writeSectionData");
+
+ uint8_t * l_dataPtr = NULL; // ptr to Attribute virtual address space
+ bool l_rc = true; // true if write to section is successful
+
+ // for each page
+ for (std::vector<TARGETING::sectionRefData>::const_iterator
+ pageIter = i_pages.begin();
+ (pageIter != i_pages.end()) && (true == l_rc);
+ ++pageIter)
+ {
+ // search for the section we need
+ for ( size_t j = 0; j < iv_sectionCount; ++j )
+ {
+ if ( iv_sections[j].type == (*pageIter).sectionId )
+ {
+ // found it..
+ TARG_DBG( "Writing Attribute Section: ID: %u, "
+ "address: 0x%lx size: 0x%lx page: %u",
+ iv_sections[j].type,
+ iv_sections[j].vmmAddress,
+ iv_sections[j].size,
+ (*pageIter).pageNumber);
+
+ // check that page number is within range
+ uint64_t l_pageOffset = (*pageIter).pageNumber * PAGESIZE;
+ if ( iv_sections[j].size < (l_pageOffset + PAGESIZE) )
+ {
+ TARG_ERR("page offset 0x%lx is greater than "
+ "size 0x%lx of section %u",
+ l_pageOffset,
+ iv_sections[j].size,
+ iv_sections[j].type);
+
+ l_rc = false;
+ break;
+ }
+
+ // adjust the pointer out by page size * page number
+ l_dataPtr =
+ reinterpret_cast<uint8_t *>
+ (iv_sections[j].vmmAddress) + l_pageOffset;
+
+ memcpy( l_dataPtr, (*pageIter).dataPtr, PAGESIZE );
+ break;
+ }
+ }
+
+ if (false == l_rc)
+ {
+ break;
+ }
+ }
+
+ TARG_INF( EXIT_MRK "AttrRP::writeSectionData" );
+ return l_rc;
+ }
+
+ void AttrRP::readSectionData(
+ std::vector<TARGETING::sectionRefData>& o_pages,
+ const TARGETING::SECTION_TYPE i_sectionId,
+ const NODE_ID i_nodeId) const
+ {
+ sectionRefData sectionData;
+ uint16_t count = 0;
+ uint16_t pages = 0;
+
+ // search for the section we need
+ for (size_t i = 0; i < iv_sectionCount; ++i )
+ {
+ if ( iv_sections[i].type == i_sectionId )
+ {
+ // found it..
+ // now figure out how many pages - rounding up to the
+ // the next full page and dividing by the page size
+ pages = ALIGN_PAGE( iv_sections[i].size )/PAGESIZE;
+
+ TRACFCOMP(g_trac_targeting,
+ "Reading Attribute Section: ID: %d, \
+ address: 0x%lx size: 0x%lx pages: %d",
+ iv_sections[i].type,
+ iv_sections[i].vmmAddress,
+ iv_sections[i].size,
+ pages);
+
+ // populate and push the structure for each page
+ while( count != pages )
+ {
+ // duplicate the same section id in each structure
+ sectionData.sectionId = i_sectionId;
+
+ // update the current page number
+ sectionData.pageNumber = count;
+
+ // addjust the pointer out by page size * count each
+ // iteration
+ sectionData.dataPtr =
+ reinterpret_cast<uint8_t *>
+ (iv_sections[i].vmmAddress) + (count * PAGESIZE );
+
+ count++;
+
+ // pushing the actual structure to the vector
+ o_pages.push_back( sectionData );
+
+ }
+
+ break;
+ }
+ }
+ // $TODO what if we dont find it??
+ }
+
+
+}
diff --git a/src/usr/targeting/common/targetservice.C b/src/usr/targeting/common/targetservice.C
index ffebb5f76..8b699c29a 100644
--- a/src/usr/targeting/common/targetservice.C
+++ b/src/usr/targeting/common/targetservice.C
@@ -616,7 +616,9 @@ void TargetService::masterProcChipTargetHandle(
{
/* Error is already traced w.r.t api called, not repeating here*/
TARG_ERR("Not able to find the Master Proc Chip Target Handle");
+#ifndef __HOSTBOOT_RUNTIME // TODO: RTC 87716
delete pError;
+#endif
pError = NULL;
o_masterProcChipTargetHandle = NULL;
}
diff --git a/src/usr/targeting/hostboot_common.mk b/src/usr/targeting/hostboot_common.mk
new file mode 100644
index 000000000..ab70e57f4
--- /dev/null
+++ b/src/usr/targeting/hostboot_common.mk
@@ -0,0 +1,33 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/targeting/hostboot_common.mk $
+#
+# 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
+
+COMMON_TARGETING_REL_PATH = ${TARGETING_REL_PATH}/common
+COMMON_TARGETING_MAKEFILE = ${COMMON_TARGETING_REL_PATH}/common.mk
+
+include ${COMMON_TARGETING_MAKEFILE}
+
+VPATH += \
+ ${TARGETING_REL_PATH}/adapters \
+ ${COMMON_TARGETING_REL_PATH} \
+ ${addprefix ${COMMON_TARGETING_REL_PATH}/, ${COMMON_TARGETING_SUBDIRS}}
+
diff --git a/src/usr/targeting/makefile b/src/usr/targeting/makefile
index 876c99134..372354842 100644
--- a/src/usr/targeting/makefile
+++ b/src/usr/targeting/makefile
@@ -31,15 +31,8 @@
ROOTPATH = ../../..
MODULE = targeting
-COMMON_TARGETING_REL_PATH = common
-COMMON_TARGETING_MAKEFILE = ${COMMON_TARGETING_REL_PATH}/common.mk
-
-include ${COMMON_TARGETING_MAKEFILE}
-
-VPATH = \
- adapters \
- ${COMMON_TARGETING_REL_PATH} \
- ${addprefix ${COMMON_TARGETING_REL_PATH}/, ${COMMON_TARGETING_SUBDIRS}}
+TARGETING_REL_PATH = .
+include ${TARGETING_REL_PATH}/hostboot_common.mk
ATTR_RP_OBJS = \
attrrp.o \
@@ -68,7 +61,7 @@ HOSTBOOT_SPECIFIC_OBJS = \
OBJS = ${COMMON_TARGETING_OBJS} ${HOSTBOOT_SPECIFIC_OBJS}
-SUBDIRS = test.d xmltohb.d
+SUBDIRS = test.d xmltohb.d runtime.d
include ${ROOTPATH}/config.mk
diff --git a/src/usr/targeting/runtime/attrrp_rt.C b/src/usr/targeting/runtime/attrrp_rt.C
new file mode 100644
index 000000000..4cf168133
--- /dev/null
+++ b/src/usr/targeting/runtime/attrrp_rt.C
@@ -0,0 +1,37 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/targeting/runtime/attrrp_rt.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 */
+#include <targeting/attrrp.H>
+#include <targeting/common/trace.H>
+#include <util/align.H>
+
+#include "../attrrp_common.C"
+
+
+namespace TARGETING
+{
+ void* AttrRP::getBaseAddress(const NODE_ID i_nodeIdUnused)
+ {
+ return reinterpret_cast<void*>(VMM_VADDR_ATTR_RP);
+ }
+
+}
diff --git a/src/usr/targeting/runtime/makefile b/src/usr/targeting/runtime/makefile
new file mode 100644
index 000000000..9efa9547f
--- /dev/null
+++ b/src/usr/targeting/runtime/makefile
@@ -0,0 +1,38 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/targeting/runtime/makefile $
+#
+# 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
+HOSTBOOT_RUNTIME = 1
+ROOTPATH = ../../../..
+MODULE = targeting_rt
+
+SUBDIRS = test.d
+
+TARGETING_REL_PATH = ..
+include ${TARGETING_REL_PATH}/hostboot_common.mk
+vpath %.C ${TARGETING_REL_PATH}
+
+HOSTBOOT_RUNTIME_SPECIFIC_OBJS = attrrp_rt.o start_rt.o targplatutil.o
+
+OBJS = ${COMMON_TARGETING_OBJS} ${HOSTBOOT_RUNTIME_SPECIFIC_OBJS}
+
+include $(ROOTPATH)/config.mk
+vpath %.C ${GENDIR}
diff --git a/src/usr/targeting/runtime/start_rt.C b/src/usr/targeting/runtime/start_rt.C
new file mode 100644
index 000000000..d0cef38a7
--- /dev/null
+++ b/src/usr/targeting/runtime/start_rt.C
@@ -0,0 +1,37 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/targeting/runtime/start_rt.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 */
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/targetservice.H>
+
+namespace TARGETING
+{
+ static void initTargeting() __attribute__((constructor));
+ static void initTargeting()
+ {
+ //@TODO: RTC 87716: Init attr RP.
+ //AttrRP::init();
+
+ TargetService& l_targetService = targetService();
+ (void)l_targetService.init();
+ }
+}
diff --git a/src/usr/targeting/runtime/test/makefile b/src/usr/targeting/runtime/test/makefile
new file mode 100644
index 000000000..7f9a5735e
--- /dev/null
+++ b/src/usr/targeting/runtime/test/makefile
@@ -0,0 +1,29 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/usr/targeting/runtime/test/makefile $
+#
+# 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
+HOSTBOOT_RUNTIME = 1
+ROOTPATH = ../../../../..
+
+MODULE = testtargeting_rt
+TESTS = *.H
+
+include ${ROOTPATH}/config.mk
diff --git a/src/usr/targeting/runtime/test/testtargeting.H b/src/usr/targeting/runtime/test/testtargeting.H
new file mode 100644
index 000000000..d68ade369
--- /dev/null
+++ b/src/usr/targeting/runtime/test/testtargeting.H
@@ -0,0 +1,45 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/targeting/runtime/test/testtargeting.H $ */
+/* */
+/* 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 */
+#include <cxxtest/TestSuite.H>
+#include <targeting/common/commontargeting.H>
+
+class TargetingTestSuite : public CxxTest::TestSuite
+{
+ public:
+ void testTopLevelTarget()
+ {
+ using namespace TARGETING;
+
+ TargetService& l_targetService = targetService();
+
+ TARGETING::Target* l_pTarget = NULL;
+ (void) l_targetService.getTopLevelTarget(l_pTarget);
+ if (l_pTarget == NULL)
+ {
+ TS_FAIL("Top level target handle is NULL");
+ return;
+ }
+
+ (void)l_pTarget->getAttr<ATTR_PHYS_PATH>().dump();
+ }
+};
diff --git a/src/usr/targeting/targplatutil.C b/src/usr/targeting/targplatutil.C
index f913030e2..677da78bb 100644
--- a/src/usr/targeting/targplatutil.C
+++ b/src/usr/targeting/targplatutil.C
@@ -62,6 +62,7 @@ void createTracingError(
const uint32_t i_userData4,
errlHndl_t& io_pError)
{
+#ifndef __HOSTBOOT_RUNTIME // TODO: RTC 87716
errlHndl_t pNewError = new ERRORLOG::ErrlEntry(
ERRORLOG::ERRL_SEV_INFORMATIONAL,
i_modId,
@@ -81,6 +82,7 @@ void createTracingError(
io_pError = pNewError;
pNewError = NULL;
}
+#endif
return;
}
OpenPOWER on IntegriCloud