diff options
author | Sachin Gupta <sgupta2m@in.ibm.com> | 2014-12-07 22:27:30 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-02-27 23:51:19 -0600 |
commit | 64b4d0061a5d02c5664ee30401208b5a76d4030f (patch) | |
tree | e183326294ea832a72d7378f91b144812ca215b0 /src/usr/diag/prdf/framework | |
parent | b6ec5b042850fd80517dfdbb1226624b98cf617d (diff) | |
download | talos-hostboot-64b4d0061a5d02c5664ee30401208b5a76d4030f.tar.gz talos-hostboot-64b4d0061a5d02c5664ee30401208b5a76d4030f.zip |
ATTN PRD : Wrapper Functions for checkstop analysis.
Change-Id: I5a16cf0be729405df5bfbbaf727ce5b1dec81983
RTC: 119543
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14768
Tested-by: Jenkins Server
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Prem Shanker Jha <premjha2@in.ibm.com>
Reviewed-by: Christopher T. Phan <cphan@us.ibm.com>
Reviewed-by: Bilicon Patil <bilpatil@in.ibm.com>
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf/framework')
-rwxr-xr-x | src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.C | 68 | ||||
-rwxr-xr-x | src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.H | 79 |
2 files changed, 147 insertions, 0 deletions
diff --git a/src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.C b/src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.C new file mode 100755 index 000000000..18037d157 --- /dev/null +++ b/src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.C @@ -0,0 +1,68 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014,2015 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#include "prdfFileRegisterAccess.H" +#include <prdfTrace.H> +#include <prdfPnorFirDataReader.H> +#include <prdfBitString.H> + +using namespace TARGETING; + +namespace PRDF +{ + +errlHndl_t FileScomAccessor::Access( + TargetHandle_t i_target, + BIT_STRING_CLASS & bs, + uint64_t registerId, + MopRegisterAccess::Operation operation) const +{ + #define PRDF_FUNC "[FileScomAccessor::Access()] " + + errlHndl_t errlH = NULL; + + PnorFirDataReader & firData = PnorFirDataReader::getPnorFirDataReader(); + uint64_t data = 0; + + switch (operation) + { + case MopRegisterAccess::WRITE: + data = bs.GetFieldJustify(0, 64); + firData.putScom( i_target, registerId, data); + break; + case MopRegisterAccess::READ: + firData.getScom( i_target, registerId, data); + bs.SetFieldJustify( 0, 64, data); + break; + default: + PRDF_ERR(PRDF_FUNC"Wrong Operation:%u", operation); + } + + return errlH; + + #undef PRDF_FUNC +} + +} // End namespace PRDF diff --git a/src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.H b/src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.H new file mode 100755 index 000000000..b70c33959 --- /dev/null +++ b/src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.H @@ -0,0 +1,79 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/framework/register/prdfFileRegisterAccess.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014,2015 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef PRDFFILEREGISTERACCESS_H +#define PRDFFILEREGISTERACCESS_H +/** + * @file prdfFileRegisterAccess.H + * @brief Provide access to scom registers via the File +*/ + + +//-------------------------------------------------------------------- +// Includes +//-------------------------------------------------------------------- + +#include <prdfHomRegisterAccess.H> + + +//-------------------------------------------------------------------- +// Forward References +//-------------------------------------------------------------------- + +namespace PRDF +{ + +class FileScomAccessor : public ScomAccessor +{ + public: + + /** + * @brief ctor + */ + FileScomAccessor() {}; + + /** + * @brief dtor + */ + virtual ~FileScomAccessor() {}; + + /** + * Access the scom register using file. + * @param i_target Target to access the register + * @param BIT_STRING_CLASS - holds data read or to write + * @param register address + * @param [READ|WRITE] + * @returns NULL if success, valid error handle otherwise + * @pre bs.Length() must be size of register data to read/write + */ + virtual errlHndl_t Access(TARGETING::TargetHandle_t i_target, + BIT_STRING_CLASS & bs, + uint64_t registerId, + MopRegisterAccess::Operation operation) const; +}; + +} // End namespace PRDF + +#endif /* PRDFFILEREGISTERACCESS_H */ |