summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2014-03-27 06:02:54 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2014-03-27 06:02:54 +0000
commit3bf04a71bff3d414cd3f880ccf7243c12d0f7268 (patch)
tree38c405c84683ab6c6c66c24353b39a5b6bcb3e78
parent90651f777344979cc3a85f56f10a176ceacaf065 (diff)
downloadedk2-platforms-3bf04a71bff3d414cd3f880ccf7243c12d0f7268.tar.xz
Not to copy mailbox into new space when debug agent initialization for S3 Boot Script.
Contributed-under: TianoCore Contribution Agreement 1.0 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@15402 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c
index 71130d8aaa..e424c0f8d8 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c
@@ -1,7 +1,7 @@
/** @file
Debug Agent library implementition for Dxe Core and Dxr modules.
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -283,16 +283,21 @@ SetupDebugAgentEnviroment (
//
InitializeDebugIdt ();
- if (Mailbox != NULL) {
- //
- // If Mailbox exists, copy it into one global variable,
- //
- CopyMem (&mMailbox, Mailbox, sizeof (DEBUG_AGENT_MAILBOX));
- } else {
- ZeroMem (&mMailbox, sizeof (DEBUG_AGENT_MAILBOX));
- }
+ //
+ // If mMailboxPointer is not set before, set it
+ //
+ if (mMailboxPointer == NULL) {
+ if (Mailbox != NULL) {
+ //
+ // If Mailbox exists, copy it into one global variable
+ //
+ CopyMem (&mMailbox, Mailbox, sizeof (DEBUG_AGENT_MAILBOX));
+ } else {
+ ZeroMem (&mMailbox, sizeof (DEBUG_AGENT_MAILBOX));
+ }
+ mMailboxPointer = &mMailbox;
+ }
- mMailboxPointer = &mMailbox;
//
// Initialize debug communication port
//
@@ -521,6 +526,10 @@ InitializeDebugAgent (
VerifyMailboxChecksum (Mailbox);
}
//
+ // Save Mailbox pointer in global variable
+ //
+ mMailboxPointer = Mailbox;
+ //
// Set up IDT table and prepare for IDT entries
//
SetupDebugAgentEnviroment (Mailbox);