26 OUT IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor
29 IA32_DESCRIPTOR IdtrValue;
30 IA32_IDT_GATE_DESCRIPTOR *IdtTable;
33 IdtTable = (IA32_IDT_GATE_DESCRIPTOR *)IdtrValue.Base;
35 CopyMem ((VOID *)IdtGateDescriptor, (VOID *)&(IdtTable)[Vector],
sizeof (IA32_IDT_GATE_DESCRIPTOR));
48 IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor
51 IA32_DESCRIPTOR IdtrValue;
52 IA32_IDT_GATE_DESCRIPTOR *IdtTable;
55 IdtTable = (IA32_IDT_GATE_DESCRIPTOR *)IdtrValue.Base;
57 CopyMem ((VOID *)&(IdtTable)[Vector], (VOID *)IdtGateDescriptor,
sizeof (IA32_IDT_GATE_DESCRIPTOR));
75 IN CALLBACK_FUNC NewCallback
78 BOOLEAN OldIntFlagState;
80 CreateEntryStub (ExceptionType, (VOID **)&IdtEntryTable[ExceptionType].StubEntry);
94 IdtEntryTable[ExceptionType].OrigVector = (DEBUG_PROC)
GetInterruptHandleFromIdt (&(IdtEntryTable[ExceptionType].OrigDesc));
99 Vect2Desc (&IdtEntryTable[ExceptionType].NewDesc, IdtEntryTable[ExceptionType].StubEntry);
103 IdtEntryTable[ExceptionType].RegisteredCallback = NewCallback;
129 BOOLEAN OldIntFlagState;
169 *MaxProcessorIndex = 0;
269 if (IdtEntryTable[ExceptionType].RegisteredCallback !=
NULL) {
270 if (ExceptionType != SYSTEM_TIMER_VECTOR) {
271 IdtEntryTable[ExceptionType].RegisteredCallback (ExceptionType, ContextRecord);
273 OrigVector = IdtEntryTable[ExceptionType].OrigVector;
274 IdtEntryTable[ExceptionType].RegisteredCallback (ContextRecord);
297 for (ExceptionType = 0; ExceptionType < NUM_IDT_ENTRIES; ExceptionType++) {
302 if (IdtEntryTable[ExceptionType].StubEntry !=
NULL) {
303 FreePool ((VOID *)(
UINTN)IdtEntryTable[ExceptionType].StubEntry);
335 return EFI_UNSUPPORTED;
339 if (IdtEntryTable ==
NULL) {
340 return EFI_OUT_OF_RESOURCES;
343 for (ExceptionType = 0; ExceptionType < NUM_IDT_ENTRIES; ExceptionType++) {
344 IdtEntryTable[ExceptionType].StubEntry = (DEBUG_PROC)(
UINTN)
AllocatePool (StubSize);
345 if (IdtEntryTable[ExceptionType].StubEntry ==
NULL) {
352 CopyMem ((VOID *)(
UINTN)IdtEntryTable[ExceptionType].StubEntry, InterruptEntryStub, StubSize);
359 for (ExceptionType = 0; ExceptionType < NUM_IDT_ENTRIES; ExceptionType++) {
360 if (IdtEntryTable[ExceptionType].StubEntry !=
NULL) {
361 FreePool ((VOID *)(
UINTN)IdtEntryTable[ExceptionType].StubEntry);
367 return EFI_OUT_OF_RESOURCES;
BOOLEAN EFIAPI SetInterruptState(IN BOOLEAN InterruptState)
BOOLEAN EFIAPI SaveAndDisableInterrupts(VOID)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID EFIAPI AsmWbinvd(VOID)
EFI_STATUS ManageIdtEntryTable(CALLBACK_FUNC NewCallback, EFI_EXCEPTION_TYPE ExceptionType)
UINTN GetInterruptHandleFromIdt(IN IA32_IDT_GATE_DESCRIPTOR *IdtGateDecriptor)
VOID Vect2Desc(IA32_IDT_GATE_DESCRIPTOR *DestDesc, VOID(*Vector)(VOID))
BOOLEAN FxStorSupport(VOID)
VOID CreateEntryStub(IN EFI_EXCEPTION_TYPE ExceptionType, OUT VOID **Stub)
VOID(EFIAPI * EFI_EXCEPTION_CALLBACK)(IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
VOID(EFIAPI * EFI_PERIODIC_CALLBACK)(IN OUT EFI_SYSTEM_CONTEXT SystemContext)
VOID HookEntry(IN EFI_EXCEPTION_TYPE ExceptionType, IN CALLBACK_FUNC NewCallback)
VOID WriteIdtGateDescriptor(EFI_EXCEPTION_TYPE Vector, IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor)
VOID ReadIdtGateDescriptor(IN EFI_EXCEPTION_TYPE Vector, OUT IA32_IDT_GATE_DESCRIPTOR *IdtGateDescriptor)
EFI_STATUS EFIAPI RegisterExceptionCallback(IN EFI_DEBUG_SUPPORT_PROTOCOL *This, IN UINTN ProcessorIndex, IN EFI_EXCEPTION_CALLBACK ExceptionCallback, IN EFI_EXCEPTION_TYPE ExceptionType)
VOID UnhookEntry(IN EFI_EXCEPTION_TYPE ExceptionType)
EFI_STATUS PlInitializeDebugSupportDriver(VOID)
EFI_STATUS EFIAPI InvalidateInstructionCache(IN EFI_DEBUG_SUPPORT_PROTOCOL *This, IN UINTN ProcessorIndex, IN VOID *Start, IN UINT64 Length)
EFI_STATUS EFIAPI GetMaximumProcessorIndex(IN EFI_DEBUG_SUPPORT_PROTOCOL *This, OUT UINTN *MaxProcessorIndex)
VOID InterruptDistrubutionHub(EFI_EXCEPTION_TYPE ExceptionType, EFI_SYSTEM_CONTEXT_IA32 *ContextRecord)
EFI_STATUS EFIAPI PlUnloadDebugSupportDriver(IN EFI_HANDLE ImageHandle)
EFI_STATUS EFIAPI RegisterPeriodicCallback(IN EFI_DEBUG_SUPPORT_PROTOCOL *This, IN UINTN ProcessorIndex, IN EFI_PERIODIC_CALLBACK PeriodicCallback)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
VOID EFIAPI AsmReadIdtr(OUT IA32_DESCRIPTOR *Idtr)