3 Copyright (c) 2014 - 2018, 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 typedef VOID (*PEI_CORE_ENTRY
) ( \
27 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
, \
28 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList \
31 typedef struct _SEC_IDT_TABLE
{
32 EFI_PEI_SERVICES
*PeiService
;
33 UINT64 IdtTable
[FixedPcdGet8 (PcdFspMaxInterruptSupported
)];
37 Switch the stack in the temporary memory to the one in the permanent memory.
39 This function must be invoked after the memory migration immediately. The relative
40 position of the stack in the temporary and permanent memory is same.
42 @param[in] TemporaryMemoryBase Base address of the temporary memory.
43 @param[in] PermenentMemoryBase Base address of the permanent memory.
48 IN UINT32 TemporaryMemoryBase
,
49 IN UINT32 PermenentMemoryBase
53 This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into
56 @param[in] PeiServices Pointer to the PEI Services Table.
57 @param[in] TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the
58 Temporary RAM contents.
59 @param[in] PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the
60 Temporary RAM contents.
61 @param[in] CopySize Amount of memory to migrate from temporary to permanent memory.
63 @retval EFI_SUCCESS The data was successfully returned.
64 @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when
65 TemporaryMemoryBase > PermanentMemoryBase.
70 SecTemporaryRamSupport (
71 IN CONST EFI_PEI_SERVICES
**PeiServices
,
72 IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase
,
73 IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase
,
78 Initializes floating point units for requirement of UEFI specification.
80 This function initializes floating-point control word to 0x027F (all exceptions
81 masked,double-precision, round-to-nearest) and multimedia-extensions control word
82 (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
83 for masked underflow).
88 InitializeFloatingPointUnits (
94 Entry point to the C language phase of SEC. After the SEC assembly
95 code has initialized some temporary memory and set up the stack,
96 the control is transferred to this function.
99 @param[in] SizeOfRam Size of the temporary memory available for use.
100 @param[in] TempRamBase Base address of temporary ram
101 @param[in] BootFirmwareVolume Base address of the Boot Firmware Volume.
102 @param[in] PeiCore PeiCore entry point.
103 @param[in] BootLoaderStack BootLoader stack.
104 @param[in] ApiIdx the index of API.
106 @return This function never returns.
113 IN UINT32 TempRamBase
,
114 IN VOID
*BootFirmwareVolume
,
115 IN PEI_CORE_ENTRY PeiCore
,
116 IN UINT32 BootLoaderStack
,
121 Autogenerated function that calls the library constructors for all of the module's
122 dependent libraries. This function must be called by the SEC Core once a stack has
128 ProcessLibraryConstructorList (
136 @return value of esp.