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