blob: 8e579f5be27af3963c6a8c095c096448e2722da5 [file] [log] [blame]
Patrick Venture7dad86f2019-05-17 08:52:20 -07001#pragma once
William A. Kennington III4857ab42021-01-21 03:14:08 -08002#include <utility>
Patrick Venture7dad86f2019-05-17 08:52:20 -07003
Patrick Venture1d5a31c2019-05-20 11:38:22 -07004namespace ipmi_flash
Patrick Venture7dad86f2019-05-17 08:52:20 -07005{
6
Patrick Ventureede9c9f2020-09-30 13:49:19 -07007inline constexpr char biosBlobId[] = "/flash/bios";
8inline constexpr char updateBlobId[] = "/flash/update";
9inline constexpr char verifyBlobId[] = "/flash/verify";
10inline constexpr char hashBlobId[] = "/flash/hash";
11inline constexpr char activeImageBlobId[] = "/flash/active/image";
12inline constexpr char activeHashBlobId[] = "/flash/active/hash";
13inline constexpr char staticLayoutBlobId[] = "/flash/image";
14inline constexpr char ubiTarballBlobId[] = "/flash/tarball";
15inline constexpr char cleanupBlobId[] = "/flash/cleanup";
Patrick Venture7dad86f2019-05-17 08:52:20 -070016
William A. Kennington IIIb45eb5e2020-12-23 11:47:05 -080017/** @brief Lightweight class wrapper that removes move operations from a class
18 * in order to guarantee the contents stay pinned to a specific location
19 * in memory.
20 */
21template <typename T>
22struct Pinned : public T
23{
24 template <typename... Args>
25 Pinned(Args&&... args) : T(std::forward<Args>(args)...)
26 {}
27 template <typename Arg>
28 Pinned& operator=(const Arg& o)
29 {
30 *static_cast<T*>(this) = o;
31 return *this;
32 }
33
34 Pinned(Pinned&&) = delete;
35 Pinned& operator=(Pinned&&) = delete;
36};
37
Patrick Venture1d5a31c2019-05-20 11:38:22 -070038} // namespace ipmi_flash