162337a92SDhruvaraj Subhashchandran #pragma once 262337a92SDhruvaraj Subhashchandran 362337a92SDhruvaraj Subhashchandran #include "dump_manager.hpp" 462337a92SDhruvaraj Subhashchandran #include "xyz/openbmc_project/Dump/NewDump/server.hpp" 562337a92SDhruvaraj Subhashchandran 662337a92SDhruvaraj Subhashchandran #include <com/ibm/Dump/Create/server.hpp> 762337a92SDhruvaraj Subhashchandran #include <sdbusplus/bus.hpp> 862337a92SDhruvaraj Subhashchandran #include <sdbusplus/server/object.hpp> 962337a92SDhruvaraj Subhashchandran #include <xyz/openbmc_project/Dump/Create/server.hpp> 1062337a92SDhruvaraj Subhashchandran 11341d683dSDhruvaraj Subhashchandran namespace openpower 1262337a92SDhruvaraj Subhashchandran { 1362337a92SDhruvaraj Subhashchandran namespace dump 1462337a92SDhruvaraj Subhashchandran { 1562337a92SDhruvaraj Subhashchandran namespace resource 1662337a92SDhruvaraj Subhashchandran { 1762337a92SDhruvaraj Subhashchandran 1862337a92SDhruvaraj Subhashchandran constexpr uint32_t INVALID_SOURCE_ID = 0xFFFFFFFF; 19*9b18bf2dSPatrick Williams using NotifyIface = sdbusplus::server::object_t< 2062337a92SDhruvaraj Subhashchandran sdbusplus::xyz::openbmc_project::Dump::server::Create, 2162337a92SDhruvaraj Subhashchandran sdbusplus::com::ibm::Dump::server::Create, 2262337a92SDhruvaraj Subhashchandran sdbusplus::xyz::openbmc_project::Dump::server::NewDump>; 2362337a92SDhruvaraj Subhashchandran 2462337a92SDhruvaraj Subhashchandran /** @class Manager 2562337a92SDhruvaraj Subhashchandran * @brief Resource Dump manager implementation. 2662337a92SDhruvaraj Subhashchandran * @details A concrete implementation for the 2762337a92SDhruvaraj Subhashchandran * xyz.openbmc_project.Dump.Notify and 2862337a92SDhruvaraj Subhashchandran * xyz.openbmc_project.Dump.Create DBus APIs 2962337a92SDhruvaraj Subhashchandran */ 300af74a5eSJayanth Othayoth class Manager : 310af74a5eSJayanth Othayoth virtual public NotifyIface, 3262337a92SDhruvaraj Subhashchandran virtual public phosphor::dump::Manager 3362337a92SDhruvaraj Subhashchandran { 3462337a92SDhruvaraj Subhashchandran public: 3562337a92SDhruvaraj Subhashchandran Manager() = delete; 3662337a92SDhruvaraj Subhashchandran Manager(const Manager&) = default; 3762337a92SDhruvaraj Subhashchandran Manager& operator=(const Manager&) = delete; 3862337a92SDhruvaraj Subhashchandran Manager(Manager&&) = delete; 3962337a92SDhruvaraj Subhashchandran Manager& operator=(Manager&&) = delete; 4062337a92SDhruvaraj Subhashchandran virtual ~Manager() = default; 4162337a92SDhruvaraj Subhashchandran 4262337a92SDhruvaraj Subhashchandran /** @brief Constructor to put object onto bus at a dbus path. 4362337a92SDhruvaraj Subhashchandran * @param[in] bus - Bus to attach to. 4462337a92SDhruvaraj Subhashchandran * @param[in] path - Path to attach at. 4562337a92SDhruvaraj Subhashchandran * @param[in] baseEntryPath - Base path of the dump entry. 4662337a92SDhruvaraj Subhashchandran */ Manager(sdbusplus::bus_t & bus,const char * path,const std::string & baseEntryPath)47*9b18bf2dSPatrick Williams Manager(sdbusplus::bus_t& bus, const char* path, 4862337a92SDhruvaraj Subhashchandran const std::string& baseEntryPath) : 4962337a92SDhruvaraj Subhashchandran NotifyIface(bus, path), 5062337a92SDhruvaraj Subhashchandran phosphor::dump::Manager(bus, path, baseEntryPath) 510af74a5eSJayanth Othayoth {} 5262337a92SDhruvaraj Subhashchandran restore()5362337a92SDhruvaraj Subhashchandran void restore() override 5462337a92SDhruvaraj Subhashchandran { 5562337a92SDhruvaraj Subhashchandran // TODO #2597 Implement the restore to restore the dump entries 5662337a92SDhruvaraj Subhashchandran // after the service restart. 5762337a92SDhruvaraj Subhashchandran } 5862337a92SDhruvaraj Subhashchandran 5962337a92SDhruvaraj Subhashchandran /** @brief Notify the resource dump manager about creation of a new dump. 6062337a92SDhruvaraj Subhashchandran * @param[in] dumpId - Id from the source of the dump. 6162337a92SDhruvaraj Subhashchandran * @param[in] size - Size of the dump. 6262337a92SDhruvaraj Subhashchandran */ 6362337a92SDhruvaraj Subhashchandran void notify(uint32_t dumpId, uint64_t size) override; 6462337a92SDhruvaraj Subhashchandran 6562337a92SDhruvaraj Subhashchandran /** @brief Implementation for CreateDump 6662337a92SDhruvaraj Subhashchandran * Method to create Dump. 6762337a92SDhruvaraj Subhashchandran * 6862337a92SDhruvaraj Subhashchandran * @return object_path - The object path of the new entry. 6962337a92SDhruvaraj Subhashchandran */ 7062337a92SDhruvaraj Subhashchandran sdbusplus::message::object_path 71ddc3366eSDhruvaraj Subhashchandran createDump(phosphor::dump::DumpCreateParams params) override; 7262337a92SDhruvaraj Subhashchandran }; 7362337a92SDhruvaraj Subhashchandran 7462337a92SDhruvaraj Subhashchandran } // namespace resource 7562337a92SDhruvaraj Subhashchandran } // namespace dump 76341d683dSDhruvaraj Subhashchandran } // namespace openpower 77