Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

UefiMultiPhase.h 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /** @file
  2. This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.
  3. Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
  4. This program and the accompanying materials are licensed and made available under
  5. the terms and conditions of the BSD License that accompanies this distribution.
  6. The full text of the license may be found at
  7. http://opensource.org/licenses/bsd-license.php.
  8. THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  10. **/
  11. #ifndef __UEFI_MULTIPHASE_H__
  12. #define __UEFI_MULTIPHASE_H__
  13. FILE_LICENCE ( BSD3 );
  14. #include <ipxe/efi/Guid/WinCertificate.h>
  15. ///
  16. /// Enumeration of memory types introduced in UEFI.
  17. ///
  18. typedef enum {
  19. ///
  20. /// Not used.
  21. ///
  22. EfiReservedMemoryType,
  23. ///
  24. /// The code portions of a loaded application.
  25. /// (Note that UEFI OS loaders are UEFI applications.)
  26. ///
  27. EfiLoaderCode,
  28. ///
  29. /// The data portions of a loaded application and the default data allocation
  30. /// type used by an application to allocate pool memory.
  31. ///
  32. EfiLoaderData,
  33. ///
  34. /// The code portions of a loaded Boot Services Driver.
  35. ///
  36. EfiBootServicesCode,
  37. ///
  38. /// The data portions of a loaded Boot Serves Driver, and the default data
  39. /// allocation type used by a Boot Services Driver to allocate pool memory.
  40. ///
  41. EfiBootServicesData,
  42. ///
  43. /// The code portions of a loaded Runtime Services Driver.
  44. ///
  45. EfiRuntimeServicesCode,
  46. ///
  47. /// The data portions of a loaded Runtime Services Driver and the default
  48. /// data allocation type used by a Runtime Services Driver to allocate pool memory.
  49. ///
  50. EfiRuntimeServicesData,
  51. ///
  52. /// Free (unallocated) memory.
  53. ///
  54. EfiConventionalMemory,
  55. ///
  56. /// Memory in which errors have been detected.
  57. ///
  58. EfiUnusableMemory,
  59. ///
  60. /// Memory that holds the ACPI tables.
  61. ///
  62. EfiACPIReclaimMemory,
  63. ///
  64. /// Address space reserved for use by the firmware.
  65. ///
  66. EfiACPIMemoryNVS,
  67. ///
  68. /// Used by system firmware to request that a memory-mapped IO region
  69. /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.
  70. ///
  71. EfiMemoryMappedIO,
  72. ///
  73. /// System memory-mapped IO region that is used to translate memory
  74. /// cycles to IO cycles by the processor.
  75. ///
  76. EfiMemoryMappedIOPortSpace,
  77. ///
  78. /// Address space reserved by the firmware for code that is part of the processor.
  79. ///
  80. EfiPalCode,
  81. EfiMaxMemoryType
  82. } EFI_MEMORY_TYPE;
  83. ///
  84. /// Data structure that precedes all of the standard EFI table types.
  85. ///
  86. typedef struct {
  87. ///
  88. /// A 64-bit signature that identifies the type of table that follows.
  89. /// Unique signatures have been generated for the EFI System Table,
  90. /// the EFI Boot Services Table, and the EFI Runtime Services Table.
  91. ///
  92. UINT64 Signature;
  93. ///
  94. /// The revision of the EFI Specification to which this table
  95. /// conforms. The upper 16 bits of this field contain the major
  96. /// revision value, and the lower 16 bits contain the minor revision
  97. /// value. The minor revision values are limited to the range of 00..99.
  98. ///
  99. UINT32 Revision;
  100. ///
  101. /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
  102. ///
  103. UINT32 HeaderSize;
  104. ///
  105. /// The 32-bit CRC for the entire table. This value is computed by
  106. /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
  107. ///
  108. UINT32 CRC32;
  109. ///
  110. /// Reserved field that must be set to 0.
  111. ///
  112. UINT32 Reserved;
  113. } EFI_TABLE_HEADER;
  114. ///
  115. /// Attributes of variable.
  116. ///
  117. #define EFI_VARIABLE_NON_VOLATILE 0x00000001
  118. #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
  119. #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
  120. ///
  121. /// This attribute is identified by the mnemonic 'HR'
  122. /// elsewhere in this specification.
  123. ///
  124. #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
  125. ///
  126. /// Attributes of Authenticated Variable
  127. ///
  128. #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
  129. #define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020
  130. #define EFI_VARIABLE_APPEND_WRITE 0x00000040
  131. ///
  132. /// AuthInfo is a WIN_CERTIFICATE using the wCertificateType
  133. /// WIN_CERTIFICATE_UEFI_GUID and the CertType
  134. /// EFI_CERT_TYPE_RSA2048_SHA256_GUID. If the attribute specifies
  135. /// authenticated access, then the Data buffer should begin with an
  136. /// authentication descriptor prior to the data payload and DataSize
  137. /// should reflect the the data.and descriptor size. The caller
  138. /// shall digest the Monotonic Count value and the associated data
  139. /// for the variable update using the SHA-256 1-way hash algorithm.
  140. /// The ensuing the 32-byte digest will be signed using the private
  141. /// key associated w/ the public/private 2048-bit RSA key-pair. The
  142. /// WIN_CERTIFICATE shall be used to describe the signature of the
  143. /// Variable data *Data. In addition, the signature will also
  144. /// include the MonotonicCount value to guard against replay attacks.
  145. ///
  146. typedef struct {
  147. ///
  148. /// Included in the signature of
  149. /// AuthInfo.Used to ensure freshness/no
  150. /// replay. Incremented during each
  151. /// "Write" access.
  152. ///
  153. UINT64 MonotonicCount;
  154. ///
  155. /// Provides the authorization for the variable
  156. /// access. It is a signature across the
  157. /// variable data and the Monotonic Count
  158. /// value. Caller uses Private key that is
  159. /// associated with a public key that has been
  160. /// provisioned via the key exchange.
  161. ///
  162. WIN_CERTIFICATE_UEFI_GUID AuthInfo;
  163. } EFI_VARIABLE_AUTHENTICATION;
  164. ///
  165. /// When the attribute EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS is
  166. /// set, then the Data buffer shall begin with an instance of a complete (and serialized)
  167. /// EFI_VARIABLE_AUTHENTICATION_2 descriptor. The descriptor shall be followed by the new
  168. /// variable value and DataSize shall reflect the combined size of the descriptor and the new
  169. /// variable value. The authentication descriptor is not part of the variable data and is not
  170. /// returned by subsequent calls to GetVariable().
  171. ///
  172. typedef struct {
  173. ///
  174. /// For the TimeStamp value, components Pad1, Nanosecond, TimeZone, Daylight and
  175. /// Pad2 shall be set to 0. This means that the time shall always be expressed in GMT.
  176. ///
  177. EFI_TIME TimeStamp;
  178. ///
  179. /// Only a CertType of EFI_CERT_TYPE_PKCS7_GUID is accepted.
  180. ///
  181. WIN_CERTIFICATE_UEFI_GUID AuthInfo;
  182. } EFI_VARIABLE_AUTHENTICATION_2;
  183. #endif