1. DebugAgentLib will install reserved vector table to persist vectors.

2. Update PeCoffExtraActionLib to detect if debug agent initialized or not by checking each IDT entry instead of whole IDT table.

Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14886 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jeff Fan
2013-11-22 06:30:01 +00:00
committed by vanjeff
parent e41aad1521
commit 8cc26df4a6
17 changed files with 350 additions and 37 deletions

View File

@@ -18,6 +18,7 @@
Read IDT entry to check if IDT entries are setup by Debug Agent.
@param[in] IdtDescriptor Pointer to IDT Descriptor.
@param[in] InterruptType Interrupt type.
@retval TRUE IDT entries were setup by Debug Agent.
@retval FALSE IDT entries were not setuo by Debug Agent.
@@ -25,7 +26,8 @@
**/
BOOLEAN
CheckDebugAgentHandler (
IN IA32_DESCRIPTOR *IdtDescriptor
IN IA32_DESCRIPTOR *IdtDescriptor,
IN UINTN InterruptType
)
{
IA32_IDT_GATE_DESCRIPTOR *IdtEntry;
@@ -36,9 +38,10 @@ CheckDebugAgentHandler (
return FALSE;
}
InterruptHandler = IdtEntry[0].Bits.OffsetLow + (((UINTN)IdtEntry[0].Bits.OffsetHigh) << 16) +
(((UINTN)IdtEntry[0].Bits.OffsetUpper) << 32);
if (InterruptHandler >= 4 && *(UINT32 *)(InterruptHandler - 4) == AGENT_HANDLER_SIGNATURE) {
InterruptHandler = IdtEntry[InterruptType].Bits.OffsetLow +
(((UINTN)IdtEntry[InterruptType].Bits.OffsetHigh) << 16) +
(((UINTN)IdtEntry[InterruptType].Bits.OffsetUpper) << 32);
if (InterruptHandler >= sizeof (UINT32) && *(UINT32 *)(InterruptHandler - sizeof (UINT32)) == AGENT_HANDLER_SIGNATURE) {
return TRUE;
} else {
return FALSE;