Lakshminarayana R. Kammath | 16ab00c | 2019-06-03 04:33:33 -0500 | [diff] [blame] | 1 | #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 | |
| 7 | namespace openpower |
| 8 | { |
| 9 | namespace proc |
| 10 | { |
| 11 | |
| 12 | using Base = sdbusplus::xyz::openbmc_project::Control::Host::server::NMI; |
| 13 | using Interface = sdbusplus::server::object::object<Base>; |
| 14 | |
| 15 | /* @class NMI |
| 16 | * @brief Implementation of NMI (Soft Reset) |
| 17 | */ |
| 18 | class 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 Williams | 1b607c3 | 2021-04-30 20:44:08 -0500 | [diff] [blame] | 36 | void nmi() override; |
Lakshminarayana R. Kammath | 16ab00c | 2019-06-03 04:33:33 -0500 | [diff] [blame] | 37 | |
| 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 |