3 Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
13 #include <Ppi/TemporaryRamSupport.h>
15 #include <Library/BaseLib.h>
16 #include <Library/IoLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/PcdLib.h>
19 #include <Library/BaseMemoryLib.h>
20 #include <Library/PciCf8Lib.h>
21 #include <Library/SerialPortLib.h>
22 #include <Library/FspSwitchStackLib.h>
23 #include <Library/FspCommonLib.h>
26 #define SEC_IDT_ENTRY_COUNT 34
28 typedef VOID (*PEI_CORE_ENTRY
) ( \
29 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
, \
30 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList \
33 typedef struct _SEC_IDT_TABLE
{
34 EFI_PEI_SERVICES
*PeiService
;
35 UINT64 IdtTable
[SEC_IDT_ENTRY_COUNT
];
39 Switch the stack in the temporary memory to the one in the permanent memory.
41 This function must be invoked after the memory migration immediately. The relative
42 position of the stack in the temporary and permanent memory is same.
44 @param[in] TemporaryMemoryBase Base address of the temporary memory.
45 @param[in] PermenentMemoryBase Base address of the permanent memory.
50 IN UINT32 TemporaryMemoryBase
,
51 IN UINT32 PermenentMemoryBase
55 This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into
58 @param[in] PeiServices Pointer to the PEI Services Table.
59 @param[in] TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the
60 Temporary RAM contents.
61 @param[in] PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the
62 Temporary RAM contents.
63 @param[in] CopySize Amount of memory to migrate from temporary to permanent memory.
65 @retval EFI_SUCCESS The data was successfully returned.
66 @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when
67 TemporaryMemoryBase > PermanentMemoryBase.
72 SecTemporaryRamSupport (
73 IN CONST EFI_PEI_SERVICES
**PeiServices
,
74 IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase
,
75 IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase
,
80 Initializes floating point units for requirement of UEFI specification.
82 This function initializes floating-point control word to 0x027F (all exceptions
83 masked,double-precision, round-to-nearest) and multimedia-extensions control word
84 (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
85 for masked underflow).
90 InitializeFloatingPointUnits (
96 Entry point to the C language phase of SEC. After the SEC assembly
97 code has initialized some temporary memory and set up the stack,
98 the control is transferred to this function.
101 @param[in] SizeOfRam Size of the temporary memory available for use.
102 @param[in] TempRamBase Base address of temporary ram
103 @param[in] BootFirmwareVolume Base address of the Boot Firmware Volume.
104 @param[in] PeiCore PeiCore entry point.
105 @param[in] BootLoaderStack BootLoader stack.
106 @param[in] ApiIdx the index of API.
108 @return This function never returns.
115 IN UINT32 TempRamBase
,
116 IN VOID
*BootFirmwareVolume
,
117 IN PEI_CORE_ENTRY PeiCore
,
118 IN UINT32 BootLoaderStack
,
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 (