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