TianoCore EDK2 master
|
#include <PiPei.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PeiServicesLib.h>
#include <Library/PcdLib.h>
#include <Library/CpuLib.h>
#include <Library/DebugAgentLib.h>
#include <Library/IoLib.h>
#include <Library/PeCoffLib.h>
#include <Library/PeCoffGetEntryPointLib.h>
#include <Library/PeCoffExtraActionLib.h>
#include <Library/ExtractGuidedSectionLib.h>
#include <Library/LocalApicLib.h>
#include <Library/CpuExceptionHandlerLib.h>
#include <Ppi/TemporaryRamSupport.h>
#include <Ppi/MpInitLibDep.h>
#include <Library/TdxHelperLib.h>
#include <Library/CcProbeLib.h>
#include <Register/Intel/ArchitecturalMsr.h>
#include <Register/Intel/Cpuid.h>
#include "AmdSev.h"
Go to the source code of this file.
Data Structures | |
struct | _SEC_IDT_TABLE |
Macros | |
#define | SEC_IDT_ENTRY_COUNT 34 |
Typedefs | |
typedef struct _SEC_IDT_TABLE | SEC_IDT_TABLE |
Variables | |
EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI | mTemporaryRamSupportPpi |
EFI_PEI_PPI_DESCRIPTOR | mPrivateDispatchTableMp [] |
EFI_PEI_PPI_DESCRIPTOR | mPrivateDispatchTableUp [] |
IA32_IDT_GATE_DESCRIPTOR | mIdtEntryTemplate |
Main SEC phase code. Transitions to PEI.
Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
Copyright (c) 2020, Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SecMain.c.
EFI_STATUS DecompressMemFvs | ( | IN OUT EFI_FIRMWARE_VOLUME_HEADER ** | Fv | ) |
Locates the compressed main firmware volume and decompresses it.
[in,out] | Fv | On input, the firmware volume to search On output, the decompressed BOOT/PEI FV |
EFI_SUCCESS | The file and section was found |
EFI_NOT_FOUND | The file and section was not found |
EFI_VOLUME_CORRUPTED | The firmware volume was corrupted |
VOID FindAndReportEntryPoints | ( | IN EFI_FIRMWARE_VOLUME_HEADER ** | BootFirmwareVolumePtr, |
OUT EFI_PEI_CORE_ENTRY_POINT * | PeiCoreEntryPoint | ||
) |
EFI_STATUS FindFfsFileAndSection | ( | IN EFI_FIRMWARE_VOLUME_HEADER * | Fv, |
IN EFI_FV_FILETYPE | FileType, | ||
IN EFI_SECTION_TYPE | SectionType, | ||
OUT EFI_COMMON_SECTION_HEADER ** | FoundSection | ||
) |
Locates a FFS file with the specified file type and a section within that file with the specified section type.
[in] | Fv | The firmware volume to search |
[in] | FileType | The file type to locate |
[in] | SectionType | The section type to locate |
[out] | FoundSection | The FFS section if found |
EFI_SUCCESS | The file and section was found |
EFI_NOT_FOUND | The file and section was not found |
EFI_VOLUME_CORRUPTED | The firmware volume was corrupted |
EFI_STATUS FindFfsSectionInSections | ( | IN VOID * | Sections, |
IN UINTN | SizeOfSections, | ||
IN EFI_SECTION_TYPE | SectionType, | ||
OUT EFI_COMMON_SECTION_HEADER ** | FoundSection | ||
) |
Locates a section within a series of sections with the specified section type.
[in] | Sections | The sections to search |
[in] | SizeOfSections | Total size of all sections |
[in] | SectionType | The section type to locate |
[out] | FoundSection | The FFS section if found |
EFI_SUCCESS | The file and section was found |
EFI_NOT_FOUND | The file and section was not found |
EFI_VOLUME_CORRUPTED | The firmware volume was corrupted |
EFI_STATUS FindFfsSectionInstance | ( | IN VOID * | Sections, |
IN UINTN | SizeOfSections, | ||
IN EFI_SECTION_TYPE | SectionType, | ||
IN UINTN | Instance, | ||
OUT EFI_COMMON_SECTION_HEADER ** | FoundSection | ||
) |
Locates a section within a series of sections with the specified section type.
The Instance parameter indicates which instance of the section type to return. (0 is first instance, 1 is second...)
[in] | Sections | The sections to search |
[in] | SizeOfSections | Total size of all sections |
[in] | SectionType | The section type to locate |
[in] | Instance | The section instance number |
[out] | FoundSection | The FFS section if found |
EFI_SUCCESS | The file and section was found |
EFI_NOT_FOUND | The file and section was not found |
EFI_VOLUME_CORRUPTED | The firmware volume was corrupted |
EFI_STATUS FindImageBase | ( | IN EFI_FIRMWARE_VOLUME_HEADER * | BootFirmwareVolumePtr, |
OUT EFI_PHYSICAL_ADDRESS * | SecCoreImageBase | ||
) |
EFI_STATUS FindMainFv | ( | IN OUT EFI_FIRMWARE_VOLUME_HEADER ** | BootFv | ) |
Locates the main boot firmware volume.
[in,out] | BootFv | On input, the base of the BootFv On output, the decompressed main firmware volume |
EFI_SUCCESS | The main firmware volume was located and decompressed |
EFI_NOT_FOUND | The main firmware volume was not found |
VOID FindPeiCoreImageBase | ( | IN OUT EFI_FIRMWARE_VOLUME_HEADER ** | BootFv, |
OUT EFI_PHYSICAL_ADDRESS * | PeiCoreImageBase | ||
) |
Locates the PEI Core entry point address
[in,out] | Fv | The firmware volume to search |
[out] | PeiCoreEntryPoint | The entry point of the PEI Core image |
EFI_SUCCESS | The file and section was found |
EFI_NOT_FOUND | The file and section was not found |
EFI_VOLUME_CORRUPTED | The firmware volume was corrupted |
EFI_STATUS FindPeiCoreImageBaseInFv | ( | IN EFI_FIRMWARE_VOLUME_HEADER * | Fv, |
OUT EFI_PHYSICAL_ADDRESS * | PeiCoreImageBase | ||
) |
Locates the PEI Core entry point address
[in] | Fv | The firmware volume to search |
[out] | PeiCoreEntryPoint | The entry point of the PEI Core image |
EFI_SUCCESS | The file and section was found |
EFI_NOT_FOUND | The file and section was not found |
EFI_VOLUME_CORRUPTED | The firmware volume was corrupted |
STATIC EFI_STATUS GetS3ResumePeiFv | ( | IN OUT EFI_FIRMWARE_VOLUME_HEADER ** | PeiFv | ) |
VOID EFIAPI SecCoreStartupWithStack | ( | IN EFI_FIRMWARE_VOLUME_HEADER * | BootFv, |
IN VOID * | TopOfCurrentStack | ||
) |
VOID EFIAPI SecStartupPhase2 | ( | IN VOID * | Context | ) |
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.
[in] | Context | The first input parameter of InitializeDebugAgent(). |
EFI_STATUS EFIAPI TemporaryRamMigration | ( | IN CONST EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PHYSICAL_ADDRESS | TemporaryMemoryBase, | ||
IN EFI_PHYSICAL_ADDRESS | PermanentMemoryBase, | ||
IN UINTN | CopySize | ||
) |
IA32_IDT_GATE_DESCRIPTOR mIdtEntryTemplate |
EFI_PEI_PPI_DESCRIPTOR mPrivateDispatchTableMp[] |
EFI_PEI_PPI_DESCRIPTOR mPrivateDispatchTableUp[] |
EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI mTemporaryRamSupportPpi |