• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   Master header file for SecCore.
3 
4   Copyright (c) 2014, 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 
19 #include <PiPei.h>
20 
21 #include <Ppi/TopOfTemporaryRam.h>
22 
23 #include <Library/BaseLib.h>
24 #include <Library/DebugLib.h>
25 #include <Library/PcdLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/FspPlatformSecLib.h>
28 #include <Library/FspPlatformInfoLib.h>
29 #include <Library/UefiCpuLib.h>
30 #include <Library/PeCoffGetEntryPointLib.h>
31 #include <Library/PeCoffExtraActionLib.h>
32 #include <Library/DebugAgentLib.h>
33 
34 #include <FspApi.h>
35 #include <FspInfoHeader.h>
36 
37 #define SEC_IDT_ENTRY_COUNT  34
38 
39 typedef struct _SEC_IDT_TABLE {
40   //
41   // Reserved 8 bytes preceding IDT to store EFI_PEI_SERVICES**, since IDT base
42   // address should be 8-byte alignment.
43   // Note: For IA32, only the 4 bytes immediately preceding IDT is used to store
44   // EFI_PEI_SERVICES**
45   //
46   UINT64            PeiService;
47   UINT64            IdtTable[SEC_IDT_ENTRY_COUNT];
48 } SEC_IDT_TABLE;
49 
50 /**
51   Entry point to the C language phase of SEC. After the SEC assembly
52   code has initialized some temporary memory and set up the stack,
53   the control is transferred to this function.
54 
55   @param[in] SizeOfRam           Size of the temporary memory available for use.
56   @param[in] TempRamBase         Base address of temporary ram
57   @param[in] BootFirmwareVolume  Base address of the Boot Firmware Volume.
58 **/
59 VOID
60 EFIAPI
61 SecStartup (
62   IN UINT32                   SizeOfRam,
63   IN UINT32                   TempRamBase,
64   IN VOID                     *BootFirmwareVolume
65   );
66 
67 /**
68   Find and return Pei Core entry point.
69 
70   It also find SEC and PEI Core file debug information. It will report them if
71   remote debug is enabled.
72 
73   @param[in]  BootFirmwareVolumePtr  Point to the boot firmware volume.
74   @param[out] PeiCoreEntryPoint      Point to the PEI core entry point.
75 
76 **/
77 VOID
78 EFIAPI
79 FindAndReportEntryPoints (
80   IN  EFI_FIRMWARE_VOLUME_HEADER       *BootFirmwareVolumePtr,
81   OUT EFI_PEI_CORE_ENTRY_POINT         *PeiCoreEntryPoint
82   );
83 
84 /**
85   Autogenerated function that calls the library constructors for all of the module's
86   dependent libraries.  This function must be called by the SEC Core once a stack has
87   been established.
88 
89 **/
90 VOID
91 EFIAPI
92 ProcessLibraryConstructorList (
93   VOID
94   );
95 
96 #endif
97