+++ /dev/null
-/** @file\r
- Sample to provide FSP wrapper platform sec related function.\r
-\r
- Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
- SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include <PiPei.h>\r
-\r
-#include <Ppi/SecPlatformInformation.h>\r
-#include <Ppi/SecPerformance.h>\r
-#include <Ppi/TemporaryRamSupport.h>\r
-\r
-#include <Library/LocalApicLib.h>\r
-\r
-/**\r
- This interface conveys state information out of the Security (SEC) phase into PEI.\r
-\r
- @param[in] PeiServices Pointer to the PEI Services Table.\r
- @param[in,out] StructureSize Pointer to the variable describing size of the input buffer.\r
- @param[out] PlatformInformationRecord Pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD.\r
-\r
- @retval EFI_SUCCESS The data was successfully returned.\r
- @retval EFI_BUFFER_TOO_SMALL The buffer was too small.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SecPlatformInformation (\r
- IN CONST EFI_PEI_SERVICES **PeiServices,\r
- IN OUT UINT64 *StructureSize,\r
- OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord\r
- );\r
-\r
-/**\r
- This interface conveys performance information out of the Security (SEC) phase into PEI.\r
-\r
- This service is published by the SEC phase. The SEC phase handoff has an optional\r
- EFI_PEI_PPI_DESCRIPTOR list as its final argument when control is passed from SEC into the\r
- PEI Foundation. As such, if the platform supports collecting performance data in SEC,\r
- this information is encapsulated into the data structure abstracted by this service.\r
- This information is collected for the boot-strap processor (BSP) on IA-32.\r
-\r
- @param[in] PeiServices The pointer to the PEI Services Table.\r
- @param[in] This The pointer to this instance of the PEI_SEC_PERFORMANCE_PPI.\r
- @param[out] Performance The pointer to performance data collected in SEC phase.\r
-\r
- @retval EFI_SUCCESS The data was successfully returned.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SecGetPerformance (\r
- IN CONST EFI_PEI_SERVICES **PeiServices,\r
- IN PEI_SEC_PERFORMANCE_PPI *This,\r
- OUT FIRMWARE_SEC_PERFORMANCE *Performance\r
- );\r
-\r
-/**\r
- This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into\r
- permanent memory.\r
-\r
- @param[in] PeiServices Pointer to the PEI Services Table.\r
- @param[in] TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the\r
- Temporary RAM contents.\r
- @param[in] PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the\r
- Temporary RAM contents.\r
- @param[in] CopySize Amount of memory to migrate from temporary to permanent memory.\r
-\r
- @retval EFI_SUCCESS The data was successfully returned.\r
- @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when\r
- TemporaryMemoryBase > PermanentMemoryBase.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SecTemporaryRamSupport (\r
- IN CONST EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,\r
- IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,\r
- IN UINTN CopySize\r
- );\r
-\r
-EFI_SEC_PLATFORM_INFORMATION_PPI mSecPlatformInformationPpi = {\r
- SecPlatformInformation\r
-};\r
-\r
-PEI_SEC_PERFORMANCE_PPI mSecPerformancePpi = {\r
- SecGetPerformance\r
-};\r
-\r
-EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI gSecTemporaryRamSupportPpi = {\r
- SecTemporaryRamSupport\r
-};\r
-\r
-EFI_PEI_PPI_DESCRIPTOR mPeiSecPlatformPpi[] = {\r
- {\r
- EFI_PEI_PPI_DESCRIPTOR_PPI,\r
- &gEfiSecPlatformInformationPpiGuid,\r
- &mSecPlatformInformationPpi\r
- },\r
- {\r
- EFI_PEI_PPI_DESCRIPTOR_PPI,\r
- &gPeiSecPerformancePpiGuid,\r
- &mSecPerformancePpi\r
- },\r
- {\r
- EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,\r
- &gEfiTemporaryRamSupportPpiGuid,\r
- &gSecTemporaryRamSupportPpi\r
- },\r
-};\r
-\r
-/**\r
- A developer supplied function to perform platform specific operations.\r
-\r
- It's a developer supplied function to perform any operations appropriate to a\r
- given platform. It's invoked just before passing control to PEI core by SEC\r
- core. Platform developer may modify the SecCoreData passed to PEI Core.\r
- It returns a platform specific PPI list that platform wishes to pass to PEI core.\r
- The Generic SEC core module will merge this list to join the final list passed to\r
- PEI core.\r
-\r
- @param[in,out] SecCoreData The same parameter as passing to PEI core. It\r
- could be overridden by this function.\r
-\r
- @return The platform specific PPI list to be passed to PEI core or\r
- NULL if there is no need of such platform specific PPI list.\r
-\r
-**/\r
-EFI_PEI_PPI_DESCRIPTOR *\r
-EFIAPI\r
-SecPlatformMain (\r
- IN OUT EFI_SEC_PEI_HAND_OFF *SecCoreData\r
- )\r
-{\r
- EFI_PEI_PPI_DESCRIPTOR *PpiList;\r
-\r
- InitializeApicTimer (0, (UINT32) -1, TRUE, 5);\r
-\r
- PpiList = &mPeiSecPlatformPpi[0];\r
-\r
- return PpiList;\r
-}\r