TianoCore EDK2
master
Loading...
Searching...
No Matches
SetIdtEntry.c
Go to the documentation of this file.
1
11
#include "
ScriptExecute.h
"
12
19
VOID
20
SetIdtEntry
(
21
IN
ACPI_S3_CONTEXT
*AcpiS3Context
22
)
23
{
24
IA32_IDT_GATE_DESCRIPTOR *IdtEntry;
25
IA32_DESCRIPTOR *IdtDescriptor;
26
UINTN
S3DebugBuffer;
27
EFI_STATUS
Status;
28
29
//
30
// Restore IDT for debug
31
//
32
IdtDescriptor = (IA32_DESCRIPTOR *)(
UINTN
)(AcpiS3Context->IdtrProfile);
33
AsmWriteIdtr
(IdtDescriptor);
34
35
//
36
// Setup the default CPU exception handlers
37
//
38
Status = InitializeCpuExceptionHandlers (
NULL
);
39
ASSERT_EFI_ERROR
(Status);
40
41
DEBUG_CODE_BEGIN
();
42
//
43
// Update IDT entry INT3 if the instruction is valid in it
44
//
45
S3DebugBuffer = (
UINTN
)(AcpiS3Context->S3DebugBufferAddress);
46
if
(*(
UINTN
*)S3DebugBuffer != (
UINTN
)-1) {
47
IdtEntry = (IA32_IDT_GATE_DESCRIPTOR *)(IdtDescriptor->Base + (3 * sizeof (IA32_IDT_GATE_DESCRIPTOR)));
48
IdtEntry->Bits.OffsetLow = (UINT16)S3DebugBuffer;
49
IdtEntry->Bits.Selector = (UINT16)
AsmReadCs
();
50
IdtEntry->Bits.Reserved_0 = 0;
51
IdtEntry->Bits.GateType = IA32_IDT_GATE_TYPE_INTERRUPT_32;
52
IdtEntry->Bits.OffsetHigh = (UINT16)(S3DebugBuffer >> 16);
53
}
54
55
DEBUG_CODE_END
();
56
}
UINTN
UINT64 UINTN
Definition:
ProcessorBind.h:112
SetIdtEntry
VOID SetIdtEntry(IN ACPI_S3_CONTEXT *AcpiS3Context)
Definition:
SetIdtEntry.c:20
AsmReadCs
UINT16 EFIAPI AsmReadCs(VOID)
Definition:
GccInlinePriv.c:745
NULL
#define NULL
Definition:
Base.h:319
IN
#define IN
Definition:
Base.h:279
ASSERT_EFI_ERROR
#define ASSERT_EFI_ERROR(StatusParameter)
Definition:
DebugLib.h:462
DEBUG_CODE_BEGIN
#define DEBUG_CODE_BEGIN()
Definition:
DebugLib.h:564
DEBUG_CODE_END
#define DEBUG_CODE_END()
Definition:
DebugLib.h:578
ScriptExecute.h
EFI_STATUS
RETURN_STATUS EFI_STATUS
Definition:
UefiBaseType.h:29
AsmWriteIdtr
VOID EFIAPI AsmWriteIdtr(IN CONST IA32_DESCRIPTOR *Idtr)
Definition:
X86UnitTestHost.c:2340
ACPI_S3_CONTEXT
Definition:
AcpiS3Context.h:36
MdeModulePkg
Universal
Acpi
BootScriptExecutorDxe
IA32
SetIdtEntry.c
Generated on Fri Nov 15 2024 18:01:12 for TianoCore EDK2 by
1.9.6