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