DxeIpl.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /** @file
  2. Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef __PEI_DXEIPL_H__
  6. #define __PEI_DXEIPL_H__
  7. #include <PiPei.h>
  8. #include <Ppi/DxeIpl.h>
  9. #include <Ppi/EndOfPeiPhase.h>
  10. #include <Ppi/MemoryDiscovered.h>
  11. #include <Ppi/Decompress.h>
  12. #include <Ppi/FirmwareVolumeInfo.h>
  13. #include <Ppi/GuidedSectionExtraction.h>
  14. #include <Library/DebugLib.h>
  15. #include <Library/PeimEntryPoint.h>
  16. #include <Library/BaseLib.h>
  17. #include <Library/HobLib.h>
  18. #include <Library/PeiServicesLib.h>
  19. #include <Library/ReportStatusCodeLib.h>
  20. #include <Library/UefiDecompressLib.h>
  21. #include <Library/ExtractGuidedSectionLib.h>
  22. #include <Library/BaseMemoryLib.h>
  23. #include <Library/MemoryAllocationLib.h>
  24. #include <Library/PcdLib.h>
  25. #include <Library/FspSwitchStackLib.h>
  26. #include <Library/FspCommonLib.h>
  27. #include <Library/FspPlatformLib.h>
  28. /**
  29. Main entry point to last PEIM.
  30. This function finds DXE Core in the firmware volume and transfer the control to
  31. DXE core.
  32. @param[in] This Entry point for DXE IPL PPI.
  33. @param[in] PeiServices General purpose services available to every PEIM.
  34. @param[in] HobList Address to the Pei HOB list.
  35. @return EFI_SUCCESS DXE core was successfully loaded.
  36. @return EFI_OUT_OF_RESOURCES There are not enough resources to load DXE core.
  37. **/
  38. EFI_STATUS
  39. EFIAPI
  40. DxeLoadCore (
  41. IN CONST EFI_DXE_IPL_PPI *This,
  42. IN EFI_PEI_SERVICES **PeiServices,
  43. IN EFI_PEI_HOB_POINTERS HobList
  44. );
  45. /**
  46. Transfers control to DxeCore.
  47. This function performs a CPU architecture specific operations to execute
  48. the entry point of DxeCore with the parameters of HobList.
  49. It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.
  50. @param[in] DxeCoreEntryPoint The entry point of DxeCore.
  51. @param[in] HobList The start of HobList passed to DxeCore.
  52. **/
  53. VOID
  54. HandOffToDxeCore (
  55. IN EFI_PHYSICAL_ADDRESS DxeCoreEntryPoint,
  56. IN EFI_PEI_HOB_POINTERS HobList
  57. );
  58. /**
  59. Updates the Stack HOB passed to DXE phase.
  60. This function traverses the whole HOB list and update the stack HOB to
  61. reflect the real stack that is used by DXE core.
  62. @param[in] BaseAddress The lower address of stack used by DxeCore.
  63. @param[in] Length The length of stack used by DxeCore.
  64. **/
  65. VOID
  66. UpdateStackHob (
  67. IN EFI_PHYSICAL_ADDRESS BaseAddress,
  68. IN UINT64 Length
  69. );
  70. /**
  71. The ExtractSection() function processes the input section and
  72. returns a pointer to the section contents. If the section being
  73. extracted does not require processing (if the section
  74. GuidedSectionHeader.Attributes has the
  75. EFI_GUIDED_SECTION_PROCESSING_REQUIRED field cleared), then
  76. OutputBuffer is just updated to point to the start of the
  77. section's contents. Otherwise, *Buffer must be allocated
  78. from PEI permanent memory.
  79. @param[in] This Indicates the
  80. EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI instance.
  81. Buffer containing the input GUIDed section to be
  82. processed. OutputBuffer OutputBuffer is
  83. allocated from PEI permanent memory and contains
  84. the new section stream.
  85. @param[in] InputSection A pointer to the input buffer, which contains
  86. the input section to be processed.
  87. @param[out] OutputBuffer A pointer to a caller-allocated buffer, whose
  88. size is specified by the contents of OutputSize.
  89. @param[out] OutputSize A pointer to a caller-allocated
  90. UINTN in which the size of *OutputBuffer
  91. allocation is stored. If the function
  92. returns anything other than EFI_SUCCESS,
  93. the value of OutputSize is undefined.
  94. @param[out] AuthenticationStatus A pointer to a caller-allocated
  95. UINT32 that indicates the
  96. authentication status of the
  97. output buffer. If the input
  98. section's GuidedSectionHeader.
  99. Attributes field has the
  100. EFI_GUIDED_SECTION_AUTH_STATUS_VALID
  101. bit as clear,
  102. AuthenticationStatus must return
  103. zero. These bits reflect the
  104. status of the extraction
  105. operation. If the function
  106. returns anything other than
  107. EFI_SUCCESS, the value of
  108. AuthenticationStatus is
  109. undefined.
  110. @retval EFI_SUCCESS The InputSection was
  111. successfully processed and the
  112. section contents were returned.
  113. @retval EFI_OUT_OF_RESOURCES The system has insufficient
  114. resources to process the request.
  115. @retval EFI_INVALID_PARAMETER The GUID in InputSection does
  116. not match this instance of the
  117. GUIDed Section Extraction PPI.
  118. **/
  119. EFI_STATUS
  120. EFIAPI
  121. CustomGuidedSectionExtract (
  122. IN CONST EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI *This,
  123. IN CONST VOID *InputSection,
  124. OUT VOID **OutputBuffer,
  125. OUT UINTN *OutputSize,
  126. OUT UINT32 *AuthenticationStatus
  127. );
  128. /**
  129. Decompresses a section to the output buffer.
  130. This function looks up the compression type field in the input section and
  131. applies the appropriate compression algorithm to compress the section to a
  132. callee allocated buffer.
  133. @param[in] This Points to this instance of the
  134. EFI_PEI_DECOMPRESS_PEI PPI.
  135. @param[in] CompressionSection Points to the compressed section.
  136. @param[out] OutputBuffer Holds the returned pointer to the decompressed
  137. sections.
  138. @param[out] OutputSize Holds the returned size of the decompress
  139. section streams.
  140. @retval EFI_SUCCESS The section was decompressed successfully.
  141. OutputBuffer contains the resulting data and
  142. OutputSize contains the resulting size.
  143. **/
  144. EFI_STATUS
  145. EFIAPI
  146. Decompress (
  147. IN CONST EFI_PEI_DECOMPRESS_PPI *This,
  148. IN CONST EFI_COMPRESSION_SECTION *CompressionSection,
  149. OUT VOID **OutputBuffer,
  150. OUT UINTN *OutputSize
  151. );
  152. #endif