]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFsp2Pkg/FspSecCore/SecMain.h
IntelFsp2Pkg: Update SEC_IDT_TABLE struct
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / SecMain.h
index 291bc5ca5caa116062d5db18f7581fac64363eb8..a09653da96714899561e75a4976b93e5dda544fd 100644 (file)
@@ -1,20 +1,13 @@
 /** @file\r
 \r
-  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
-  This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.<BR>\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \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
-#define SEC_IDT_ENTRY_COUNT    34\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[SEC_IDT_ENTRY_COUNT];\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
@@ -53,8 +54,8 @@ typedef struct _SEC_IDT_TABLE {
 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
@@ -76,25 +77,10 @@ SecSwitchStack (
 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
@@ -117,12 +103,12 @@ InitializeFloatingPointUnits (
 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
@@ -137,4 +123,17 @@ ProcessLibraryConstructorList (
   VOID\r
   );\r
 \r
+/**\r
+\r
+  Return value of esp.\r
+\r
+  @return  value of esp.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadStackPointer (\r
+  VOID\r
+  );\r
+\r
 #endif\r