/** @file\r
\r
- Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
#ifndef _SEC_CORE_H_\r
#define _SEC_CORE_H_\r
\r
-\r
#include <PiPei.h>\r
#include <Ppi/TemporaryRamSupport.h>\r
\r
#include <Library/SerialPortLib.h>\r
#include <Library/FspSwitchStackLib.h>\r
#include <Library/FspCommonLib.h>\r
+#include <Library/CpuLib.h>\r
+#include <Library/UefiCpuLib.h>\r
#include <FspEas.h>\r
\r
-typedef VOID (*PEI_CORE_ENTRY) ( \\r
- IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData, \\r
- IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList \\r
-);\r
+typedef\r
+VOID\r
+(EFIAPI *PEI_CORE_ENTRY)(\r
+ IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r
+ IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r
+ );\r
\r
typedef struct _SEC_IDT_TABLE {\r
- EFI_PEI_SERVICES *PeiService;\r
- UINT64 IdtTable[FixedPcdGet8 (PcdFspMaxInterruptSupported)];\r
+ //\r
+ // Reserved 8 bytes preceding IDT to store EFI_PEI_SERVICES**, since IDT base\r
+ // address should be 8-byte alignment.\r
+ // Note: For IA32, only the 4 bytes immediately preceding IDT is used to store\r
+ // EFI_PEI_SERVICES**\r
+ //\r
+ UINT64 PeiService;\r
+ IA32_IDT_GATE_DESCRIPTOR IdtTable[FixedPcdGet8 (PcdFspMaxInterruptSupported)];\r
} SEC_IDT_TABLE;\r
\r
/**\r
VOID\r
EFIAPI\r
SecSwitchStack (\r
- IN UINT32 TemporaryMemoryBase,\r
- IN UINT32 PermenentMemoryBase\r
+ IN UINTN TemporaryMemoryBase,\r
+ IN UINTN PermenentMemoryBase\r
);\r
\r
/**\r
EFI_STATUS\r
EFIAPI\r
SecTemporaryRamSupport (\r
- IN CONST EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,\r
- IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,\r
- IN UINTN CopySize\r
- );\r
-\r
-/**\r
- Initializes floating point units for requirement of UEFI specification.\r
-\r
- This function initializes floating-point control word to 0x027F (all exceptions\r
- masked,double-precision, round-to-nearest) and multimedia-extensions control word\r
- (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero\r
- for masked underflow).\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-InitializeFloatingPointUnits (\r
- VOID\r
+ IN CONST EFI_PEI_SERVICES **PeiServices,\r
+ IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,\r
+ IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,\r
+ IN UINTN CopySize\r
);\r
\r
/**\r
VOID\r
EFIAPI\r
SecStartup (\r
- IN UINT32 SizeOfRam,\r
- IN UINT32 TempRamBase,\r
- IN VOID *BootFirmwareVolume,\r
- IN PEI_CORE_ENTRY PeiCore,\r
- IN UINT32 BootLoaderStack,\r
- IN UINT32 ApiIdx\r
+ IN UINT32 SizeOfRam,\r
+ IN UINT32 TempRamBase,\r
+ IN VOID *BootFirmwareVolume,\r
+ IN PEI_CORE_ENTRY PeiCore,\r
+ IN UINTN BootLoaderStack,\r
+ IN UINT32 ApiIdx\r
);\r
\r
/**\r
@return value of esp.\r
\r
**/\r
-UINT32\r
+UINTN\r
EFIAPI\r
-AsmReadEsp (\r
+AsmReadStackPointer (\r
VOID\r
);\r
\r