3 Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php.
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #include <Ppi/TemporaryRamSupport.h>
21 #include <Library/BaseLib.h>
22 #include <Library/IoLib.h>
23 #include <Library/DebugLib.h>
24 #include <Library/PcdLib.h>
25 #include <Library/BaseMemoryLib.h>
26 #include <Library/PciCf8Lib.h>
27 #include <Library/SerialPortLib.h>
28 #include <Library/FspSwitchStackLib.h>
29 #include <Library/FspCommonLib.h>
32 typedef VOID (*PEI_CORE_ENTRY
) ( \
33 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
, \
34 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList \
37 typedef struct _SEC_IDT_TABLE
{
38 EFI_PEI_SERVICES
*PeiService
;
39 UINT64 IdtTable
[FixedPcdGet8 (PcdFspMaxInterruptSupported
)];
43 Switch the stack in the temporary memory to the one in the permanent memory.
45 This function must be invoked after the memory migration immediately. The relative
46 position of the stack in the temporary and permanent memory is same.
48 @param[in] TemporaryMemoryBase Base address of the temporary memory.
49 @param[in] PermenentMemoryBase Base address of the permanent memory.
54 IN UINT32 TemporaryMemoryBase
,
55 IN UINT32 PermenentMemoryBase
59 This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into
62 @param[in] PeiServices Pointer to the PEI Services Table.
63 @param[in] TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the
64 Temporary RAM contents.
65 @param[in] PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the
66 Temporary RAM contents.
67 @param[in] CopySize Amount of memory to migrate from temporary to permanent memory.
69 @retval EFI_SUCCESS The data was successfully returned.
70 @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when
71 TemporaryMemoryBase > PermanentMemoryBase.
76 SecTemporaryRamSupport (
77 IN CONST EFI_PEI_SERVICES
**PeiServices
,
78 IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase
,
79 IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase
,
84 Initializes floating point units for requirement of UEFI specification.
86 This function initializes floating-point control word to 0x027F (all exceptions
87 masked,double-precision, round-to-nearest) and multimedia-extensions control word
88 (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
89 for masked underflow).
94 InitializeFloatingPointUnits (
100 Entry point to the C language phase of SEC. After the SEC assembly
101 code has initialized some temporary memory and set up the stack,
102 the control is transferred to this function.
105 @param[in] SizeOfRam Size of the temporary memory available for use.
106 @param[in] TempRamBase Base address of temporary ram
107 @param[in] BootFirmwareVolume Base address of the Boot Firmware Volume.
108 @param[in] PeiCore PeiCore entry point.
109 @param[in] BootLoaderStack BootLoader stack.
110 @param[in] ApiIdx the index of API.
112 @return This function never returns.
119 IN UINT32 TempRamBase
,
120 IN VOID
*BootFirmwareVolume
,
121 IN PEI_CORE_ENTRY PeiCore
,
122 IN UINT32 BootLoaderStack
,
127 Autogenerated function that calls the library constructors for all of the module's
128 dependent libraries. This function must be called by the SEC Core once a stack has
134 ProcessLibraryConstructorList (