summaryrefslogtreecommitdiffstats
path: root/src/usr/lpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/lpc')
-rw-r--r--src/usr/lpc/lpcdd.C15
-rw-r--r--src/usr/lpc/lpcdd.H15
2 files changed, 28 insertions, 2 deletions
diff --git a/src/usr/lpc/lpcdd.C b/src/usr/lpc/lpcdd.C
index a8a23fde1..81577a5b0 100644
--- a/src/usr/lpc/lpcdd.C
+++ b/src/usr/lpc/lpcdd.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2016 */
+/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -363,6 +363,19 @@ errlHndl_t create_altmaster_objects( bool i_create,
return l_err;
}
+
+/**
+ * @brief Block/unblock all LPC operations
+ * @param[in] i_block true: block ops, false: allow ops
+ *
+ */
+void block_lpc_ops( bool i_block )
+{
+ // Note: this is ignoring the alt-master because the usecase for
+ // this function is only applicable for DD1
+ Singleton<LpcDD>::instance().lock(i_block);
+}
+
}; //namespace LPC
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/usr/lpc/lpcdd.H b/src/usr/lpc/lpcdd.H
index 1b4e3c5bd..f4bd04176 100644
--- a/src/usr/lpc/lpcdd.H
+++ b/src/usr/lpc/lpcdd.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2016 */
+/* Contributors Listed Below - COPYRIGHT 2014,2017 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -132,6 +132,19 @@ class LpcDD
};
/**
+ * @brief Block/unblock all LPC operations
+ * @param[in] i_block true: block ops, false: allow ops
+ */
+ void lock( bool i_block )
+ {
+ if( i_block ) {
+ mutex_lock(ivp_mutex);
+ } else {
+ mutex_unlock(ivp_mutex);
+ }
+ };
+
+ /**
* @brief Constructor
* @param[in] Processor target associated with the ECCB logic
*/
OpenPOWER on IntegriCloud