Ben Tyner | 9ae5ca4 | 2020-02-28 13:13:50 -0600 | [diff] [blame] | 1 | #include <logging.hpp> |
| 2 | #include <sdbusplus/bus.hpp> |
| 3 | |
| 4 | #include <sstream> |
| 5 | |
| 6 | namespace attn |
| 7 | { |
| 8 | |
| 9 | /** |
| 10 | * @brief Notify Cronus over dbus interface |
| 11 | * |
| 12 | * When the special attention is due to a breakpoint condition we will notify |
| 13 | * Cronus over the dbus interface. |
| 14 | */ |
| 15 | void bpHandler() |
| 16 | { |
| 17 | // trace message |
| 18 | std::stringstream ss; |
| 19 | ss << "Notify Cronus" << std::endl; |
| 20 | log<level::INFO>(ss.str().c_str()); |
| 21 | |
| 22 | // notify Cronus over dbus |
| 23 | auto bus = sdbusplus::bus::new_system(); |
| 24 | auto msg = bus.new_signal("/", "org.openbmc.cronus", "Brkpt"); |
| 25 | |
| 26 | // Cronus will figure out proc, core, thread so just send 0,0,0 |
| 27 | std::array<uint32_t, 3> params{0, 0, 0}; |
| 28 | msg.append(params); |
| 29 | |
| 30 | msg.signal_send(); |
| 31 | |
| 32 | return; |
| 33 | } |
| 34 | |
| 35 | } // namespace attn |