xref: /openbmc/phosphor-ipmi-flash/util.hpp (revision 328f520f44a4e986d58b204468660e7ddeedc189)
17dad86fdSPatrick Venture #pragma once
24857ab46SWilliam 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";
16*328f520fSJie Yang inline constexpr char biosVersionBlobId[] = "/version/bios";
177dad86fdSPatrick Venture 
18b45eb5eeSWilliam A. Kennington III /** @brief Lightweight class wrapper that removes move operations from a class
19b45eb5eeSWilliam A. Kennington III  *         in order to guarantee the contents stay pinned to a specific location
20b45eb5eeSWilliam A. Kennington III  *         in memory.
21b45eb5eeSWilliam A. Kennington III  */
22b45eb5eeSWilliam A. Kennington III template <typename T>
23b45eb5eeSWilliam A. Kennington III struct Pinned : public T
24b45eb5eeSWilliam A. Kennington III {
25b45eb5eeSWilliam A. Kennington III     template <typename... Args>
Pinnedipmi_flash::Pinned26b45eb5eeSWilliam A. Kennington III     Pinned(Args&&... args) : T(std::forward<Args>(args)...)
27b45eb5eeSWilliam A. Kennington III     {}
28b45eb5eeSWilliam A. Kennington III     template <typename Arg>
operator =ipmi_flash::Pinned29b45eb5eeSWilliam A. Kennington III     Pinned& operator=(const Arg& o)
30b45eb5eeSWilliam A. Kennington III     {
31b45eb5eeSWilliam A. Kennington III         *static_cast<T*>(this) = o;
32b45eb5eeSWilliam A. Kennington III         return *this;
33b45eb5eeSWilliam A. Kennington III     }
34b45eb5eeSWilliam A. Kennington III 
35b45eb5eeSWilliam A. Kennington III     Pinned(Pinned&&) = delete;
36b45eb5eeSWilliam A. Kennington III     Pinned& operator=(Pinned&&) = delete;
37b45eb5eeSWilliam A. Kennington III };
38b45eb5eeSWilliam A. Kennington III 
391d5a31c9SPatrick Venture } // namespace ipmi_flash
40