summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c
diff options
context:
space:
mode:
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-16 09:21:45 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-16 09:21:45 +0000
commit509bc208d835762c31987b00fab708c1d2ff2c5d (patch)
treeed8fd7a96f8c6458504c36b147264629a402a4bd /MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c
parentb263ee171888e5a6a1f1f15d58a7fa6011131ba5 (diff)
downloadedk2-platforms-509bc208d835762c31987b00fab708c1d2ff2c5d.tar.xz
code scrub:
1. updated functions header. 2. sync some comments for .S files. 3. fixed some error in AsmFuncs.S git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7044 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c')
-rw-r--r--MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c
index 3c96f9b518..ed38d06cae 100644
--- a/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c
+++ b/MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c
@@ -1,5 +1,5 @@
/** @file
- Generic debug support functions for IA32/x64.
+ IA32/x64 generic functions to support Debug Support protocol.
Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -90,11 +90,27 @@ HookEntry (
//
OldIntFlagState = SaveAndDisableInterrupts ();
+ //
+ // gets IDT Gate descriptor by index
+ //
ReadIdtGateDescriptor (ExceptionType, &(IdtEntryTable[ExceptionType].OrigDesc));
+ //
+ // stores orignal interrupt handle
+ //
IdtEntryTable[ExceptionType].OrigVector = (DEBUG_PROC) GetInterruptHandleFromIdt (&(IdtEntryTable[ExceptionType].OrigDesc));
+ //
+ // encodes new IDT Gate descriptor by stub entry
+ //
Vect2Desc (&IdtEntryTable[ExceptionType].NewDesc, IdtEntryTable[ExceptionType].StubEntry);
+ //
+ // stores NewCallback
+ //
IdtEntryTable[ExceptionType].RegisteredCallback = NewCallback;
+
+ //
+ // writes back new IDT Gate descriptor
+ //
WriteIdtGateDescriptor (ExceptionType, &(IdtEntryTable[ExceptionType].NewDesc));
//
@@ -214,6 +230,7 @@ RegisterExceptionCallback (
return ManageIdtEntryTable (ExceptionCallback, ExceptionType);
}
+
/**
Invalidates processor instruction cache for a memory range. Subsequent execution in this range
causes a fresh memory fetch to retrieve code to be executed.
@@ -244,6 +261,7 @@ InvalidateInstructionCache (
Common piece of code that invokes the registered handlers.
This code executes in exception context so no efi calls are allowed.
+ This code is called from assembly file.
@param ExceptionType Exception type
@param ContextRecord System context