Adding CPUCore interface support
This commit introduces essential D-Bus infrastructure support for
hosting the `Item.CPUCore` D-Bus object. Additionally, it includes
getter and setter functions to enable get/set properties within the
`CPUCore` interface, such as core count and microcode.
Testing:
Unit test passed
Change-Id: I728522b34e96ee7d6609efb5746b40cf923812e8
Signed-off-by: Kamalkumar Patel <kamalkumar.patel@ibm.com>
diff --git a/host-bmc/dbus/cpu_core.hpp b/host-bmc/dbus/cpu_core.hpp
new file mode 100644
index 0000000..3a58529
--- /dev/null
+++ b/host-bmc/dbus/cpu_core.hpp
@@ -0,0 +1,39 @@
+#pragma once
+
+#include <sdbusplus/bus.hpp>
+#include <sdbusplus/server.hpp>
+#include <sdbusplus/server/object.hpp>
+#include <xyz/openbmc_project/Inventory/Item/CpuCore/server.hpp>
+
+#include <string>
+
+namespace pldm
+{
+namespace dbus
+{
+using CoreIntf = sdbusplus::server::object_t<
+ sdbusplus::xyz::openbmc_project::Inventory::Item::server::CpuCore>;
+
+class CPUCore : public CoreIntf
+{
+ public:
+ CPUCore() = delete;
+ ~CPUCore() = default;
+ CPUCore(const CPUCore&) = delete;
+ CPUCore& operator=(const CPUCore&) = delete;
+ CPUCore(CPUCore&&) = default;
+ CPUCore& operator=(CPUCore&&) = default;
+
+ CPUCore(sdbusplus::bus_t& bus, const std::string& objPath) :
+ CoreIntf(bus, objPath.c_str())
+ {}
+
+ /** Get value of Microcode */
+ uint32_t microcode() const override;
+
+ /** Set value of Microcode */
+ uint32_t microcode(uint32_t value) override;
+};
+
+} // namespace dbus
+} // namespace pldm