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