blob: 3deebb4a586bf7a58202bd168881d8e5e1a500cf [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";
Jie Yang328f5202021-03-16 00:52:07 -070016inline constexpr char biosVersionBlobId[] = "/version/bios";
Patrick Venture7dad86f2019-05-17 08:52:20 -070017
William A. Kennington IIIb45eb5e2020-12-23 11:47:05 -080018/** @brief Lightweight class wrapper that removes move operations from a class
19 * in order to guarantee the contents stay pinned to a specific location
20 * in memory.
21 */
22template <typename T>
23struct Pinned : public T
24{
25 template <typename... Args>
26 Pinned(Args&&... args) : T(std::forward<Args>(args)...)
27 {}
28 template <typename Arg>
29 Pinned& operator=(const Arg& o)
30 {
31 *static_cast<T*>(this) = o;
32 return *this;
33 }
34
35 Pinned(Pinned&&) = delete;
36 Pinned& operator=(Pinned&&) = delete;
37};
38
Patrick Venture1d5a31c2019-05-20 11:38:22 -070039} // namespace ipmi_flash