X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FAcpi%2FBootScriptExecutorDxe%2FIA32%2FSetIdtEntry.c;h=8f535af26ab9a4be92aa4b3244d11ac809fc0937;hb=1436aea4d5707e672672a11bda72be2c63c936c3;hp=45c9b667cbd6aa52b042111f8368ed98662047c0;hpb=7c7184e201a90a1d2376e615e55e3f4074731468;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c index 45c9b667cb..8f535af26a 100644 --- a/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c +++ b/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/IA32/SetIdtEntry.c @@ -18,18 +18,18 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ VOID SetIdtEntry ( - IN ACPI_S3_CONTEXT *AcpiS3Context + IN ACPI_S3_CONTEXT *AcpiS3Context ) { - IA32_IDT_GATE_DESCRIPTOR *IdtEntry; - IA32_DESCRIPTOR *IdtDescriptor; - UINTN S3DebugBuffer; - EFI_STATUS Status; + IA32_IDT_GATE_DESCRIPTOR *IdtEntry; + IA32_DESCRIPTOR *IdtDescriptor; + UINTN S3DebugBuffer; + EFI_STATUS Status; // // Restore IDT for debug // - IdtDescriptor = (IA32_DESCRIPTOR *) (UINTN) (AcpiS3Context->IdtrProfile); + IdtDescriptor = (IA32_DESCRIPTOR *)(UINTN)(AcpiS3Context->IdtrProfile); AsmWriteIdtr (IdtDescriptor); // @@ -39,17 +39,18 @@ SetIdtEntry ( ASSERT_EFI_ERROR (Status); DEBUG_CODE_BEGIN (); - // - // Update IDT entry INT3 if the instruction is valid in it - // - S3DebugBuffer = (UINTN) (AcpiS3Context->S3DebugBufferAddress); - if (*(UINTN *)S3DebugBuffer != (UINTN) -1) { - IdtEntry = (IA32_IDT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (IA32_IDT_GATE_DESCRIPTOR))); - IdtEntry->Bits.OffsetLow = (UINT16)S3DebugBuffer; - IdtEntry->Bits.Selector = (UINT16)AsmReadCs (); - IdtEntry->Bits.Reserved_0 = 0; - IdtEntry->Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32; - IdtEntry->Bits.OffsetHigh = (UINT16)(S3DebugBuffer >> 16); - } + // + // Update IDT entry INT3 if the instruction is valid in it + // + S3DebugBuffer = (UINTN)(AcpiS3Context->S3DebugBufferAddress); + if (*(UINTN *)S3DebugBuffer != (UINTN)-1) { + IdtEntry = (IA32_IDT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (IA32_IDT_GATE_DESCRIPTOR))); + IdtEntry->Bits.OffsetLow = (UINT16)S3DebugBuffer; + IdtEntry->Bits.Selector = (UINT16)AsmReadCs (); + IdtEntry->Bits.Reserved_0 = 0; + IdtEntry->Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32; + IdtEntry->Bits.OffsetHigh = (UINT16)(S3DebugBuffer >> 16); + } + DEBUG_CODE_END (); }