From 591bf9abfe58c662a8e81820fdc96b90b85a9b55 Mon Sep 17 00:00:00 2001 From: Mark Wenning Date: Thu, 22 Sep 2011 17:42:01 -0500 Subject: RTC3872: Hardware Availability Service: Add HWAS as first ISTEP - first commit - change isteplist to call hwas - comment out test isteps - modify xml to add HWAS_STATE attribute - add macros to taskargs - remove debug trace from taskargs - add call to init_fsi - post-review - merge xml files - forgot one printkd Change-Id: Iab3b1f85c401f9a176ed84ddb91263caf25a3d56 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/430 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/usr/hwas/hwas.C | 141 ++++++++++++++++++++++++++++++++++++++++++ src/usr/hwas/makefile | 30 +++++++++ src/usr/hwas/test/hwas1test.H | 138 +++++++++++++++++++++++++++++++++++++++++ src/usr/hwas/test/makefile | 38 ++++++++++++ 4 files changed, 347 insertions(+) create mode 100644 src/usr/hwas/hwas.C create mode 100644 src/usr/hwas/makefile create mode 100644 src/usr/hwas/test/hwas1test.H create mode 100644 src/usr/hwas/test/makefile (limited to 'src/usr/hwas') diff --git a/src/usr/hwas/hwas.C b/src/usr/hwas/hwas.C new file mode 100644 index 000000000..c7872d033 --- /dev/null +++ b/src/usr/hwas/hwas.C @@ -0,0 +1,141 @@ +// 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 + +/** + * @file hwas.C + * + * HardWare Availability Service functions. + * See hwas.H for doxygen documentation tags. + * + */ + + +/******************************************************************************/ +// Includes +/******************************************************************************/ +#include + +#include +#include +#include +#include +#include // targeting + +#include +#include + + +namespace HWAS +{ + trace_desc_t *g_trac_hwas = NULL; + TRAC_INIT(&g_trac_hwas, "HWAS", 1024 ); // yah. + + using namespace TARGETING; // + + void init_target_states( void *io_pArgs ) + { + TASKARGS_INIT_TASKARGS( io_pArgs ); + + TRACDCOMP( g_trac_hwas, "init_target_states entry" ); + // printkd("init_target_states\n"); + + + TASKARGS_WAIT_AND_ENDTASK(); + } + + void init_fsi( void *io_pArgs ) + { + errlHndl_t l_errl = NULL; + TASKARGS_INIT_TASKARGS( io_pArgs ); + + TRACDCOMP( g_trac_hwas, "init_fsi entry" ); + // printkd("init_fsi\n"); + + l_errl = FSI::initializeHardware( ); + if ( l_errl ) + { + TRACFCOMP( g_trac_hwas, "ERROR: failed to init FSI hardware" ); + POST_ERROR_LOG( l_errl ); + } + + TASKARGS_WAIT_AND_ENDTASK(); + } + + void apply_fsi_info( void *io_pArgs ) + { + TASKARGS_INIT_TASKARGS( io_pArgs ); + + TRACDCOMP( g_trac_hwas, "apply_fsi_info entry" ); + //printkd("apply_fsi_info\n"); + + + TASKARGS_WAIT_AND_ENDTASK(); + } + + void apply_dd_presence( void *io_pArgs ) + { + TASKARGS_INIT_TASKARGS( io_pArgs ); + + TRACDCOMP( g_trac_hwas, "apply_dd_presence entry" ); + //printkd("apply_dd_presence\n"); + + + TASKARGS_WAIT_AND_ENDTASK(); + } + + void apply_pr_keyword_data( void *io_pArgs ) + { + TASKARGS_INIT_TASKARGS( io_pArgs ); + + TRACDCOMP( g_trac_hwas, "apply_pr_keyword_data" ); + //printkd("apply_pr_keyword_data\n"); + + + TASKARGS_WAIT_AND_ENDTASK(); + } + + void apply_partial_bad( void *io_pArgs ) + { + TASKARGS_INIT_TASKARGS( io_pArgs ); + + TRACDCOMP( g_trac_hwas, "apply_partial_bad entry" ); + //printkd("apply_partial_bad\n"); + + + TASKARGS_WAIT_AND_ENDTASK(); + } + + void apply_gard( void *io_pArgs ) + { + TASKARGS_INIT_TASKARGS( io_pArgs ); + + TRACDCOMP( g_trac_hwas, "apply_gard entry" ); + //printkd("apply_gard\n"); + + + TASKARGS_WAIT_AND_ENDTASK(); + } + + +}; // end namespace + diff --git a/src/usr/hwas/makefile b/src/usr/hwas/makefile new file mode 100644 index 000000000..c4a596500 --- /dev/null +++ b/src/usr/hwas/makefile @@ -0,0 +1,30 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/hwas/makefile $ +# +# 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 +ROOTPATH = ../../.. +MODULE = hwas + +OBJS = hwas.o + +SUBDIRS=test.d + +include ${ROOTPATH}/config.mk diff --git a/src/usr/hwas/test/hwas1test.H b/src/usr/hwas/test/hwas1test.H new file mode 100644 index 000000000..2ee648158 --- /dev/null +++ b/src/usr/hwas/test/hwas1test.H @@ -0,0 +1,138 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/targeting/test/targetingtest.H $ +// +// 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 +#ifndef __TESTTARGETING_H +#define __TESTTARGETING_H + +/** + * @file testtargeting.H + * + * @brief Unit tests for HWAS (ISTEP 4) + */ + +//****************************************************************************** +// Includes +//****************************************************************************** + +// STD +#include +#include + +// CXXTEST +#include +#include +#include +#include +#include +#include + +// This component +#include +#include +#include +#include +#include +#include +#include + +class HWAS1test: public CxxTest::TestSuite +{ +public: + + /** + * @brief Walk all the targets and verify that HWAS_STATE is set + * correctly. + * + * @note Results of this test will change as more stuff gets added to + * HWAS - how to fix? + */ + void testHWASdefaultPresence() + { + + nanosleep(1,0); + TS_TRACE(ENTER_MRK "testHWASdefaultPresence" ); + + using namespace TARGETING; + + TargetService& l_targetService = targetService(); + + l_targetService.init(); + + + // get top level + // Post init + // Test: void getTopLevelTarget(Target*& o_targetHandle) const; + + Target* l_pTopLevel = NULL; + (void) l_targetService.getTopLevelTarget(l_pTopLevel); + if (l_pTopLevel == NULL) + { + TS_FAIL("Top level handle was NULL when initialization complete"); + } + + // Post init + // Test: void getAssociated( + // const Target* i_pTarget, + // ASSOCIATION_TYPE i_type, + // RECURSION_LEVEL i_recursionLevel, + // TargetHandleList& o_list) const; + + TargetHandleList l_list; + (void) l_targetService.getAssociated( + l_list, + l_pTopLevel, + TARGETING::TargetService::CHILD, + TARGETING::TargetService::ALL); + + TS_TRACE("Child list size is 0x%x", l_list.size() ); + for (uint64_t i=0; igetAttr().poweredOn) + || ( l_list[i]->getAttr().present) + || ( l_list[i]->getAttr().functional) + || ( l_list[i]->getAttr().changedSinceLastIPL) + || ( l_list[i]->getAttr().gardLevel) + ) + { + l_list[i]->getAttr().dump(); + TS_TRACE( " poweredOn = 0x%x", + l_list[i]->getAttr().poweredOn ); + TS_TRACE( " present = 0x%x", + l_list[i]->getAttr().present ); + TS_TRACE( " l_functional = 0x%x", + l_list[i]->getAttr().functional ); + TS_TRACE( " l_changedSinceLastIPL = 0x%x", + l_list[i]->getAttr().changedSinceLastIPL ); + TS_TRACE( " l_gardLevel = 0x%x", + l_list[i]->getAttr().gardLevel ); + + TS_FAIL( "Attribute fields not correct: "); + } + } + + TS_TRACE(EXIT_MRK "testHWASdefaultPresence" ); + } + +}; + +#endif // diff --git a/src/usr/hwas/test/makefile b/src/usr/hwas/test/makefile new file mode 100644 index 000000000..6cc573dbe --- /dev/null +++ b/src/usr/hwas/test/makefile @@ -0,0 +1,38 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/targeting/test/makefile $ +# +# 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 +ROOTPATH = ../../../.. + +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer + +MODULE = testhwas +TESTS = *.H + +OBJS = attributestrings.o + +include ${ROOTPATH}/config.mk + +vpath %.C ${GENDIR} + -- cgit v1.2.1