PeiCis.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /** @file
  2. The Include file for definitions in the Intel Platform Innovation Framework for EFI
  3. Pre-EFI Initialization Core Interface Specification (PEI CIS) Version 0.91.
  4. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef __PEICIS_H__
  8. #define __PEICIS_H__
  9. #include <Ppi/PciCfg.h>
  10. //
  11. // Framework PEI Specification Revision information
  12. //
  13. #define FRAMEWORK_PEI_SPECIFICATION_MAJOR_REVISION 0
  14. #define FRAMEWORK_PEI_SPECIFICATION_MINOR_REVISION 91
  15. //
  16. // PEI services signature and Revision defined in Framework PEI spec
  17. //
  18. #define FRAMEWORK_PEI_SERVICES_SIGNATURE 0x5652455320494550ULL
  19. #define FRAMEWORK_PEI_SERVICES_REVISION ((FRAMEWORK_PEI_SPECIFICATION_MAJOR_REVISION<<16) | (FRAMEWORK_PEI_SPECIFICATION_MINOR_REVISION))
  20. typedef struct _FRAMEWORK_EFI_PEI_SERVICES FRAMEWORK_EFI_PEI_SERVICES;
  21. /**
  22. The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI
  23. Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header.
  24. @param FfsHeader The pointer to the FFS file header.
  25. @param PeiServices Describes the list of possible PEI Services.
  26. @return Status code
  27. **/
  28. typedef
  29. EFI_STATUS
  30. (EFIAPI *EFI_PEIM_ENTRY_POINT)(
  31. IN EFI_FFS_FILE_HEADER *FfsHeader,
  32. IN EFI_PEI_SERVICES **PeiServices
  33. );
  34. /**
  35. This service abstracts the capability of the PEI
  36. Foundation to discover instances of firmware volumes in the system.
  37. Given the input file pointer, this service searches for the next
  38. matching file in the Firmware File System (FFS) volume.
  39. @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
  40. @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware Volume (BFV).
  41. @param FwVolHeader The pointer to the firmware volume header of the volume to return.
  42. @retval EFI_SUCCESS The volume was found.
  43. @retval EFI_NOT_FOUND The volume was not found.
  44. @retval EFI_INVALID_PARAMETER FwVolHeader is NULL
  45. **/
  46. typedef
  47. EFI_STATUS
  48. (EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME)(
  49. IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
  50. IN UINTN Instance,
  51. IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
  52. );
  53. /**
  54. This service abstracts the capability of the PEI
  55. Foundation to discover instances of firmware files in the system.
  56. Given the input file pointer, this service searches for the next matching
  57. file in the Firmware File System (FFS) volume.
  58. @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
  59. @param SearchType A filter to find files only of this type.
  60. @param FwVolHeader The pointer to the firmware volume header of the volume to search. This parameter
  61. must point to a valid FFS volume.
  62. @param FileHeader The pointer to the current file from which to begin searching. Upon return this pointer will be
  63. updated to reflect the file found.
  64. @retval EFI_SUCCESS The file was found.
  65. @retval EFI_NOT_FOUND The file was not found.
  66. @retval EFI_NOT_FOUND The header checksum was not zero.
  67. **/
  68. typedef
  69. EFI_STATUS
  70. (EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE)(
  71. IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
  72. IN EFI_FV_FILETYPE SearchType,
  73. IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
  74. IN OUT EFI_FFS_FILE_HEADER **FileHeader
  75. );
  76. /**
  77. Given the input file pointer, this service searches for the next
  78. matching file in the Firmware File System (FFS) volume.
  79. @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
  80. @param SectionType The value of the section type to find.
  81. @param FfsFileHeader A pointer to the file header that contains the set of sections to be searched.
  82. @param SectionData A pointer to the discovered section, if successful.
  83. @retval EFI_SUCCESS The section was found.
  84. @retval EFI_NOT_FOUND The section was not found.
  85. **/
  86. typedef
  87. EFI_STATUS
  88. (EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA)(
  89. IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices,
  90. IN EFI_SECTION_TYPE SectionType,
  91. IN EFI_FFS_FILE_HEADER *FfsFileHeader,
  92. IN OUT VOID **SectionData
  93. );
  94. ///
  95. /// FRAMEWORK_EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI
  96. /// Foundation. The table may be located in the temporary or permanent memory, depending upon the capabilities
  97. /// and phase of execution of PEI.
  98. ///
  99. /// These services fall into various classes, including the following:
  100. /// - Managing the boot mode.
  101. /// - Allocating both early and permanent memory.
  102. /// - Supporting the Firmware File System (FFS).
  103. /// - Abstracting the PPI database abstraction.
  104. /// - Creating Hand-Off Blocks (HOBs).
  105. ///
  106. struct _FRAMEWORK_EFI_PEI_SERVICES {
  107. EFI_TABLE_HEADER Hdr;
  108. //
  109. // PPI Functions
  110. //
  111. EFI_PEI_INSTALL_PPI InstallPpi;
  112. EFI_PEI_REINSTALL_PPI ReInstallPpi;
  113. EFI_PEI_LOCATE_PPI LocatePpi;
  114. EFI_PEI_NOTIFY_PPI NotifyPpi;
  115. //
  116. // Boot Mode Functions
  117. //
  118. EFI_PEI_GET_BOOT_MODE GetBootMode;
  119. EFI_PEI_SET_BOOT_MODE SetBootMode;
  120. //
  121. // HOB Functions
  122. //
  123. EFI_PEI_GET_HOB_LIST GetHobList;
  124. EFI_PEI_CREATE_HOB CreateHob;
  125. //
  126. // Firmware Volume Functions
  127. //
  128. EFI_PEI_FFS_FIND_NEXT_VOLUME FfsFindNextVolume;
  129. EFI_PEI_FFS_FIND_NEXT_FILE FfsFindNextFile;
  130. EFI_PEI_FFS_FIND_SECTION_DATA FfsFindSectionData;
  131. //
  132. // PEI Memory Functions
  133. //
  134. EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;
  135. EFI_PEI_ALLOCATE_PAGES AllocatePages;
  136. EFI_PEI_ALLOCATE_POOL AllocatePool;
  137. EFI_PEI_COPY_MEM CopyMem;
  138. EFI_PEI_SET_MEM SetMem;
  139. //
  140. // (the following interfaces are installed by publishing PEIM)
  141. // Status Code
  142. //
  143. EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;
  144. //
  145. // Reset
  146. //
  147. EFI_PEI_RESET_SYSTEM ResetSystem;
  148. ///
  149. /// Inconsistent with specification here:
  150. /// In Framework Spec, PeiCis0.91, CpuIo and PciCfg are NOT pointers.
  151. ///
  152. //
  153. // I/O Abstractions
  154. //
  155. EFI_PEI_CPU_IO_PPI *CpuIo;
  156. EFI_PEI_PCI_CFG_PPI *PciCfg;
  157. };
  158. ///
  159. /// Enumeration of reset types defined in the Framework Specification PeiCis.
  160. ///
  161. typedef enum {
  162. ///
  163. /// Used to induce a system-wide reset. This sets all circuitry within the
  164. /// system to its initial state. This type of reset is asynchronous to system
  165. /// operation and operates withgout regard to cycle boundaries. EfiColdReset
  166. /// is tantamount to a system power cycle.
  167. ///
  168. EfiPeiResetCold,
  169. ///
  170. /// Used to induce a system-wide initialization. The processors are set to their
  171. /// initial state, and pending cycles are not corrupted. If the system does
  172. /// not support this reset type, then an EfiResetCold must be performed.
  173. ///
  174. EfiPeiResetWarm,
  175. } EFI_PEI_RESET_TYPE;
  176. #endif