From 42e4c422f63b24bc73d2ce3a0e9b086ccee75aee Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Mon, 26 Mar 2018 14:06:48 -0500 Subject: PRD: moved prdfCenMbaDataBundle.H to common code In preparation of additional changes. Change-Id: I02ea8a40e602c974fc986deade7ca94ae5110d15 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56262 Tested-by: Jenkins Server Reviewed-by: Benjamin J. Weisenbeck Reviewed-by: Caleb N. Palmer Reviewed-by: Brian J. Stegmiller Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56410 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins --- .../prdf/common/plat/mem/prdfCenMbaDataBundle.H | 110 +++++++++++++++++++++ src/usr/diag/prdf/plat/mem/prdfCenMbaDataBundle.H | 95 ------------------ 2 files changed, 110 insertions(+), 95 deletions(-) create mode 100644 src/usr/diag/prdf/common/plat/mem/prdfCenMbaDataBundle.H delete mode 100644 src/usr/diag/prdf/plat/mem/prdfCenMbaDataBundle.H (limited to 'src') diff --git a/src/usr/diag/prdf/common/plat/mem/prdfCenMbaDataBundle.H b/src/usr/diag/prdf/common/plat/mem/prdfCenMbaDataBundle.H new file mode 100644 index 000000000..85ef296ed --- /dev/null +++ b/src/usr/diag/prdf/common/plat/mem/prdfCenMbaDataBundle.H @@ -0,0 +1,110 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/mem/prdfCenMbaDataBundle.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2017,2018 */ +/* [+] 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 __prdfCenMbaDataBundle_H +#define __prdfCenMbaDataBundle_H + +// Framework includes +#include + +// Platform includes +#include + +#ifdef __HOSTBOOT_MODULE + + #include + +#endif + +namespace PRDF +{ + +/** @brief Centaur MBA data bundle. */ +class MbaDataBundle : public DataBundle +{ + public: // functions + + /** + * @brief Constructor. + * @param i_chip The MBA chip. + */ + explicit MbaDataBundle( ExtensibleChip * i_chip ) : + iv_chip(i_chip) + {} + + /** @brief Destructor. */ + ~MbaDataBundle() + { + #ifdef __HOSTBOOT_MODULE + delete iv_tdCtlr; iv_tdCtlr = nullptr; + #endif + } + + // Don't allow copy or assignment. + MbaDataBundle( const MbaDataBundle & ) = delete; + const MbaDataBundle & operator=( const MbaDataBundle & ) = delete; + + #ifdef __HOSTBOOT_MODULE + + /** @return The Targeted Diagnostics controller. */ + MemTdCtlr * getTdCtlr() + { + if ( nullptr == iv_tdCtlr ) + { + iv_tdCtlr = new MemTdCtlr{iv_chip}; + } + + return iv_tdCtlr; + } + + #endif + + private: // instance variables + + /** The MBA chip associated with this data bundle. */ + ExtensibleChip * const iv_chip; + + #ifdef __HOSTBOOT_MODULE + + /** The Targeted Diagnostics controller. */ + MemTdCtlr * iv_tdCtlr = nullptr; + + #endif +}; + +/** + * @brief Wrapper function for the MbaDataBundle. + * @param i_mbaChip The MBA chip. + * @return This MBA's data bundle. + */ +inline MbaDataBundle * getMbaDataBundle( ExtensibleChip * i_mbaChip ) +{ + return static_cast(i_mbaChip->getDataBundle()); +} + +} // end namespace PRDF + +#endif // __prdfCenMbaDataBundle_H + diff --git a/src/usr/diag/prdf/plat/mem/prdfCenMbaDataBundle.H b/src/usr/diag/prdf/plat/mem/prdfCenMbaDataBundle.H deleted file mode 100644 index e2a03e85a..000000000 --- a/src/usr/diag/prdf/plat/mem/prdfCenMbaDataBundle.H +++ /dev/null @@ -1,95 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/diag/prdf/plat/mem/prdfCenMbaDataBundle.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2017 */ -/* [+] 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 __prdfCenMbaDataBundle_H -#define __prdfCenMbaDataBundle_H - -// Framework includes -#include - -// Platform includes -#include -#include - -namespace PRDF -{ - -/** @brief Centaur MBA data bundle. */ -class MbaDataBundle : public DataBundle -{ - public: // functions - - /** - * @brief Constructor. - * @param i_mbaChip The MBA chip. - */ - explicit MbaDataBundle( ExtensibleChip * i_mbaChip ) : - iv_chip(i_mbaChip) - {} - - /** @brief Destructor. */ - ~MbaDataBundle() - { - delete iv_tdCtlr; iv_tdCtlr = nullptr; - } - - // Don't allow copy or assignment. - MbaDataBundle( const MbaDataBundle & ) = delete; - const MbaDataBundle & operator=( const MbaDataBundle & ) = delete; - - /** @return The Targeted Diagnostics controller. */ - MemTdCtlr * getTdCtlr() - { - if ( nullptr == iv_tdCtlr ) - { - iv_tdCtlr = new MemTdCtlr{iv_chip}; - } - - return iv_tdCtlr; - } - - private: // instance variables - - /** The MBA chip associated with this data bundle. */ - ExtensibleChip * const iv_chip; - - /** The Targeted Diagnostics controller. */ - MemTdCtlr * iv_tdCtlr = nullptr; -}; - -/** - * @brief Wrapper function for the MbaDataBundle. - * @param i_mbaChip The MBA chip. - * @return This MBA's data bundle. - */ -inline MbaDataBundle * getMbaDataBundle( ExtensibleChip * i_mbaChip ) -{ - return static_cast(i_mbaChip->getDataBundle()); -} - -} // end namespace PRDF - -#endif // __prdfCenMbaDataBundle_H - -- cgit v1.2.1