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