; For IA32, the reset vector must be at 0xFFFFFFF0, i.e., 4G-16 byte; Execution starts here upon power-on/platform-reset.;ResetHandler:nopnopApStartup:;; Jmp Rel16 instruction; Use machine code directly in case of the assembler optimization; SEC entry point relative address will be fixed up by some build tool.;; Typically, SEC entry point is the function _ModuleEntryPoint() defined in; SecEntry.asm;DB 0e9hDW -3
VOIDReportPreMemFv (VOID);
EFI_STATUSEFIAPIBoardDetect (VOID);
EFI_STATUSEFIAPIBoardDebugInit (VOID);
/**Performs platform specific initialization required for the CPU to accessthe hardware associated with a SerialPortLib instance. This function doesnot initialize the serial port hardware itself. Instead, it initializeshardware devices that are required for the CPU to access the serial porthardware. This function may be called more than once.​@retval RETURN_SUCCESS The platform specific initialization succeeded.@retval RETURN_DEVICE_ERROR The platform specific initialization could not be completed.​**/RETURN_STATUSEFIAPIPlatformHookSerialPortInitialize (VOID);
EFI_BOOT_MODEEFIAPIBoardBootModeDetect (VOID);
EFI_STATUSEFIAPIBoardInitBeforeMemoryInit (VOID);
/**Performs silicon pre-memory policy update.​The meaning of Policy is defined by silicon code.It could be the raw data, a handle, a PPI, etc.​The input Policy must be returned by SiliconPolicyDonePreMemory().​1) In FSP path, the input Policy should be FspmUpd.A platform may use this API to update the FSPM UPD policy initializedby the silicon module or the default UPD data.The output of FSPM UPD data from this API is the final UPD data.​2) In non-FSP path, the board may use additional way to getthe silicon policy data field based upon the input Policy.​@param[in, out] Policy Pointer to policy.​@return the updated policy.**/VOID *EFIAPISiliconPolicyUpdatePreMemory (IN OUT VOID *Policy);
VOIDReportPostMemFv (VOID);
EFI_STATUSEFIAPIBoardInitAfterMemoryInit (VOID);
TODO: Add prototype
EFI_STATUSEFIAPIBoardInitBeforeSiliconInit (VOID);
/**Performs silicon post-memory policy update.​The meaning of Policy is defined by silicon code.It could be the raw data, a handle, a PPI, etc.​The input Policy must be returned by SiliconPolicyDonePostMemory().​1) In FSP path, the input Policy should be FspsUpd.A platform may use this API to update the FSPS UPD policy initializedby the silicon module or the default UPD data.The output of FSPS UPD data from this API is the final UPD data.​2) In non-FSP path, the board may use additional way to getthe silicon policy data field based upon the input Policy.​@param[in, out] Policy Pointer to policy.​@return the updated policy.**/VOID *EFIAPISiliconPolicyUpdatePostMemory (IN OUT VOID *Policy);
EFI_STATUSEFIAPIBoardInitAfterSiliconInit (VOID);
/**Update MTRR setting and set write back as default memory attribute.​@retval EFI_SUCCESS The function completes successfully.@retval Others Some error occurs.**/EFI_STATUSEFIAPISetCacheMtrrAfterEndOfPei (VOID)
/**Performs silicon late policy update.​The meaning of Policy is defined by silicon code.It could be the raw data, a handle, a Protocol, etc.​The input Policy must be returned by SiliconPolicyDoneLate().​In FSP or non-FSP path, the board may use additional way to getthe silicon policy data field based upon the input Policy.​@param[in, out] Policy Pointer to policy.​@return the updated policy.**/VOID *EFIAPISiliconPolicyUpdateLate (IN OUT VOID *Policy);
/**Do the platform specific action before the console is connected.​Such as:Update console variable;Register new Driver#### or Boot####;Signal ReadyToLock event.**/VOIDEFIAPIPlatformBootManagerBeforeConsole (VOID);
EFI_STATUSEFIAPIBoardInitAfterPciEnumeration (VOID);
/**Do the platform specific action after the console is connected.​Such as:Dynamically switch output mode;Signal console ready platform customized event;Run diagnostics like memory testing;Connect certain devices;Dispatch additional option roms.**/VOIDEFIAPIPlatformBootManagerAfterConsole (VOID);
EFI_STATUSEFIAPIBoardInitReadyToBoot (VOID);
D.1.3.6 PlatformCreateAcpiTable
TODO: Add prototype
D.1.3.7 PlatformUpdateAcpiTable
TODO: Add prototype
D.1.3.8 PlatformInstallAcpiTable
TODO: Add prototype
EFI_STATUSEFIAPIBoardInitEndOfFirmware (VOID);
D.1.4.1 BoardEnableAcpiCallback
TODO: Add prototype
D.1.5.1 TempRamInit
TODO: Add prototype
/**Performs silicon pre-memory policy initialization.​The meaning of Policy is defined by silicon code.It could be the raw data, a handle, a PPI, etc.​The returned data must be used as input data for SiliconPolicyDonePreMemory(),and SiliconPolicyUpdateLib.SiliconPolicyUpdatePreMemory().​1) In FSP path, the input Policy should be FspmUpd.Value of FspmUpd has been initialized by FSP binary default value.Only a subset of FspmUpd needs to be updated for different silicon sku.The return data is same FspmUpd.​2) In non-FSP path, the input policy could be NULL.The return data is the initialized policy.​@param[in, out] Policy Pointer to policy.​@return the initialized policy.**/VOID *EFIAPISiliconPolicyInitPreMemory (IN OUT VOID *Policy OPTIONAL);
/*The silicon pre-memory policy is finalized.Silicon code can do initialization based upon the policy data.​The input Policy must be returned by SiliconPolicyInitPreMemory().​@param[in] Policy Pointer to policy.​@retval RETURN_SUCCESS The policy is handled consumed by silicon code.*/RETURN_STATUSEFIAPISiliconPolicyDonePreMemory (IN VOID *Policy);
/**This function1. Calling MRC to initialize memory.2. Install EFI Memory.3. Capsule coalesce if capsule boot mode.4. Create HOB of system memory.​@param PeiServices Pointer to the PEI Service Table​@retval EFI_SUCCESS If it completes successfully.​**/EFI_STATUSMemoryInit (IN EFI_PEI_SERVICES **PeiServices);
/**Performs silicon post-memory policy initialization.​The meaning of Policy is defined by silicon code.It could be the raw data, a handle, a PPI, etc.​The returned data must be used as input data for SiliconPolicyDonePostMemory(),and SiliconPolicyUpdateLib.SiliconPolicyUpdatePostMemory().​1) In FSP path, the input Policy should be FspsUpd.Value of FspsUpd has been initialized by FSP binary default value.Only a subset of FspsUpd needs to be updated for different silicon sku.The return data is same FspsUpd.​2) In non-FSP path, the input policy could be NULL.The return data is the initialized policy.​@param[in, out] Policy Pointer to policy.​@return the initialized policy.**/VOID *EFIAPISiliconPolicyInitPostMemory (IN OUT VOID *Policy OPTIONAL);
/*The silicon post-mem policy is finalized.Silicon code can do initialization based upon the policy data.​The input Policy must be returned by SiliconPolicyInitPostMemory().​@param[in] Policy Pointer to policy.​@retval RETURN_SUCCESS The policy is handled consumed by silicon code.*/RETURN_STATUSEFIAPISiliconPolicyDonePostMemory (IN VOID *Policy);
D.1.6.6 SiliconInit
TODO: Add prototype
/**Performs silicon late policy initialization.​The meaning of Policy is defined by silicon code.It could be the raw data, a handle, a protocol, etc.​The returned data must be used as input data for SiliconPolicyDoneLate(),and SiliconPolicyUpdateLib.SiliconPolicyUpdateLate().​In FSP or non-FSP path, the input policy could be NULL.The return data is the initialized policy.​@param[in, out] Policy Pointer to policy.​@return the initialized policy.**/VOID *EFIAPISiliconPolicyInitLate (IN OUT VOID *Policy);
/*The silicon late policy is finalized.Silicon code can do initialization based upon the policy data.​The input Policy must be returned by SiliconPolicyInitLate().​@param[in] Policy Pointer to policy.​@retval RETURN_SUCCESS The policy is handled consumed by silicon code.*/RETURN_STATUSEFIAPISiliconPolicyDoneLate (IN VOID *Policy);
D.1.7.3 SiliconInitAfterPciEnumeration
TODO: Add prototype
/**The callback function to handle subsequent SMIs. This callback will be called by SmmCoreDispatcher.​@param[in] SmmImageHandle Not used@param[in] PchSmmCore Not used@param[in, out] CommunicationBuffer Not used@param[in, out] SourceSize Not used​@retval EFI_SUCCESS Function successfully completed**/EFI_STATUSEFIAPIPchSmmCoreDispatcher (IN EFI_HANDLE SmmImageHandle,IN CONST VOID *PchSmmCore,IN OUT VOID *CommunicationBuffer,IN OUT UINTN *SourceSize);
VOIDExitPmAuth (VOID);
/**Entry point to the C language phase of SEC. After the SEC assemblycode has initialized some temporary memory and set up the stack,the control is transferred to this function.​@param SizeOfRam Size of the temporary memory available for use.@param TempRamBase Base address of temporary ram@param BootFirmwareVolume Base address of the Boot Firmware Volume.**/VOIDEFIAPISecStartup (IN UINT32 SizeOfRam,IN UINT32 TempRamBase,IN VOID *BootFirmwareVolume);
/**Caller provided function to be invoked at the end of InitializeDebugAgent().​Entry point to the C language phase of SEC. After the SEC assemblycode 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().​**/VOIDNORETURNEFIAPISecStartupPhase2 (IN VOID *Context);
/**This routine is invoked by main entry of PeiMain module during transitionfrom SEC to PEI. After switching stack in the PEI core, it will restartwith the old core data.​@param SecCoreDataPtr Points to a data structure containing information about the PEI core's operatingenvironment, such as the size and location of temporary RAM, the stack location andthe BFV location.@param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.An empty PPI list consists of a single descriptor with the end-tagEFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initializationphase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database suchthat both the PEI Foundation and any modules can leverage the associated servicecalls and/or code in these early PPIs@param Data Pointer to old core data that is used to initialize thecore's data areas.If NULL, it is first PeiCore entering.​**/VOIDEFIAPIPeiCore (IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreDataPtr,IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,IN VOID *Data);
/**Conduct PEIM dispatch.​@param SecCoreData Pointer to the data structure containing SEC to PEI handoff data@param PrivateData Pointer to the private data passed in from caller​**/VOIDPeiDispatcher (IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,IN PEI_CORE_INSTANCE *PrivateData);
/**TemporaryRamDone() disables the use of Temporary RAM. If present, this service is invokedby the PEI Foundation after the EFI_PEI_PERMANANT_MEMORY_INSTALLED_PPI is installed.​@retval EFI_SUCCESS Use of Temporary RAM was disabled.@retval EFI_INVALID_PARAMETER Temporary RAM could not be disabled.​**/EFI_STATUSEFIAPISecTemporaryRamDone (VOID);
/**Main entry point to last PEIM​@param This Entry point for DXE IPL PPI@param PeiServices General purpose services available to every PEIM.@param HobList Address to the Pei HOB list​@return EFI_SUCCESS DXE core was successfully loaded.@return EFI_OUT_OF_RESOURCES There are not enough resources to load DXE core.​**/EFI_STATUSEFIAPIDxeLoadCore (IN CONST EFI_DXE_IPL_PPI *This,IN EFI_PEI_SERVICES **PeiServices,IN EFI_PEI_HOB_POINTERS HobList);
#### D.1.12.1 DxeMain (*)​```c/**Main entry point to DXE Core.​@param HobStart Pointer to the beginning of the HOB List from PEI.​@return This function should never return.​**/VOIDEFIAPIDxeMain (IN VOID *HobStart);
/**Transfer control to a loaded image's entry point.​@param ImageHandle Handle of image to be started.@param ExitDataSize Pointer of the size to ExitData@param ExitData Pointer to a pointer to a data buffer thatincludes a Null-terminated string,optionally followed by additional binary data.The string is a description that the caller mayuse to further indicate the reason for theimage's exit.​@retval EFI_INVALID_PARAMETER Invalid parameter@retval EFI_OUT_OF_RESOURCES No enough buffer to allocate@retval EFI_SECURITY_VIOLATION The current platform policy specifies that the image should not be started.@retval EFI_SUCCESS Successfully transfer control to the image'sentry point.​**/EFI_STATUSEFIAPICoreStartImage (IN EFI_HANDLE ImageHandle,OUT UINTN *ExitDataSize,OUT CHAR16 **ExitData OPTIONAL);
/**Return TRUE if all AP services are available.​@retval EFI_SUCCESS All AP services are available@retval EFI_NOT_FOUND At least one AP service is not available​**/EFI_STATUSCoreAllEfiServicesAvailable (VOID);
/**​Service routine for BdsInstance->Entry(). Devices are connected, theconsoles are initialized, and the boot options are tried.​@param This Protocol Instance structure.​**/VOIDEFIAPIBdsEntry (IN EFI_BDS_ARCH_PROTOCOL *This);
IN EFI_BDS_ARCH_PROTOCOL ``*This
);
/**Dispatch the deferred images that are returned from all DeferredImageLoad instances.​@retval EFI_SUCCESS At least one deferred image is loaded successfully and started.@retval EFI_NOT_FOUND There is no deferred image.@retval EFI_ACCESS_DENIED There are deferred images but all of them are failed to load.**/EFI_STATUSEFIAPIEfiBootManagerDispatchDeferredImages (VOID);
/**Attempt to boot each boot option in the BootOptions array.​@param BootOptions Input boot option array.@param BootOptionCount Input boot option count.@param BootManagerMenu Input boot manager menu.​@retval TRUE Successfully boot one of the boot options.@retval FALSE Failed boot any of the boot options.**/BOOLEANBootBootOptions (IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions,IN UINTN BootOptionCount,IN EFI_BOOT_MANAGER_LOAD_OPTION *BootManagerMenu OPTIONAL);
/**Create, Signal, and Close the Ready to Boot event using EfiSignalEventReadyToBoot().​This function abstracts the signaling of the Ready to Boot Event. The Framework movedfrom a proprietary to UEFI 2.0 based mechanism. This library abstracts the callerfrom how this event is created to prevent to code form having to change with theversion of the specification supported.​**/VOIDEFIAPIEfiSignalEventReadyToBoot (VOID);
/**The entry point for the application.​@param[in] ImageHandle The firmware allocated handle for the EFI image.@param[in] SystemTable A pointer to the EFI System Table.​@retval EFI_SUCCESS The entry point is executed successfully.@retval other Some error occurs when executing this entry point.​**/EFI_STATUSEFIAPIUefiMain (IN EFI_HANDLE ImageHandle,IN EFI_SYSTEM_TABLE *SystemTable);
/**Terminates all boot services.​@param ImageHandle Handle that identifies the exiting image.@param MapKey Key to the latest memory map.​@retval EFI_SUCCESS Boot Services terminated@retval EFI_INVALID_PARAMETER MapKey is incorrect.​**/EFI_STATUSEFIAPICoreExitBootServices (IN EFI_HANDLE ImageHandle,IN UINTN MapKey);
/**Changes the runtime addressing mode of EFI firmware from physical to virtual.​@param MemoryMapSize The size in bytes of VirtualMap.@param DescriptorSize The size in bytes of an entry in the VirtualMap.@param DescriptorVersion The version of the structure entries in VirtualMap.@param VirtualMap An array of memory descriptors which contain new virtualaddress mapping information for all runtime ranges.​@retval EFI_SUCCESS The virtual address map has been applied.@retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already invirtual address mapped mode.@retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.@retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memorymap that requires a mapping.@retval EFI_NOT_FOUND A virtual address was supplied for an address that is not foundin the memory map.​**/EFI_STATUSEFIAPIRuntimeDriverSetVirtualAddressMap (IN UINTN MemoryMapSize,IN UINTN DescriptorSize,IN UINT32 DescriptorVersion,IN EFI_MEMORY_DESCRIPTOR *VirtualMap);
/**The Entry Point for SMM IPL​Load SMM Core into SMRAM, register SMM Core entry point for SMIs, installSMM Base 2 Protocol and SMM Communication Protocol, and register for thecritical events required to coordinate between DXE and SMM environments.​@param ImageHandle The firmware allocated handle for the EFI image.@param SystemTable A pointer to the EFI System Table.​@retval EFI_SUCCESS The entry point is executed successfully.@retval Other Some error occurred when executing this entry point.​**/EFI_STATUSEFIAPISmmIplEntry (IN EFI_HANDLE ImageHandle,IN EFI_SYSTEM_TABLE *SystemTable);
/**The Entry Point for SMM Core​Install DXE Protocols and reload SMM Core into SMRAM and register SMM CoreEntryPoint on the SMI vector.​Note: This function is called for both DXE invocation and SMRAM invocation.​@param ImageHandle The firmware allocated handle for the EFI image.@param SystemTable A pointer to the EFI System Table.​@retval EFI_SUCCESS The entry point is executed successfully.@retval Other Some error occurred when executing this entry point.​**/EFI_STATUSEFIAPISmmMain (IN EFI_HANDLE ImageHandle,IN EFI_SYSTEM_TABLE *SystemTable);
/**The module Entry Point of the CPU SMM driver.​@param ImageHandle The firmware allocated handle for the EFI image.@param SystemTable A pointer to the EFI System Table.​@retval EFI_SUCCESS The entry point is executed successfully.@retval Other Some error occurs when executing this entry point.​**/EFI_STATUSEFIAPIPiCpuSmmEntry (IN EFI_HANDLE ImageHandle,IN EFI_SYSTEM_TABLE *SystemTable);
/**Relocate SmmBases for each processor.​Execute on first boot and all S3 resumes​**/VOIDEFIAPISmmRelocateBases (VOID);
TODO: Add prototype
/**The main entry point to SMM Foundation.​Note: This function is only used by SMRAM invocation. It is never used by DXE invocation.​@param SmmEntryContext Processor information and functionalityneeded by SMM Foundation.​**/VOIDEFIAPISmmEntryPoint (IN CONST EFI_SMM_ENTRY_CONTEXT *SmmEntryContext);
TODO: Add prototype