\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
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
//\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