SecMain.c revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
1N/A Main SEC phase code. Transitions to PEI. 1N/A Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR> 1N/A This program and the accompanying materials 1N/A are licensed and made available under the terms and conditions of the BSD License 1N/A which accompanies this distribution. The full text of the license may be found at 1N/A THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 1N/A WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // Template of an IDT entry pointing to 10:FFFFFFE4h. Locates the main boot firmware volume. @param[in,out] BootFv On input, the base of the BootFv On output, the decompressed main firmware volume @retval EFI_SUCCESS The main firmware volume was located and decompressed @retval EFI_NOT_FOUND The main firmware volume was not found Locates a section within a series of sections with the specified section type. @param[in] Sections The sections to search @param[in] SizeOfSections Total size of all sections @param[in] SectionType The section type to locate @param[out] FoundSection The FFS section if found @retval EFI_SUCCESS The file and section was found @retval EFI_NOT_FOUND The file and section was not found @retval EFI_VOLUME_CORRUPTED The firmware volume was corrupted // Loop through the FFS file sections within the PEI Core FFS file // Look for the requested section type Locates a FFS file with the specified file type and a section within that file with the specified section type. @param[in] Fv The firmware volume to search @param[in] FileType The file type to locate @param[in] SectionType The section type to locate @param[out] FoundSection The FFS section if found @retval EFI_SUCCESS The file and section was found @retval EFI_NOT_FOUND The file and section was not found @retval EFI_VOLUME_CORRUPTED The firmware volume was corrupted // Loop through the FFS files in the Boot Firmware Volume // Look for the request file type Locates the compressed main firmware volume and decompresses it. @param[in,out] Fv On input, the firmware volume to search On output, the decompressed main FV @retval EFI_SUCCESS The file and section was found @retval EFI_NOT_FOUND The file and section was not found @retval EFI_VOLUME_CORRUPTED The firmware volume was corrupted //PcdGet32 (PcdOvmfMemFvBase), PcdGet32 (PcdOvmfMemFvSize) Locates the PEI Core entry point address @param[in] Fv The firmware volume to search @param[out] PeiCoreEntryPoint The entry point of the PEI Core image @retval EFI_SUCCESS The file and section was found @retval EFI_NOT_FOUND The file and section was not found @retval EFI_VOLUME_CORRUPTED The firmware volume was corrupted Locates the PEI Core entry point address @param[in,out] Fv The firmware volume to search @param[out] PeiCoreEntryPoint The entry point of the PEI Core image @retval EFI_SUCCESS The file and section was found @retval EFI_NOT_FOUND The file and section was not found @retval EFI_VOLUME_CORRUPTED The firmware volume was corrupted // Loop through the FFS files in the Boot Firmware Volume // Loop through the FFS file sections within the FFS file // Look for executable sections Find and return Pei Core entry point. It also find SEC and PEI Core file debug inforamtion. It will report them if // Find SEC Core and PEI Core image base // Report SEC Core debug information when remote debug is enabled // Report PEI Core debug information when remote debug is enabled // Find PEI Core entry point "SecCoreStartupWithStack(0x%x, 0x%x)\n",
// Initialize floating point operating environment // to be compliant with UEFI spec. // |-------------| <-- TopOfCurrentStack // |-------------| <-- SecCoreData.TemporaryRamBase // Initialize SEC hand-off state // Make sure the 8259 is masked before initializing the Debug Agent and the debug timer is enabled // Initialize Debug Agent to support source level debug in SEC/PEI phases before memory ready. Caller provided function to be invoked at the end of InitializeDebugAgent(). Entry point to the C language phase of SEC. After the SEC assembly code has initialized some temporary memory and set up the stack, the control is transferred to this function. @param[in] Context The first input parameter of InitializeDebugAgent(). // Find PEI Core entry point. It will report SEC and Pei Core debug information if remote debug // Transfer the control to the PEI core // If we get here then the PEI Core returned, which is not recoverable. // Rebase IDT table in permanent memory // Use SetJump()/LongJump() to switch to a new stack.