From 19147cdfa872a06ef97b8437e2abc152c581dbb0 Mon Sep 17 00:00:00 2001 From: Brian Horton Date: Tue, 4 Sep 2012 14:13:07 -0500 Subject: remove unneeded mutex lock/unlock on hwas proces callout set/get functions. Change-Id: I9f0907b271f01d1bbbbce7c5492bb34338e2cad9 RTC: 48001 Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES Reviewed-by: A. Patrick Williams III --- src/include/usr/errl/errlmanager.H | 54 ++++++++++++++++----------------- src/usr/errl/errlmanager.C | 62 +++++++++++++++----------------------- 2 files changed, 51 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/include/usr/errl/errlmanager.H b/src/include/usr/errl/errlmanager.H index 3dc21b895..2ac6bd69f 100644 --- a/src/include/usr/errl/errlmanager.H +++ b/src/include/usr/errl/errlmanager.H @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/include/usr/errl/errlmanager.H $ - * - * 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 - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/errl/errlmanager.H $ */ +/* */ +/* 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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #ifndef ERRLMANAGER_H #define ERRLMANAGER_H /** @@ -135,7 +134,10 @@ public: * * @return HWAS::processCalloutFn function pointer */ - HWAS::processCalloutFn getHwasProcessCalloutFn() const; + HWAS::processCalloutFn getHwasProcessCalloutFn() const + { + return iv_hwasProcessCalloutFn; + } protected: /** @@ -191,10 +193,6 @@ private: */ HWAS::processCalloutFn iv_hwasProcessCalloutFn; - /** - * @brief Serialization for accessing iv_hwasProcessCalloutFn - */ - mutable mutex_t iv_hwasMutex; }; } // End namespace diff --git a/src/usr/errl/errlmanager.C b/src/usr/errl/errlmanager.C index c615aeeba..bc4e84c0b 100644 --- a/src/usr/errl/errlmanager.C +++ b/src/usr/errl/errlmanager.C @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/errl/errlmanager.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 - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/errl/errlmanager.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 otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /** * @file errlmanager.C * @@ -85,7 +84,6 @@ ErrlManager::ErrlManager() iv_hwasProcessCalloutFn = NULL; mutex_init(&iv_commitMutex); - mutex_init(&iv_hwasMutex); // Scaffolding. // For now, put error logs in a 64KB buffer in L3 RAM @@ -200,20 +198,10 @@ uint32_t ErrlManager::getUniqueErrId() /////////////////////////////////////////////////////////////////////////////// void ErrlManager::setHwasProcessCalloutFn(HWAS::processCalloutFn i_fn) { - mutex_lock(&(ERRORLOG::theErrlManager::instance().iv_hwasMutex)); + // sync to ensure that all of HWAS is fully constructed BEFORE we + // write this function pointer + lwsync(); ERRORLOG::theErrlManager::instance().iv_hwasProcessCalloutFn = i_fn; - mutex_unlock(&(ERRORLOG::theErrlManager::instance().iv_hwasMutex)); -} - -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -HWAS::processCalloutFn ErrlManager::getHwasProcessCalloutFn() const -{ - HWAS::processCalloutFn l_fp = NULL; - mutex_lock(&iv_hwasMutex); - l_fp = iv_hwasProcessCalloutFn; - mutex_unlock(&iv_hwasMutex); - return l_fp; } /////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.1