]> git.proxmox.com Git - mirror_edk2.git/blob - UefiCpuPkg/SecCore/SecMain.h
UefiCpuPkg/SecCore: Abstract worker function GetBistFromHob()
[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 #endif