+++ /dev/null
-/** @file\r
-Set a IDT entry for debug purpose\r
-\r
-Set a IDT entry for interrupt vector 3 for debug purpose for IA32 platform\r
-\r
-Copyright (c) 2013-2015 Intel Corporation.\r
-\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\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
- @param AcpiS3Context a pointer to a structure of ACPI_S3_CONTEXT\r
-\r
-**/\r
-VOID\r
-SetIdtEntry (\r
- IN ACPI_S3_CONTEXT *AcpiS3Context\r
- )\r
-{\r
- INTERRUPT_GATE_DESCRIPTOR *IdtEntry;\r
- IA32_DESCRIPTOR *IdtDescriptor;\r
- UINTN S3DebugBuffer;\r
-\r
- //\r
- // Restore IDT for debug\r
- //\r
- IdtDescriptor = (IA32_DESCRIPTOR *) (UINTN) (AcpiS3Context->IdtrProfile);\r
- IdtEntry = (INTERRUPT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (INTERRUPT_GATE_DESCRIPTOR)));\r
- S3DebugBuffer = (UINTN) (AcpiS3Context->S3DebugBufferAddress);\r
-\r
- IdtEntry->OffsetLow = (UINT16)S3DebugBuffer;\r
- IdtEntry->SegmentSelector = (UINT16)AsmReadCs ();\r
- IdtEntry->Attributes = (UINT16)INTERRUPT_GATE_ATTRIBUTE;\r
- IdtEntry->OffsetHigh = (UINT16)(S3DebugBuffer >> 16);\r
-\r
- AsmWriteIdtr (IdtDescriptor);\r
-}\r
-\r