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