tools/pci: Replace memcpy on pci write with aligned copy
memcpy() does unaligned access. Using it for device memory causes
exception (SIGBUS).
Replace the memcpy in PciAccessBridge::write with aligned copy.
Signed-off-by: Vivekanand Veeracholan <vveerach@google.com>
Change-Id: I8e573715dc8971be547d882ce3cb6de31b2620e4
diff --git a/tools/helper.hpp b/tools/helper.hpp
index 5580972..9acf58d 100644
--- a/tools/helper.hpp
+++ b/tools/helper.hpp
@@ -16,4 +16,13 @@
*/
bool pollStatus(std::uint16_t session, ipmiblob::BlobInterface* blob);
+/**
+ * Aligned memcpy
+ * @param[out] destination - destination memory pointer
+ * @param[in] source - source memory pointer
+ * @param[in] size - bytes to copy
+ * @return destination pointer
+ */
+void* memcpyAligned(void* destination, const void* source, std::size_t size);
+
} // namespace host_tool