3 Copyright (c) 2014 - 2015, 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 #define SEC_IDT_ENTRY_COUNT 34
34 typedef VOID (*PEI_CORE_ENTRY
) ( \
35 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
, \
36 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList \
39 typedef struct _SEC_IDT_TABLE
{
40 EFI_PEI_SERVICES
*PeiService
;
41 UINT64 IdtTable
[SEC_IDT_ENTRY_COUNT
];
45 Switch the stack in the temporary memory to the one in the permanent memory.
47 This function must be invoked after the memory migration immediately. The relative
48 position of the stack in the temporary and permanent memory is same.
50 @param[in] TemporaryMemoryBase Base address of the temporary memory.
51 @param[in] PermenentMemoryBase Base address of the permanent memory.
56 IN UINT32 TemporaryMemoryBase
,
57 IN UINT32 PermenentMemoryBase
61 This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RAM into
64 @param[in] PeiServices Pointer to the PEI Services Table.
65 @param[in] TemporaryMemoryBase Source Address in temporary memory from which the SEC or PEIM will copy the
66 Temporary RAM contents.
67 @param[in] PermanentMemoryBase Destination Address in permanent memory into which the SEC or PEIM will copy the
68 Temporary RAM contents.
69 @param[in] CopySize Amount of memory to migrate from temporary to permanent memory.
71 @retval EFI_SUCCESS The data was successfully returned.
72 @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > TemporaryMemoryBase when
73 TemporaryMemoryBase > PermanentMemoryBase.
78 SecTemporaryRamSupport (
79 IN CONST EFI_PEI_SERVICES
**PeiServices
,
80 IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase
,
81 IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase
,
86 Initializes floating point units for requirement of UEFI specification.
88 This function initializes floating-point control word to 0x027F (all exceptions
89 masked,double-precision, round-to-nearest) and multimedia-extensions control word
90 (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
91 for masked underflow).
96 InitializeFloatingPointUnits (
102 Entry point to the C language phase of SEC. After the SEC assembly
103 code has initialized some temporary memory and set up the stack,
104 the control is transferred to this function.
107 @param[in] SizeOfRam Size of the temporary memory available for use.
108 @param[in] TempRamBase Base address of temporary ram
109 @param[in] BootFirmwareVolume Base address of the Boot Firmware Volume.
110 @param[in] PeiCore PeiCore entry point.
111 @param[in] BootLoaderStack BootLoader stack.
112 @param[in] ApiIdx the index of API.
114 @return This function never returns.
121 IN UINT32 TempRamBase
,
122 IN VOID
*BootFirmwareVolume
,
123 IN PEI_CORE_ENTRY PeiCore
,
124 IN UINT32 BootLoaderStack
,
129 Autogenerated function that calls the library constructors for all of the module's
130 dependent libraries. This function must be called by the SEC Core once a stack has
136 ProcessLibraryConstructorList (