blob: ef871b821496ef11da81a4613ce4f021387b8e15 [file] [log] [blame]
Lakshminarayana R. Kammath16ab00c2019-06-03 04:33:33 -05001#pragma once
2
3#include <sdbusplus/bus.hpp>
4#include <sdbusplus/server/object.hpp>
5#include <xyz/openbmc_project/Control/Host/NMI/server.hpp>
6
7namespace openpower
8{
9namespace proc
10{
11
12using Base = sdbusplus::xyz::openbmc_project::Control::Host::server::NMI;
13using Interface = sdbusplus::server::object::object<Base>;
14
15/* @class NMI
16 * @brief Implementation of NMI (Soft Reset)
17 */
18class NMI : public Interface
19{
20 public:
21 NMI() = delete;
22 NMI(const NMI&) = delete;
23 NMI& operator=(const NMI&) = delete;
24 NMI(NMI&&) = delete;
25 NMI& operator=(NMI&&) = delete;
26 virtual ~NMI() = default;
27
28 /* @brief Constructor to put object onto bus at a dbus path.
29 * @param[in] bus - sdbusplus D-Bus to attach to.
30 * @param[in] path - Path to attach to.
31 */
32 NMI(sdbusplus::bus::bus& bus, const char* path);
33
34 /* @brief trigger stop followed by soft reset.
35 */
Patrick Williams1b607c32021-04-30 20:44:08 -050036 void nmi() override;
Lakshminarayana R. Kammath16ab00c2019-06-03 04:33:33 -050037
38 private:
39 /** @brief sdbus handle */
40 sdbusplus::bus::bus& bus;
41
42 /** @brief object path */
43 std::string objectPath;
44};
45
46} // namespace proc
47} // namespace openpower