]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupport.c
code scrub:
[mirror_edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / Ia32 / PlDebugSupport.c
index 3c96f9b518436089c075e3348426ae5492236258..ed38d06cae947ec909fc4f75c6d137bb27a72b76 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Generic debug support functions for IA32/x64.\r
+  IA32/x64 generic functions to support Debug Support protocol.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -90,11 +90,27 @@ HookEntry (
   //\r
   OldIntFlagState = SaveAndDisableInterrupts ();\r
 \r
+  //\r
+  // gets IDT Gate descriptor by index\r
+  //\r
   ReadIdtGateDescriptor (ExceptionType, &(IdtEntryTable[ExceptionType].OrigDesc));\r
+  //\r
+  // stores orignal interrupt handle \r
+  //\r
   IdtEntryTable[ExceptionType].OrigVector = (DEBUG_PROC) GetInterruptHandleFromIdt (&(IdtEntryTable[ExceptionType].OrigDesc));\r
 \r
+  // \r
+  // encodes new IDT Gate descriptor by stub entry \r
+  //\r
   Vect2Desc (&IdtEntryTable[ExceptionType].NewDesc, IdtEntryTable[ExceptionType].StubEntry);\r
+  //\r
+  // stores NewCallback\r
+  //\r
   IdtEntryTable[ExceptionType].RegisteredCallback = NewCallback;\r
+\r
+  //\r
+  // writes back new IDT Gate descriptor\r
+  //\r
   WriteIdtGateDescriptor (ExceptionType, &(IdtEntryTable[ExceptionType].NewDesc));\r
 \r
   //\r
@@ -214,6 +230,7 @@ RegisterExceptionCallback (
   return ManageIdtEntryTable (ExceptionCallback, ExceptionType);\r
 }\r
 \r
+\r
 /**\r
   Invalidates processor instruction cache for a memory range. Subsequent execution in this range\r
   causes a fresh memory fetch to retrieve code to be executed.                                  \r
@@ -244,6 +261,7 @@ InvalidateInstructionCache (
   Common piece of code that invokes the registered handlers.\r
 \r
   This code executes in exception context so no efi calls are allowed.\r
+  This code is called from assembly file.\r
 \r
   @param  ExceptionType     Exception type\r
   @param  ContextRecord     System context\r