You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UefiMultiPhase.h 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /** @file
  2. This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.
  3. Copyright (c) 2006 - 2010, 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. #include <ipxe/efi/Guid/WinCertificate.h>
  14. ///
  15. /// Enumeration of memory types introduced in UEFI.
  16. ///
  17. typedef enum {
  18. ///
  19. /// Not used.
  20. ///
  21. EfiReservedMemoryType,
  22. ///
  23. /// The code portions of a loaded application.
  24. /// (Note that UEFI OS loaders are UEFI applications.)
  25. ///
  26. EfiLoaderCode,
  27. ///
  28. /// The data portions of a loaded application and the default data allocation
  29. /// type used by an application to allocate pool memory.
  30. ///
  31. EfiLoaderData,
  32. ///
  33. /// The code portions of a loaded Boot Services Driver.
  34. ///
  35. EfiBootServicesCode,
  36. ///
  37. /// The data portions of a loaded Boot Serves Driver, and the default data
  38. /// allocation type used by a Boot Services Driver to allocate pool memory.
  39. ///
  40. EfiBootServicesData,
  41. ///
  42. /// The code portions of a loaded Runtime Services Driver.
  43. ///
  44. EfiRuntimeServicesCode,
  45. ///
  46. /// The data portions of a loaded Runtime Services Driver and the default
  47. /// data allocation type used by a Runtime Services Driver to allocate pool memory.
  48. ///
  49. EfiRuntimeServicesData,
  50. ///
  51. /// Free (unallocated) memory.
  52. ///
  53. EfiConventionalMemory,
  54. ///
  55. /// Memory in which errors have been detected.
  56. ///
  57. EfiUnusableMemory,
  58. ///
  59. /// Memory that holds the ACPI tables.
  60. ///
  61. EfiACPIReclaimMemory,
  62. ///
  63. /// Address space reserved for use by the firmware.
  64. ///
  65. EfiACPIMemoryNVS,
  66. ///
  67. /// Used by system firmware to request that a memory-mapped IO region
  68. /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.
  69. ///
  70. EfiMemoryMappedIO,
  71. ///
  72. /// System memory-mapped IO region that is used to translate memory
  73. /// cycles to IO cycles by the processor.
  74. ///
  75. EfiMemoryMappedIOPortSpace,
  76. ///
  77. /// Address space reserved by the firmware for code that is part of the processor.
  78. ///
  79. EfiPalCode,
  80. EfiMaxMemoryType
  81. } EFI_MEMORY_TYPE;
  82. ///
  83. /// Data structure that precedes all of the standard EFI table types.
  84. ///
  85. typedef struct {
  86. ///
  87. /// A 64-bit signature that identifies the type of table that follows.
  88. /// Unique signatures have been generated for the EFI System Table,
  89. /// the EFI Boot Services Table, and the EFI Runtime Services Table.
  90. ///
  91. UINT64 Signature;
  92. ///
  93. /// The revision of the EFI Specification to which this table
  94. /// conforms. The upper 16 bits of this field contain the major
  95. /// revision value, and the lower 16 bits contain the minor revision
  96. /// value. The minor revision values are limited to the range of 00..99.
  97. ///
  98. UINT32 Revision;
  99. ///
  100. /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
  101. ///
  102. UINT32 HeaderSize;
  103. ///
  104. /// The 32-bit CRC for the entire table. This value is computed by
  105. /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
  106. ///
  107. UINT32 CRC32;
  108. ///
  109. /// Reserved field that must be set to 0.
  110. ///
  111. UINT32 Reserved;
  112. } EFI_TABLE_HEADER;
  113. ///
  114. /// Attributes of variable.
  115. ///
  116. #define EFI_VARIABLE_NON_VOLATILE 0x00000001
  117. #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
  118. #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
  119. #define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008
  120. ///
  121. /// This attribute is identified by the mnemonic 'HR'
  122. /// elsewhere in this specification.
  123. ///
  124. #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
  125. ///
  126. /// AuthInfo is a WIN_CERTIFICATE using the wCertificateType
  127. /// WIN_CERTIFICATE_UEFI_GUID and the CertType
  128. /// EFI_CERT_TYPE_RSA2048_SHA256. If the attribute specifies
  129. /// authenticated access, then the Data buffer should begin with an
  130. /// authentication descriptor prior to the data payload and DataSize
  131. /// should reflect the the data.and descriptor size. The caller
  132. /// shall digest the Monotonic Count value and the associated data
  133. /// for the variable update using the SHA-256 1-way hash algorithm.
  134. /// The ensuing the 32-byte digest will be signed using the private
  135. /// key associated w/ the public/private 2048-bit RSA key-pair. The
  136. /// WIN_CERTIFICATE shall be used to describe the signature of the
  137. /// Variable data *Data. In addition, the signature will also
  138. /// include the MonotonicCount value to guard against replay attacks.
  139. ///
  140. typedef struct {
  141. ///
  142. /// Included in the signature of
  143. /// AuthInfo.Used to ensure freshness/no
  144. /// replay. Incremented during each
  145. /// "Write" access.
  146. ///
  147. UINT64 MonotonicCount;
  148. ///
  149. /// Provides the authorization for the variable
  150. /// access. It is a signature across the
  151. /// variable data and the Monotonic Count
  152. /// value. Caller uses Private key that is
  153. /// associated with a public key that has been
  154. /// provisioned via the key exchange.
  155. ///
  156. WIN_CERTIFICATE_UEFI_GUID AuthInfo;
  157. } EFI_VARIABLE_AUTHENTICATION;
  158. #endif