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 */ 36 #ifdef SDBUSPP_NEW_CAMELCASE 37 void nmi() override; 38 #else 39 void nMI() override; 40 #endif 41 42 private: 43 /** @brief sdbus handle */ 44 sdbusplus::bus::bus& bus; 45 46 /** @brief object path */ 47 std::string objectPath; 48 }; 49 50 } // namespace proc 51 } // namespace openpower 52