xref: /openbmc/phosphor-ipmi-flash/util.hpp (revision 4857ab46d94c4b2e0302b8e2a453b6f63e8143ea)
17dad86fdSPatrick Venture #pragma once
2*4857ab46SWilliam A. Kennington III #include <utility>
37dad86fdSPatrick Venture 
41d5a31c9SPatrick Venture namespace ipmi_flash
57dad86fdSPatrick Venture {
67dad86fdSPatrick Venture 
7ede9c9f6SPatrick Venture inline constexpr char biosBlobId[] = "/flash/bios";
8ede9c9f6SPatrick Venture inline constexpr char updateBlobId[] = "/flash/update";
9ede9c9f6SPatrick Venture inline constexpr char verifyBlobId[] = "/flash/verify";
10ede9c9f6SPatrick Venture inline constexpr char hashBlobId[] = "/flash/hash";
11ede9c9f6SPatrick Venture inline constexpr char activeImageBlobId[] = "/flash/active/image";
12ede9c9f6SPatrick Venture inline constexpr char activeHashBlobId[] = "/flash/active/hash";
13ede9c9f6SPatrick Venture inline constexpr char staticLayoutBlobId[] = "/flash/image";
14ede9c9f6SPatrick Venture inline constexpr char ubiTarballBlobId[] = "/flash/tarball";
15ede9c9f6SPatrick Venture inline constexpr char cleanupBlobId[] = "/flash/cleanup";
167dad86fdSPatrick Venture 
17b45eb5eeSWilliam A. Kennington III /** @brief Lightweight class wrapper that removes move operations from a class
18b45eb5eeSWilliam A. Kennington III  *         in order to guarantee the contents stay pinned to a specific location
19b45eb5eeSWilliam A. Kennington III  *         in memory.
20b45eb5eeSWilliam A. Kennington III  */
21b45eb5eeSWilliam A. Kennington III template <typename T>
22b45eb5eeSWilliam A. Kennington III struct Pinned : public T
23b45eb5eeSWilliam A. Kennington III {
24b45eb5eeSWilliam A. Kennington III     template <typename... Args>
25b45eb5eeSWilliam A. Kennington III     Pinned(Args&&... args) : T(std::forward<Args>(args)...)
26b45eb5eeSWilliam A. Kennington III     {}
27b45eb5eeSWilliam A. Kennington III     template <typename Arg>
28b45eb5eeSWilliam A. Kennington III     Pinned& operator=(const Arg& o)
29b45eb5eeSWilliam A. Kennington III     {
30b45eb5eeSWilliam A. Kennington III         *static_cast<T*>(this) = o;
31b45eb5eeSWilliam A. Kennington III         return *this;
32b45eb5eeSWilliam A. Kennington III     }
33b45eb5eeSWilliam A. Kennington III 
34b45eb5eeSWilliam A. Kennington III     Pinned(Pinned&&) = delete;
35b45eb5eeSWilliam A. Kennington III     Pinned& operator=(Pinned&&) = delete;
36b45eb5eeSWilliam A. Kennington III };
37b45eb5eeSWilliam A. Kennington III 
381d5a31c9SPatrick Venture } // namespace ipmi_flash
39