blob: d61e8ebc8a4115337df3d423aa47573f0652d177 [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#ifdef SDBUSPP_NEW_CAMELCASE
37 void nmi() override;
38#else
Lakshminarayana R. Kammath16ab00c2019-06-03 04:33:33 -050039 void nMI() override;
Patrick Williams1b607c32021-04-30 20:44:08 -050040#endif
Lakshminarayana R. Kammath16ab00c2019-06-03 04:33:33 -050041
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