]> git.proxmox.com Git - mirror_edk2.git/blame - UefiCpuPkg/SecCore/SecMain.h
BaseTools:Build fail if define [DEPEX] in library inf
[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
08283b96
CC
92 @param SecCoreFirmwareVolumePtr Point to the firmware volume for finding SecCore.\r
93 @param PeiCoreFirmwareVolumePtr Point to the firmware volume for finding PeiCore.\r
94 @param PeiCoreEntryPoint The entry point of the PEI core.\r
1921695e
MK
95\r
96**/\r
97VOID\r
98EFIAPI\r
99FindAndReportEntryPoints (\r
08283b96
CC
100 IN EFI_FIRMWARE_VOLUME_HEADER *SecCoreFirmwareVolumePtr,\r
101 IN EFI_FIRMWARE_VOLUME_HEADER *PeiCoreFirmwareVolumePtr,\r
1921695e
MK
102 OUT EFI_PEI_CORE_ENTRY_POINT *PeiCoreEntryPoint\r
103 );\r
104\r
105/**\r
106 Auto-generated function that calls the library constructors for all of the module's\r
107 dependent libraries. This function must be called by the SEC Core once a stack has\r
108 been established.\r
109\r
110**/\r
111VOID\r
112EFIAPI\r
113ProcessLibraryConstructorList (\r
114 VOID\r
115 );\r
116\r
8a5b8cef
JF
117/**\r
118 Implementation of the PlatformInformation service in EFI_SEC_PLATFORM_INFORMATION_PPI.\r
119\r
120 @param PeiServices Pointer to the PEI Services Table.\r
121 @param StructureSize Pointer to the variable describing size of the input buffer.\r
122 @param PlatformInformationRecord Pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD.\r
123\r
124 @retval EFI_SUCCESS The data was successfully returned.\r
125 @retval EFI_BUFFER_TOO_SMALL The buffer was too small.\r
126\r
127**/\r
128EFI_STATUS\r
129EFIAPI\r
130SecPlatformInformationBist (\r
131 IN CONST EFI_PEI_SERVICES **PeiServices,\r
132 IN OUT UINT64 *StructureSize,\r
133 OUT EFI_SEC_PLATFORM_INFORMATION_RECORD *PlatformInformationRecord\r
134 );\r
135\r
136/**\r
137 Implementation of the PlatformInformation2 service in EFI_SEC_PLATFORM_INFORMATION2_PPI.\r
138\r
139 @param PeiServices The pointer to the PEI Services Table.\r
140 @param StructureSize The pointer to the variable describing size of the input buffer.\r
141 @param PlatformInformationRecord2 The pointer to the EFI_SEC_PLATFORM_INFORMATION_RECORD2.\r
142\r
143 @retval EFI_SUCCESS The data was successfully returned.\r
144 @retval EFI_BUFFER_TOO_SMALL The buffer was too small. The current buffer size needed to\r
145 hold the record is returned in StructureSize.\r
146\r
147**/\r
148EFI_STATUS\r
149EFIAPI\r
150SecPlatformInformation2Bist (\r
151 IN CONST EFI_PEI_SERVICES **PeiServices,\r
152 IN OUT UINT64 *StructureSize,\r
153 OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2\r
154 );\r
155\r
156/**\r
157 Republish SecPlatformInformationPpi/SecPlatformInformation2Ppi.\r
158\r
159**/\r
160VOID\r
161RepublishSecPlatformInformationPpi (\r
162 VOID\r
163 );\r
164\r
f2e70629
SZ
165/**\r
166 Entry point of the notification callback function itself within the PEIM.\r
167 It is to get SEC performance data and build HOB to convey the SEC performance\r
168 data to DXE phase.\r
169\r
170 @param PeiServices Indirect reference to the PEI Services Table.\r
171 @param NotifyDescriptor Address of the notification descriptor data structure.\r
172 @param Ppi Address of the PPI that was installed.\r
173\r
174 @return Status of the notification.\r
175 The status code returned from this function is ignored.\r
176**/\r
177EFI_STATUS\r
178EFIAPI\r
179SecPerformancePpiCallBack (\r
180 IN EFI_PEI_SERVICES **PeiServices,\r
181 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
182 IN VOID *Ppi\r
183 );\r
184\r
1921695e 185#endif\r