• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   Master header file for SecCore.
3 
4   Copyright (c) 2008 - 2013, 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/TemporaryRamDone.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/PlatformSecLib.h>
28 #include <Library/UefiCpuLib.h>
29 #include <Library/PeCoffGetEntryPointLib.h>
30 #include <Library/PeCoffExtraActionLib.h>
31 #include <Library/DebugAgentLib.h>
32 #include <Library/CpuExceptionHandlerLib.h>
33 #include <Library/ReportStatusCodeLib.h>
34 
35 
36 #define SEC_IDT_ENTRY_COUNT  34
37 
38 typedef struct _SEC_IDT_TABLE {
39   //
40   // Reserved 8 bytes preceding IDT to store EFI_PEI_SERVICES**, since IDT base
41   // address should be 8-byte alignment.
42   // Note: For IA32, only the 4 bytes immediately preceding IDT is used to store
43   // EFI_PEI_SERVICES**
44   //
45   UINT64            PeiService;
46   UINT64            IdtTable[SEC_IDT_ENTRY_COUNT];
47 } SEC_IDT_TABLE;
48 
49 /**
50   TemporaryRamDone() disables the use of Temporary RAM. If present, this service is invoked
51   by the PEI Foundation after the EFI_PEI_PERMANANT_MEMORY_INSTALLED_PPI is installed.
52 
53   @retval EFI_SUCCESS           Use of Temporary RAM was disabled.
54   @retval EFI_INVALID_PARAMETER Temporary RAM could not be disabled.
55 
56 **/
57 EFI_STATUS
58 EFIAPI
59 SecTemporaryRamDone (
60   VOID
61   );
62 
63 /**
64   Entry point to the C language phase of SEC. After the SEC assembly
65   code has initialized some temporary memory and set up the stack,
66   the control is transferred to this function.
67 
68   @param SizeOfRam           Size of the temporary memory available for use.
69   @param TempRamBase         Base address of temporary ram
70   @param BootFirmwareVolume  Base address of the Boot Firmware Volume.
71 **/
72 VOID
73 EFIAPI
74 SecStartup (
75   IN UINT32                   SizeOfRam,
76   IN UINT32                   TempRamBase,
77   IN VOID                     *BootFirmwareVolume
78   );
79 
80 /**
81   Find and return Pei Core entry point.
82 
83   It also find SEC and PEI Core file debug information. It will report them if
84   remote debug is enabled.
85 
86   @param  BootFirmwareVolumePtr  Point to the boot firmware volume.
87   @param  PeiCoreEntryPoint      Point to the PEI core entry point.
88 
89 **/
90 VOID
91 EFIAPI
92 FindAndReportEntryPoints (
93   IN  EFI_FIRMWARE_VOLUME_HEADER       *BootFirmwareVolumePtr,
94   OUT EFI_PEI_CORE_ENTRY_POINT         *PeiCoreEntryPoint
95   );
96 
97 /**
98   Auto-generated function that calls the library constructors for all of the module's
99   dependent libraries.  This function must be called by the SEC Core once a stack has
100   been established.
101 
102 **/
103 VOID
104 EFIAPI
105 ProcessLibraryConstructorList (
106   VOID
107   );
108 
109 #endif
110