]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFsp2Pkg/FspSecCore/SecFsp.c
IntelFsp2Pkg: Update SEC_IDT_TABLE struct
[mirror_edk2.git] / IntelFsp2Pkg / FspSecCore / SecFsp.c
index 7fde6e7f418c99a46a24ed4ae65cfbbbcdb14e06..d9085ef51fb94166d60bb9accd3e0c0ddeae9b02 100644 (file)
   @return                     FSP specific IDT gate descriptor.\r
 \r
 **/\r
-UINT64\r
+IA32_IDT_GATE_DESCRIPTOR\r
 FspGetExceptionHandler (\r
   IN  UINT64  IdtEntryTemplate\r
   )\r
 {\r
   UINT32                    Entry;\r
-  UINT64                    ExceptionHandler;\r
+  IA32_IDT_GATE_DESCRIPTOR  ExceptionHandler;\r
   IA32_IDT_GATE_DESCRIPTOR  *IdtGateDescriptor;\r
   FSP_INFO_HEADER           *FspInfoHeader;\r
 \r
+  ZeroMem ((VOID *)&ExceptionHandler, sizeof (IA32_IDT_GATE_DESCRIPTOR));\r
   FspInfoHeader                      = (FSP_INFO_HEADER *)(UINTN)AsmGetFspInfoHeader ();\r
-  ExceptionHandler                   = IdtEntryTemplate;\r
-  IdtGateDescriptor                  = (IA32_IDT_GATE_DESCRIPTOR *)&ExceptionHandler;\r
+  *(UINT64 *) &ExceptionHandler      = IdtEntryTemplate;\r
+  IdtGateDescriptor                  = &ExceptionHandler;\r
   Entry                              = (IdtGateDescriptor->Bits.OffsetHigh << 16) | IdtGateDescriptor->Bits.OffsetLow;\r
   Entry                              = FspInfoHeader->ImageBase + FspInfoHeader->ImageSize - (~Entry + 1);\r
   IdtGateDescriptor->Bits.OffsetHigh = (UINT16)(Entry >> 16);\r
@@ -200,11 +201,11 @@ FspGlobalDataInit (
     (PeiFspData->FspInfoHeader->ImageRevision >> 24) & 0xFF, \\r
     (PeiFspData->FspInfoHeader->ImageRevision >> 16) & 0xFF, \\r
     (PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \\r
-      (((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF) | (PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF00)) :\\r
-        ((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF), \\r
+    (((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF) | (PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF00)) : \\r
+    ((PeiFspData->FspInfoHeader->ImageRevision >> 8) & 0xFF), \\r
     (PeiFspData->FspInfoHeader->HeaderRevision >= 6) ? \\r
-      ((PeiFspData->FspInfoHeader->ImageRevision & 0xFF) | ((PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF) << 8)): \\r
-        (PeiFspData->FspInfoHeader->ImageRevision & 0xFF)\r
+    ((PeiFspData->FspInfoHeader->ImageRevision & 0xFF) | ((PeiFspData->FspInfoHeader->ExtendedImageRevision & 0xFF) << 8)) : \\r
+    (PeiFspData->FspInfoHeader->ImageRevision & 0xFF)\r
     ));\r
 }\r
 \r