xref: /openbmc/phosphor-ipmi-flash/tools/helper.hpp (revision f88bcf3babb0de4795ddc5f6ba74be67c5d1605b)
101123b2aSPatrick Venture #pragma once
201123b2aSPatrick Venture 
301123b2aSPatrick Venture #include <ipmiblob/blob_interface.hpp>
401123b2aSPatrick Venture 
59b37b095SPatrick Venture #include <cstdint>
69b37b095SPatrick Venture 
701123b2aSPatrick Venture namespace host_tool
801123b2aSPatrick Venture {
901123b2aSPatrick Venture 
1001123b2aSPatrick Venture /**
1101123b2aSPatrick Venture  * Poll an open verification session.
1201123b2aSPatrick Venture  *
1301123b2aSPatrick Venture  * @param[in] session - the open verification session
1401123b2aSPatrick Venture  * @param[in] blob - pointer to blob interface implementation object.
15328f520fSJie Yang  * @return true if the verification was successful.
1601123b2aSPatrick Venture  */
17*f88bcf3bSWilliam A. Kennington III void pollStatus(std::uint16_t session, ipmiblob::BlobInterface* blob);
1801123b2aSPatrick Venture 
19c7fa2c28SVivekanand Veeracholan /**
20328f520fSJie Yang  * Poll an open firmware version blob session and check if it ready to read.
21328f520fSJie Yang  *
22328f520fSJie Yang  * @param[in] session - the open firmware version blob session
23328f520fSJie Yang  * @param[in] blob - pointer to blob interface implementation object
24328f520fSJie Yang  * @return the polling status and blob buffer size
25328f520fSJie Yang  */
26*f88bcf3bSWilliam A. Kennington III uint32_t pollReadReady(std::uint16_t session, ipmiblob::BlobInterface* blob);
27328f520fSJie Yang 
28328f520fSJie Yang /**
29c7fa2c28SVivekanand Veeracholan  * Aligned memcpy
30c7fa2c28SVivekanand Veeracholan  * @param[out] destination - destination memory pointer
31c7fa2c28SVivekanand Veeracholan  * @param[in] source - source memory pointer
32c7fa2c28SVivekanand Veeracholan  * @param[in] size - bytes to copy
33c7fa2c28SVivekanand Veeracholan  * @return destination pointer
34c7fa2c28SVivekanand Veeracholan  */
35c7fa2c28SVivekanand Veeracholan void* memcpyAligned(void* destination, const void* source, std::size_t size);
36c7fa2c28SVivekanand Veeracholan 
3701123b2aSPatrick Venture } // namespace host_tool
38