]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/SecCore/SecMain.h
UefiCpuPkg/SecCore: Support EFI_PEI_CORE_FV_LOCATION_PPI
[mirror_edk2.git] / UefiCpuPkg / SecCore / SecMain.h
CommitLineData
1921695e
MK
1/** @file\r
2 Master header file for SecCore.\r
3\r
373c2c5b 4 Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.<BR>\r
1921695e
MK
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _SEC_CORE_H_\r
16#define _SEC_CORE_H_\r
17\r
18#include <PiPei.h>\r
19\r
863c738c 20#include <Ppi/SecPlatformInformation2.h>\r
1921695e 21#include <Ppi/TemporaryRamDone.h>\r
f2e70629 22#include <Ppi/SecPerformance.h>\r
373c2c5b 23#include <Ppi/PeiCoreFvLocation.h>\r
f2e70629
SZ
24\r
25#include <Guid/FirmwarePerformance.h>\r
1921695e 26\r
1921695e
MK
27#include <Library/DebugLib.h>\r
28#include <Library/PcdLib.h>\r
29#include <Library/BaseMemoryLib.h>\r
30#include <Library/PlatformSecLib.h>\r
31#include <Library/UefiCpuLib.h>\r
32#include <Library/PeCoffGetEntryPointLib.h>\r
33#include <Library/PeCoffExtraActionLib.h>\r
34#include <Library/DebugAgentLib.h>\r
35#include <Library/CpuExceptionHandlerLib.h>\r
36#include <Library/ReportStatusCodeLib.h>\r
863c738c
JF
37#include <Library/PeiServicesTablePointerLib.h>\r
38#include <Library/HobLib.h>\r
39#include <Library/PeiServicesLib.h>\r
1921695e
MK
40\r
41#define SEC_IDT_ENTRY_COUNT 34\r
42\r
43typedef struct _SEC_IDT_TABLE {\r
44 //\r
45 // Reserved 8 bytes preceding IDT to store EFI_PEI_SERVICES**, since IDT base\r
46 // address should be 8-byte alignment.\r
47 // Note: For IA32, only the 4 bytes immediately preceding IDT is used to store\r
48 // EFI_PEI_SERVICES**\r
49 //\r
50 UINT64 PeiService;\r
51 UINT64 IdtTable[SEC_IDT_ENTRY_COUNT];\r
52} SEC_IDT_TABLE;\r
53\r
54/**\r
55 TemporaryRamDone() disables the use of Temporary RAM. If present, this service is invoked\r
56 by the PEI Foundation after the EFI_PEI_PERMANANT_MEMORY_INSTALLED_PPI is installed.\r
57\r
58 @retval EFI_SUCCESS Use of Temporary RAM was disabled.\r
59 @retval EFI_INVALID_PARAMETER Temporary RAM could not be disabled.\r
60\r
61**/\r
62EFI_STATUS\r
63EFIAPI\r
64SecTemporaryRamDone (\r
65 VOID\r
66 );\r
67\r
68/**\r
69 Entry point to the C language phase of SEC. After the SEC assembly\r
70 code has initialized some temporary memory and set up the stack,\r
71 the control is transferred to this function.\r
72\r
73 @param SizeOfRam Size of the temporary memory available for use.\r
74 @param TempRamBase Base address of temporary ram\r
75 @param BootFirmwareVolume Base address of the Boot Firmware Volume.\r
76**/\r
77VOID\r
7cd8a575 78NORETURN\r
1921695e
MK
79EFIAPI\r
80SecStartup (\r
81 IN UINT32 SizeOfRam,\r
82 IN UINT32 TempRamBase,\r
83 IN VOID *BootFirmwareVolume\r
84 );\r
85\r
86/**\r
87 Find and return Pei Core entry point.\r
88\r
89 It also find SEC and PEI Core file debug information. It will report them if\r
90 remote debug is enabled.\r
91\r
92 @param BootFirmwareVolumePtr Point to the boot firmware volume.\r
93 @param PeiCoreEntryPoint Point to the PEI core entry point.\r
94\r
95**/\r
96VOID\r
97EFIAPI\r
98FindAndReportEntryPoints (\r
99 IN EFI_FIRMWARE_VOLUME_HEADER *BootFirmwareVolumePtr,\r
100 OUT EFI_PEI_CORE_ENTRY_POINT *PeiCoreEntryPoint\r
101 );\r
102\r
103/**\r
104 Auto-generated function that calls the library constructors for all of the module's\r
105 dependent libraries. This function must be called by the SEC Core once a stack has\r
106 been established.\r
107\r
108**/\r
109VOID\r
110EFIAPI\r
111ProcessLibraryConstructorList (\r
112 VOID\r
113 );\r
114\r
8a5b8cef
JF
115/**\r
116 Implementation of the PlatformInformation service in EFI_SEC_PLATFORM_INFORMATION_PPI.\r
117\r
118 @param PeiServices Pointer to the PEI Services Table.\r
119 @param StructureSize Pointer to the variable describing size of the input buffer.\r
120 @param PlatformInformationRecord Pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD.\r
121\r
122 @retval EFI_SUCCESS The data was successfully returned.\r
123 @retval EFI_BUFFER_TOO_SMALL The buffer was too small.\r
124\r
125**/\r
126EFI_STATUS\r
127EFIAPI\r
128SecPlatformInformationBist (\r
129 IN CONST EFI_PEI_SERVICES **PeiServices,\r
130 IN OUT UINT64 *StructureSize,\r
131 OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord\r
132 );\r
133\r
134/**\r
135 Implementation of the PlatformInformation2 service in EFI_SEC_PLATFORM_INFORMATION2_PPI.\r
136\r
137 @param PeiServices The pointer to the PEI Services Table.\r
138 @param StructureSize The pointer to the variable describing size of the input buffer.\r
139 @param PlatformInformationRecord2 The pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD2.\r
140\r
141 @retval EFI_SUCCESS The data was successfully returned.\r
142 @retval EFI_BUFFER_TOO_SMALL The buffer was too small. The current buffer size needed to\r
143 hold the record is returned in StructureSize.\r
144\r
145**/\r
146EFI_STATUS\r
147EFIAPI\r
148SecPlatformInformation2Bist (\r
149 IN CONST EFI_PEI_SERVICES **PeiServices,\r
150 IN OUT UINT64 *StructureSize,\r
151 OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2\r
152 );\r
153\r
154/**\r
155 Republish SecPlatformInformationPpi/SecPlatformInformation2Ppi.\r
156\r
157**/\r
158VOID\r
159RepublishSecPlatformInformationPpi (\r
160 VOID\r
161 );\r
162\r
f2e70629
SZ
163/**\r
164 Entry point of the notification callback function itself within the PEIM.\r
165 It is to get SEC performance data and build HOB to convey the SEC performance\r
166 data to DXE phase.\r
167\r
168 @param PeiServices Indirect reference to the PEI Services Table.\r
169 @param NotifyDescriptor Address of the notification descriptor data structure.\r
170 @param Ppi Address of the PPI that was installed.\r
171\r
172 @return Status of the notification.\r
173 The status code returned from this function is ignored.\r
174**/\r
175EFI_STATUS\r
176EFIAPI\r
177SecPerformancePpiCallBack (\r
178 IN EFI_PEI_SERVICES **PeiServices,\r
179 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
180 IN VOID *Ppi\r
181 );\r
182\r
1921695e 183#endif\r