summaryrefslogtreecommitdiffstats
path: root/SourceLevelDebugPkg
diff options
context:
space:
mode:
Diffstat (limited to 'SourceLevelDebugPkg')
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
index f49a592d27..cc5bb957f7 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
@@ -159,8 +159,9 @@ RestoreDebugRegister (
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,
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
- NULL.
+ it will override IDT table entries and initialize debug port. Context must
+ 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
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
@@ -205,6 +206,10 @@ InitializeDebugAgent (
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "DebugAgent: Cannot install configuration table for persisted vector handoff info!\n"));
+ if (Context != NULL) {
+ *(BOOLEAN *)Context = FALSE;
+ }
+
CpuDeadLoop ();
}
@@ -215,6 +220,10 @@ InitializeDebugAgent (
if ((Status == EFI_SUCCESS) && (Mailbox != NULL)) {
VerifyMailboxChecksum (Mailbox);
mMailboxPointer = Mailbox;
+ if (Context != NULL) {
+ *(BOOLEAN *)Context = TRUE;
+ }
+
break;
}
@@ -224,6 +233,10 @@ InitializeDebugAgent (
Mailbox = GetMailboxFromHob ();
if (Mailbox != NULL) {
mMailboxPointer = Mailbox;
+ if (Context != NULL) {
+ *(BOOLEAN *)Context = TRUE;
+ }
+
break;
}
@@ -275,6 +288,10 @@ InitializeDebugAgent (
//
CopyMem ((VOID *)IdtDescriptor.Base, &IdtEntry, 33 * sizeof (IA32_IDT_GATE_DESCRIPTOR));
+ if (Context != NULL) {
+ *(BOOLEAN *)Context = TRUE;
+ }
+
break;
case DEBUG_AGENT_INIT_ENTER_SMI: