2 Master header file for SecCore.
4 Copyright (c) 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
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.
21 #include <Ppi/SecPlatformInformation.h>
22 #include <Ppi/TemporaryRamSupport.h>
24 #include <Library/BaseLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/PcdLib.h>
27 #include <Library/BaseMemoryLib.h>
28 #include <Library/UefiCpuLib.h>
29 #include <Library/PeCoffGetEntryPointLib.h>
30 #include <Library/PeCoffExtraActionLib.h>
31 #include <Library/DebugAgentLib.h>
34 #define SEC_IDT_ENTRY_COUNT 34
36 typedef struct _SEC_IDT_TABLE
{
38 // Reserved 8 bytes preceding IDT to store EFI_PEI_SERVICES**, since IDT base
39 // address should be 8-byte alignment.
40 // Note: For IA32, only the 4 bytes immediately preceding IDT is used to store
44 UINT64 IdtTable
[SEC_IDT_ENTRY_COUNT
];
48 Switch the stack in the temporary memory to the one in the permanent memory.
50 This function must be invoked after the memory migration immediately. The relative
51 position of the stack in the temporary and permanent memory is same.
53 @param TemporaryMemoryBase Base address of the temporary memory.
54 @param PermenentMemoryBase Base address of the permanent memory.
59 UINT32 TemporaryMemoryBase
,
60 UINT32 PermenentMemoryBase
64 This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into
67 @param PeiServices Pointer to the PEI Services Table.
68 @param TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the
69 Temporary RAM contents.
70 @param PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the
71 Temporary RAM contents.
72 @param CopySize Amount of memory to migrate from temporary to permanent memory.
74 @retval EFI_SUCCESS The data was successfully returned.
75 @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when
76 TemporaryMemoryBase > PermanentMemoryBase.
81 SecTemporaryRamSupport (
82 IN CONST EFI_PEI_SERVICES
**PeiServices
,
83 IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase
,
84 IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase
,
89 Entry point to the C language phase of SEC. After the SEC assembly
90 code has initialized some temporary memory and set up the stack,
91 the control is transferred to this function.
93 @param SizeOfRam Size of the temporary memory available for use.
94 @param TempRamBase Base address of tempory ram
95 @param BootFirmwareVolume Base address of the Boot Firmware Volume.
101 IN UINT32 TempRamBase
,
102 IN VOID
*BootFirmwareVolume
106 Find and return Pei Core entry point.
108 It also find SEC and PEI Core file debug inforamtion. It will report them if
109 remote debug is enabled.
111 @param BootFirmwareVolumePtr Point to the boot firmware volume.
112 @param PeiCoreEntryPoint Point to the PEI core entry point.
117 FindAndReportEntryPoints (
118 IN EFI_FIRMWARE_VOLUME_HEADER
*BootFirmwareVolumePtr
,
119 OUT EFI_PEI_CORE_ENTRY_POINT
*PeiCoreEntryPoint
123 Autogenerated function that calls the library constructors for all of the module's
124 dependent libraries. This function must be called by the SEC Core once a stack has
130 ProcessLibraryConstructorList (