]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c
Use IA32_IDT_GATE_DESCRIPTOR defined in BaseLib instead of local struct INTERRUPT_GAT...
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / BootScriptExecutorDxe / IA32 / SetIdtEntry.c
index fbdf32b60b02db00059f25a2c14d0f533fc57b57..04eba0d75678d843edd7679f5f760a485f5b3216 100644 (file)
@@ -15,22 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 #include "ScriptExecute.h"\r
-//\r
-// INTERRUPT_GATE_DESCRIPTOR and SetIdtEntry () are used to setup IDT to do debug\r
-//\r
 \r
-#pragma pack(1)\r
-\r
-typedef struct {\r
-  UINT16  OffsetLow;\r
-  UINT16  SegmentSelector;\r
-  UINT16  Attributes;\r
-  UINT16  OffsetHigh;\r
-} INTERRUPT_GATE_DESCRIPTOR;\r
-\r
-#define INTERRUPT_GATE_ATTRIBUTE   0x8e00\r
-\r
-#pragma pack()\r
 /**\r
   Set a IDT entry for interrupt vector 3 for debug purpose.\r
 \r
@@ -42,7 +27,7 @@ SetIdtEntry (
   IN ACPI_S3_CONTEXT     *AcpiS3Context\r
   )\r
 {\r
-  INTERRUPT_GATE_DESCRIPTOR                     *IdtEntry;\r
+  IA32_IDT_GATE_DESCRIPTOR                      *IdtEntry;\r
   IA32_DESCRIPTOR                               *IdtDescriptor;\r
   UINTN                                         S3DebugBuffer;\r
 \r
@@ -63,11 +48,12 @@ SetIdtEntry (
     //\r
     S3DebugBuffer = (UINTN) (AcpiS3Context->S3DebugBufferAddress);\r
     if (*(UINTN *)S3DebugBuffer != (UINTN) -1) {\r
-      IdtEntry = (INTERRUPT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (INTERRUPT_GATE_DESCRIPTOR)));\r
-      IdtEntry->OffsetLow       = (UINT16)S3DebugBuffer;\r
-      IdtEntry->SegmentSelector = (UINT16)AsmReadCs ();;\r
-      IdtEntry->Attributes      = (UINT16)INTERRUPT_GATE_ATTRIBUTE;\r
-      IdtEntry->OffsetHigh      = (UINT16)(S3DebugBuffer >> 16);\r
+      IdtEntry = (IA32_IDT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (IA32_IDT_GATE_DESCRIPTOR)));\r
+      IdtEntry->Bits.OffsetLow      = (UINT16)S3DebugBuffer;\r
+      IdtEntry->Bits.Selector       = (UINT16)AsmReadCs ();\r
+      IdtEntry->Bits.Reserved_0     = 0;\r
+      IdtEntry->Bits.GateType       = IA32_IDT_GATE_TYPE_INTERRUPT_32;\r
+      IdtEntry->Bits.OffsetHigh     = (UINT16)(S3DebugBuffer >> 16);\r
     }\r
   );\r
 }\r