Add PROCHOT signal monitor
The PROCHOT signal is employed on Intel-based ASRock Rack boards such as
the e3c246d4i and spc621d8hm3; support for it here is provided by a
simple copy/paste/modify of the existing MemhotMonitor code.
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I3175286581129e2fb4132c17079e275c422ca3d8
diff --git a/include/error_monitors/prochot_monitor.hpp b/include/error_monitors/prochot_monitor.hpp
new file mode 100644
index 0000000..9ea6273
--- /dev/null
+++ b/include/error_monitors/prochot_monitor.hpp
@@ -0,0 +1,56 @@
+/*
+// Copyright (c) 2023 Equinix Services, Inc.
+//
+// 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.
+*/
+#pragma once
+#include <error_monitors/base_gpio_monitor.hpp>
+#include <host_error_monitor.hpp>
+#include <sdbusplus/asio/object_server.hpp>
+
+namespace host_error_monitor::prochot_monitor
+{
+class ProchotMonitor :
+ public host_error_monitor::base_gpio_monitor::BaseGPIOMonitor
+{
+ const static host_error_monitor::base_gpio_monitor::AssertValue
+ assertValue =
+ host_error_monitor::base_gpio_monitor::AssertValue::lowAssert;
+ size_t cpuNum;
+
+ void logEvent() override
+ {
+ std::string cpuNumber = "CPU " + std::to_string(cpuNum);
+ std::string msg = cpuNumber + " Prochot.";
+ std::string redfishMsgArgs = cpuNumber;
+
+ sd_journal_send(
+ "MESSAGE=HostError: %s", msg.c_str(), "PRIORITY=%i", LOG_ERR,
+ "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.ComponentOverTemperature",
+ "REDFISH_MESSAGE_ARGS=%s", redfishMsgArgs.c_str(), NULL);
+ }
+
+ public:
+ ProchotMonitor(boost::asio::io_context& io,
+ std::shared_ptr<sdbusplus::asio::connection> conn,
+ const std::string& signalName, const size_t cpuNum) :
+ BaseGPIOMonitor(io, conn, signalName, assertValue),
+ cpuNum(cpuNum)
+ {
+ if (valid)
+ {
+ startMonitoring();
+ }
+ }
+};
+} // namespace host_error_monitor::prochot_monitor