Capsule.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /** @file
  2. Framework Capule related Definition.
  3. Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. @par Revision Reference:
  6. Capsule Spec Version 0.9
  7. **/
  8. #ifndef _CAPSULE_GUID_H__
  9. #define _CAPSULE_GUID_H__
  10. //
  11. // This is the GUID of the capsule header of the image on disk.
  12. //
  13. #define EFI_CAPSULE_GUID \
  14. { \
  15. 0x3B6686BD, 0x0D76, 0x4030, {0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 } \
  16. }
  17. //
  18. // This is the GUID of the configuration results file created by the capsule
  19. // application.
  20. //
  21. #define EFI_CONFIG_FILE_NAME_GUID \
  22. { \
  23. 0x98B8D59B, 0xE8BA, 0x48EE, {0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB } \
  24. }
  25. ///
  26. /// Bits in the flags field of the capsule header.
  27. /// This flag is set if the capsule can support setup changes, and cleared if it cannot.
  28. ///
  29. #define EFI_CAPSULE_HEADER_FLAG_SETUP 0x00000001
  30. #define CAPSULE_BLOCK_DESCRIPTOR_SIGNATURE SIGNATURE_32 ('C', 'B', 'D', 'S')
  31. //
  32. // An array of these structs describe the blocks that make up a capsule for
  33. // a capsule update.
  34. //
  35. typedef struct {
  36. UINT64 Length; ///< Length of the data block.
  37. EFI_PHYSICAL_ADDRESS Data; ///< Physical address of the data block.
  38. UINT32 Signature; ///< CBDS.
  39. UINT32 CheckSum; ///< To sum this structure to 0.
  40. } FRAMEWORK_EFI_CAPSULE_BLOCK_DESCRIPTOR;
  41. typedef struct {
  42. EFI_GUID OemGuid;
  43. UINT32 HeaderSize;
  44. //
  45. // UINT8 OemHdrData[];
  46. //
  47. } EFI_CAPSULE_OEM_HEADER;
  48. typedef struct {
  49. ///
  50. /// A defined GUID that indicates the start of a capsule.
  51. ///
  52. EFI_GUID CapsuleGuid;
  53. ///
  54. /// The size of the EFI_CAPSULE_HEADER structure.
  55. ///
  56. UINT32 HeaderSize;
  57. ///
  58. /// A bit-mapped list describing the capsule's attributes.
  59. /// All undefined bits should be written as zero (0).
  60. ///
  61. UINT32 Flags;
  62. ///
  63. /// The length in bytes (27,415 for an image containing 27,415 bytes) of the entire image
  64. /// including all headers. If this value is greater than the size of the data presented in
  65. /// the capsule body, the image is separated across multiple media. If this
  66. /// value is less than the size of the data, it is an error.
  67. ///
  68. UINT32 CapsuleImageSize;
  69. ///
  70. /// A zero-based number that enables a capsule to be split into pieces and then
  71. /// recombined for easier transfer across media with limited size. The lower the
  72. /// SequenceNumber, the earlier in the final image that the part of the capsule is to
  73. /// appear. In capsules that are not split, this value shall be zero.
  74. ///
  75. UINT32 SequenceNumber;
  76. ///
  77. /// Used to group the various pieces of a split capsule to ensure that they comprise the
  78. /// same base image. It is valid for this item to be zero, in which case the capsule cannot
  79. /// be split into components.
  80. ///
  81. EFI_GUID InstanceId;
  82. ///
  83. /// The offset in bytes from the beginning of the header to the start of an EFI string that
  84. /// contains a description of the identity of the subcapsules that make up the capsule. If
  85. /// the capsule is not split, this value should be zero. The same string should be
  86. /// presented for all subcapsules that constitute the same capsule.
  87. ///
  88. UINT32 OffsetToSplitInformation;
  89. ///
  90. /// The offset in bytes from the beginning of the header to the start of the part of the
  91. /// capsule that is to be transferred to DXE.
  92. ///
  93. UINT32 OffsetToCapsuleBody;
  94. ///
  95. /// The offset in bytes from the beginning of the header to the start of the OEM-defined
  96. /// header. This value must be less than OffsetToCapsuleBody.
  97. ///
  98. UINT32 OffsetToOemDefinedHeader;
  99. ///
  100. /// The offset in bytes from the beginning of the header to the start of human-readable
  101. /// text that describes the entity that created the capsule. This value must be less than OffsetToCapsuleBody.
  102. ///
  103. UINT32 OffsetToAuthorInformation;
  104. ///
  105. /// The offset in bytes from the beginning of the header to the start of human-readable
  106. /// text that describes the revision of the capsule and/or the capsule's contents. This
  107. /// value must be less than OffsetToCapsuleBody.
  108. ///
  109. UINT32 OffsetToRevisionInformation;
  110. ///
  111. /// The offset in bytes from the beginning of the header to the start of a one-line (less
  112. /// than 40 Unicode characters in any language) description of the capsule. It is intended
  113. /// to be used by OS-present applications when providing a list of capsules from which
  114. /// the user can choose. This value must be less than OffsetToCapsuleBody.
  115. ///
  116. UINT32 OffsetToShortDescription;
  117. ///
  118. /// The offset in bytes from the beginning of the header to the start of an EFI string
  119. ///
  120. UINT32 OffsetToLongDescription;
  121. ///
  122. /// This field is reserved for future use by this specification. For future compatibility,
  123. /// this field must be set to zero
  124. ///
  125. UINT32 OffsetToApplicableDevices;
  126. } FRAMEWORK_EFI_CAPSULE_HEADER;
  127. extern EFI_GUID gEfiCapsuleGuid;
  128. extern EFI_GUID gEfiConfigFileNameGuid;
  129. #endif