summaryrefslogtreecommitdiffstats
path: root/src/include/usr/fapi2
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr/fapi2')
-rw-r--r--src/include/usr/fapi2/hw_access.H16
-rw-r--r--src/include/usr/fapi2/plat_hw_access.H14
-rw-r--r--src/include/usr/fapi2/plat_hwp_invoker.H1
3 files changed, 23 insertions, 8 deletions
diff --git a/src/include/usr/fapi2/hw_access.H b/src/include/usr/fapi2/hw_access.H
index 867379e95..a3bc8c92d 100644
--- a/src/include/usr/fapi2/hw_access.H
+++ b/src/include/usr/fapi2/hw_access.H
@@ -65,16 +65,18 @@ inline uint8_t getPIBErrorMask(void)
// Operational Mode Error Functions
//--------------------------------------------------------------------------
+//The operational mode, or opMode is a thread local variable that allows the
+//fapi2 interface to call getScom or putScom with special settings. Examples
+//of their use cases are disabling the abiility for a scom to wakeup or core
+//or ignore hardware errors. The opMode is reset on every FAPI_INVOKE call
+//and is therefore reset each HWP.
+
/// @brief Sets the operational mode
/// @param[in] i_mode The new mode
// note: this can be moved to a C file if desired
inline void setOpMode(const OpModes i_mode)
{
- // Keeps the compiler from complaining about the unused i_mode
- static_cast<void>(i_mode);
- //TODO: RTC 124195 FAPI2 - PIB error mask and Operation mode supports
- // No-op for now. Should set thread-local operational mode
- return;
+ return platSetOpMode(i_mode);
}
/// @brief Gets the operational mode
@@ -82,9 +84,7 @@ inline void setOpMode(const OpModes i_mode)
// note: this can be moved to a C file if desired
inline OpModes getOpMode(void)
{
- //TODO: RTC 124195 FAPI2 - PIB error mask and Operation mode supports
- // No-op for now. Should read thread-local operational mode
- return NORMAL;
+ return platGetOpMode();
}
//------------------------------------------------------------------------------
diff --git a/src/include/usr/fapi2/plat_hw_access.H b/src/include/usr/fapi2/plat_hw_access.H
index f4c669fa8..7d8e36e3b 100644
--- a/src/include/usr/fapi2/plat_hw_access.H
+++ b/src/include/usr/fapi2/plat_hw_access.H
@@ -178,6 +178,20 @@ ReturnCode platPutRing(const Target<TARGET_TYPE_ALL>& i_target,
const RingID i_ringID,
const RingMode i_ringMode);
+//--------------------------------------------------------------------------
+// Operational Mode Error Functions
+//--------------------------------------------------------------------------
+
+/// @brief Sets the operational mode
+/// @param[in] i_mode The new mode
+void platSetOpMode(const OpModes i_mode);
+
+/// @brief Gets the operational mode
+/// @return the operational mode
+OpModes platGetOpMode(void);
+
+extern OpModes opMode;
+
// --------------------------------------------------------------------------
// NOTE:
// No spy access interface as HB doesn't allow spy access.
diff --git a/src/include/usr/fapi2/plat_hwp_invoker.H b/src/include/usr/fapi2/plat_hwp_invoker.H
index 200493a51..967ce45fd 100644
--- a/src/include/usr/fapi2/plat_hwp_invoker.H
+++ b/src/include/usr/fapi2/plat_hwp_invoker.H
@@ -61,6 +61,7 @@
{\
fapi2::ReturnCode l_rc; \
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;\
+ fapi2::opMode = fapi2::NORMAL;\
FAPI_EXEC_HWP(l_rc, FUNC, ##_args_); \
ERRHNDL = fapi2::rcToErrl(l_rc);\
if( ERRHNDL ) {\
OpenPOWER on IntegriCloud