2 Master header file for SecCore.
4 Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
15 #include <Ppi/SecPlatformInformation.h>
16 #include <Ppi/TemporaryRamSupport.h>
18 #include <Library/BaseLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/PcdLib.h>
21 #include <Library/BaseMemoryLib.h>
22 #include <Library/UefiCpuLib.h>
23 #include <Library/PeCoffGetEntryPointLib.h>
24 #include <Library/PeCoffExtraActionLib.h>
25 #include <Library/DebugAgentLib.h>
28 #define SEC_IDT_ENTRY_COUNT 34
30 typedef struct _SEC_IDT_TABLE
{
32 // Reserved 8 bytes preceding IDT to store EFI_PEI_SERVICES**, since IDT base
33 // address should be 8-byte alignment.
34 // Note: For IA32, only the 4 bytes immediately preceding IDT is used to store
38 UINT64 IdtTable
[SEC_IDT_ENTRY_COUNT
];
42 Switch the stack in the temporary memory to the one in the permanent memory.
44 This function must be invoked after the memory migration immediately. The relative
45 position of the stack in the temporary and permanent memory is same.
47 @param TemporaryMemoryBase Base address of the temporary memory.
48 @param PermenentMemoryBase Base address of the permanent memory.
53 UINT32 TemporaryMemoryBase
,
54 UINT32 PermenentMemoryBase
58 This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into
61 @param PeiServices Pointer to the PEI Services Table.
62 @param TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the
63 Temporary RAM contents.
64 @param PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the
65 Temporary RAM contents.
66 @param CopySize Amount of memory to migrate from temporary to permanent memory.
68 @retval EFI_SUCCESS The data was successfully returned.
69 @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when
70 TemporaryMemoryBase > PermanentMemoryBase.
75 SecTemporaryRamSupport (
76 IN CONST EFI_PEI_SERVICES
**PeiServices
,
77 IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase
,
78 IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase
,
83 Entry point to the C language phase of SEC. After the SEC assembly
84 code has initialized some temporary memory and set up the stack,
85 the control is transferred to this function.
87 @param SizeOfRam Size of the temporary memory available for use.
88 @param TempRamBase Base address of temporary ram
89 @param BootFirmwareVolume Base address of the Boot Firmware Volume.
90 @param BootloaderParameter A parameter from bootloader, e.g. HobList from SlimBootloader
97 IN UINT32 TempRamBase
,
98 IN VOID
*BootFirmwareVolume
,
99 IN UINT32 BootloaderParameter
103 Find and return Pei Core entry point.
105 It also find SEC and PEI Core file debug information. It will report them if
106 remote debug is enabled.
108 @param BootFirmwareVolumePtr Point to the boot firmware volume.
109 @param PeiCoreEntryPoint Point to the PEI core entry point.
114 FindAndReportEntryPoints (
115 IN EFI_FIRMWARE_VOLUME_HEADER
*BootFirmwareVolumePtr
,
116 OUT EFI_PEI_CORE_ENTRY_POINT
*PeiCoreEntryPoint
120 Autogenerated function that calls the library constructors for all of the module's
121 dependent libraries. This function must be called by the SEC Core once a stack has
127 ProcessLibraryConstructorList (