SourceLevelDebugPkg/Library: Indicate SMM Debug Agent support or not
This patch is to use the Context to indicate SMM Debug Agent support or not if InitFlag is DEBUG_AGENT_INIT_SMM. Context must point to a BOOLEAN if it's not NULL. Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@Intel.com>
This commit is contained in:
parent
54c662845f
commit
7b3b39a2e4
@ -159,8 +159,9 @@ RestoreDebugRegister (
|
|||||||
If InitFlag is DEBUG_AGENT_INIT_SMM, it will override IDT table entries
|
If InitFlag is DEBUG_AGENT_INIT_SMM, it will override IDT table entries
|
||||||
and initialize debug port. It will get debug agent Mailbox from GUIDed HOB,
|
and initialize debug port. It will get debug agent Mailbox from GUIDed HOB,
|
||||||
it it exists, debug agent wiil copied it into the local Mailbox in SMM space.
|
it it exists, debug agent wiil copied it into the local Mailbox in SMM space.
|
||||||
it will override IDT table entries and initialize debug port. Context will be
|
it will override IDT table entries and initialize debug port. Context must
|
||||||
NULL.
|
point to a BOOLEAN if it's not NULL, which indicates SMM Debug Agent supported
|
||||||
|
or not.
|
||||||
If InitFlag is DEBUG_AGENT_INIT_ENTER_SMI, debug agent will save Debug
|
If InitFlag is DEBUG_AGENT_INIT_ENTER_SMI, debug agent will save Debug
|
||||||
Registers and get local Mailbox in SMM space. Context will be NULL.
|
Registers and get local Mailbox in SMM space. Context will be NULL.
|
||||||
If InitFlag is DEBUG_AGENT_INIT_EXIT_SMI, debug agent will restore Debug
|
If InitFlag is DEBUG_AGENT_INIT_EXIT_SMI, debug agent will restore Debug
|
||||||
@ -205,6 +206,10 @@ InitializeDebugAgent (
|
|||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
DEBUG ((DEBUG_ERROR, "DebugAgent: Cannot install configuration table for persisted vector handoff info!\n"));
|
DEBUG ((DEBUG_ERROR, "DebugAgent: Cannot install configuration table for persisted vector handoff info!\n"));
|
||||||
|
if (Context != NULL) {
|
||||||
|
*(BOOLEAN *)Context = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
CpuDeadLoop ();
|
CpuDeadLoop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,6 +220,10 @@ InitializeDebugAgent (
|
|||||||
if ((Status == EFI_SUCCESS) && (Mailbox != NULL)) {
|
if ((Status == EFI_SUCCESS) && (Mailbox != NULL)) {
|
||||||
VerifyMailboxChecksum (Mailbox);
|
VerifyMailboxChecksum (Mailbox);
|
||||||
mMailboxPointer = Mailbox;
|
mMailboxPointer = Mailbox;
|
||||||
|
if (Context != NULL) {
|
||||||
|
*(BOOLEAN *)Context = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,6 +233,10 @@ InitializeDebugAgent (
|
|||||||
Mailbox = GetMailboxFromHob ();
|
Mailbox = GetMailboxFromHob ();
|
||||||
if (Mailbox != NULL) {
|
if (Mailbox != NULL) {
|
||||||
mMailboxPointer = Mailbox;
|
mMailboxPointer = Mailbox;
|
||||||
|
if (Context != NULL) {
|
||||||
|
*(BOOLEAN *)Context = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,6 +288,10 @@ InitializeDebugAgent (
|
|||||||
//
|
//
|
||||||
CopyMem ((VOID *)IdtDescriptor.Base, &IdtEntry, 33 * sizeof (IA32_IDT_GATE_DESCRIPTOR));
|
CopyMem ((VOID *)IdtDescriptor.Base, &IdtEntry, 33 * sizeof (IA32_IDT_GATE_DESCRIPTOR));
|
||||||
|
|
||||||
|
if (Context != NULL) {
|
||||||
|
*(BOOLEAN *)Context = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEBUG_AGENT_INIT_ENTER_SMI:
|
case DEBUG_AGENT_INIT_ENTER_SMI:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user