]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/SecMigrationPei/SecMigrationPei.h
UefiCpuPkg: Apply uncrustify changes
[mirror_edk2.git] / UefiCpuPkg / SecMigrationPei / SecMigrationPei.h
CommitLineData
479613bd
MK
1/** @file\r
2 Migrates SEC structures after permanent memory is installed.\r
3\r
4 Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#ifndef __SEC_MIGRATION_H__\r
10#define __SEC_MIGRATION_H__\r
11\r
12#include <Base.h>\r
13\r
14#include <Pi/PiPeiCis.h>\r
15#include <Ppi/RepublishSecPpi.h>\r
16#include <Ppi/SecPerformance.h>\r
17#include <Ppi/SecPlatformInformation.h>\r
18#include <Ppi/SecPlatformInformation2.h>\r
19#include <Ppi/TemporaryRamDone.h>\r
20#include <Ppi/TemporaryRamSupport.h>\r
21\r
22/**\r
23 This interface conveys state information out of the Security (SEC) phase into PEI.\r
24\r
25 @param[in] PeiServices Pointer to the PEI Services Table.\r
26 @param[in,out] StructureSize Pointer to the variable describing size of the input buffer.\r
27 @param[out] PlatformInformationRecord Pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD.\r
28\r
29 @retval EFI_SUCCESS The data was successfully returned.\r
30 @retval EFI_NOT_FOUND Can't found the HOB created by SecMigrationPei component.\r
31 @retval EFI_BUFFER_TOO_SMALL The size of buffer pointed by StructureSize is too small and will return\r
32 the minimal required size in the buffer pointed by StructureSize.\r
33 @retval EFI_INVALID_PARAMETER The StructureSize is NULL or PlatformInformationRecord is NULL.\r
34\r
35**/\r
36EFI_STATUS\r
37EFIAPI\r
38SecPlatformInformationPostMemory (\r
053e878b
MK
39 IN CONST EFI_PEI_SERVICES **PeiServices,\r
40 IN OUT UINT64 *StructureSize,\r
41 OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord\r
479613bd
MK
42 );\r
43\r
44/**\r
45 Re-installs the SEC Platform Information PPIs to implementation in this module to support post-memory.\r
46\r
47 @param[in] PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
48 @param[in] NotifyDescriptor Address of the notification descriptor data structure.\r
49 @param[in] Ppi Address of the PPI that was installed.\r
50\r
51 @retval EFI_SUCCESS The SEC Platform Information PPI could not be re-installed.\r
52 @return Others An error occurred during PPI re-install.\r
53\r
54**/\r
55EFI_STATUS\r
56EFIAPI\r
57SecPlatformInformationPpiNotifyCallback (\r
053e878b
MK
58 IN EFI_PEI_SERVICES **PeiServices,\r
59 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
60 IN VOID *Ppi\r
479613bd
MK
61 );\r
62\r
63/**\r
64 This interface re-installs PPIs installed in SecCore from a post-memory PEIM.\r
65\r
66 This is to allow a platform that may not support relocation of SecCore to update the PPI instance to a post-memory\r
67 copy from a PEIM that has been shadowed to permanent memory.\r
68\r
69 @retval EFI_SUCCESS The SecCore PPIs were re-installed successfully.\r
70 @retval Others An error occurred re-installing the SecCore PPIs.\r
71\r
72**/\r
73EFI_STATUS\r
74EFIAPI\r
75RepublishSecPpis (\r
76 VOID\r
77 );\r
78\r
79/**\r
80 Disables the use of Temporary RAM.\r
81\r
82 If present, this service is invoked by the PEI Foundation after\r
83 the EFI_PEI_PERMANANT_MEMORY_INSTALLED_PPI is installed.\r
84\r
85 @retval EFI_SUCCESS Dummy function, alway return this value.\r
86\r
87**/\r
88EFI_STATUS\r
89EFIAPI\r
90SecTemporaryRamDonePostMemory (\r
91 VOID\r
92 );\r
93\r
94/**\r
95 This service of the EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into\r
96 permanent memory.\r
97\r
98 @param PeiServices Pointer to the PEI Services Table.\r
99 @param TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the\r
100 Temporary RAM contents.\r
101 @param PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the\r
102 Temporary RAM contents.\r
103 @param CopySize Amount of memory to migrate from temporary to permanent memory.\r
104\r
105 @retval EFI_SUCCESS The data was successfully returned.\r
106 @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when\r
107 TemporaryMemoryBase > PermanentMemoryBase.\r
108\r
109**/\r
110EFI_STATUS\r
111EFIAPI\r
112SecTemporaryRamSupportPostMemory (\r
053e878b
MK
113 IN CONST EFI_PEI_SERVICES **PeiServices,\r
114 IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,\r
115 IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,\r
116 IN UINTN CopySize\r
479613bd
MK
117 );\r
118\r
119/**\r
120 This interface conveys performance information out of the Security (SEC) phase into PEI.\r
121\r
122 This service is published by the SEC phase. The SEC phase handoff has an optional\r
123 EFI_PEI_PPI_DESCRIPTOR list as its final argument when control is passed from SEC into the\r
124 PEI Foundation. As such, if the platform supports collecting performance data in SEC,\r
125 this information is encapsulated into the data structure abstracted by this service.\r
126 This information is collected for the boot-strap processor (BSP) on IA-32.\r
127\r
128 @param[in] PeiServices The pointer to the PEI Services Table.\r
129 @param[in] This The pointer to this instance of the PEI_SEC_PERFORMANCE_PPI.\r
130 @param[out] Performance The pointer to performance data collected in SEC phase.\r
131\r
132 @retval EFI_SUCCESS The performance data was successfully returned.\r
133 @retval EFI_INVALID_PARAMETER The This or Performance is NULL.\r
134 @retval EFI_NOT_FOUND Can't found the HOB created by the SecMigrationPei component.\r
135\r
136**/\r
137EFI_STATUS\r
138EFIAPI\r
139GetPerformancePostMemory (\r
140 IN CONST EFI_PEI_SERVICES **PeiServices,\r
141 IN PEI_SEC_PERFORMANCE_PPI *This,\r
142 OUT FIRMWARE_SEC_PERFORMANCE *Performance\r
143 );\r
144\r
145typedef struct {\r
053e878b
MK
146 UINT64 StructureSize;\r
147 EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord;\r
479613bd
MK
148} SEC_PLATFORM_INFORMATION_CONTEXT;\r
149\r
150typedef struct {\r
053e878b
MK
151 EFI_HOB_GUID_TYPE Header;\r
152 UINT8 Revision;\r
153 UINT8 Reserved[3];\r
154 FIRMWARE_SEC_PERFORMANCE FirmwareSecPerformance;\r
155 SEC_PLATFORM_INFORMATION_CONTEXT Context;\r
479613bd
MK
156} SEC_PLATFORM_INFORMATION_CONTEXT_HOB;\r
157\r
158#endif\r