]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Not to copy mailbox into new space when debug agent initialization for S3 Boot Script.
authorJeff Fan <jeff.fan@intel.com>
Thu, 27 Mar 2014 06:02:54 +0000 (06:02 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 27 Mar 2014 06:02:54 +0000 (06:02 +0000)
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

SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/DxeDebugAgentLib.c

index 71130d8aaaa424f1155aa52e0031dbeeb2e86ad8..e424c0f8d8f2eebb24e1d22a8b96d62a8a983b02 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Debug Agent library implementition for Dxe Core and Dxr modules.\r
 \r
-  Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -283,16 +283,21 @@ SetupDebugAgentEnviroment (
   //\r
   InitializeDebugIdt ();\r
 \r
-  if (Mailbox != NULL) {\r
-    //\r
-    // If Mailbox exists, copy it into one global variable,\r
-    //\r
-    CopyMem (&mMailbox, Mailbox, sizeof (DEBUG_AGENT_MAILBOX));\r
-  } else {\r
-    ZeroMem (&mMailbox, sizeof (DEBUG_AGENT_MAILBOX));\r
-  }  \r
+  //\r
+  // If mMailboxPointer is not set before, set it\r
+  //\r
+  if (mMailboxPointer == NULL) {\r
+    if (Mailbox != NULL) {\r
+      //\r
+      // If Mailbox exists, copy it into one global variable\r
+      //\r
+      CopyMem (&mMailbox, Mailbox, sizeof (DEBUG_AGENT_MAILBOX));\r
+    } else {\r
+      ZeroMem (&mMailbox, sizeof (DEBUG_AGENT_MAILBOX));\r
+    }\r
+    mMailboxPointer = &mMailbox;\r
+  }\r
 \r
-  mMailboxPointer = &mMailbox;\r
   //\r
   // Initialize debug communication port\r
   //\r
@@ -521,6 +526,10 @@ InitializeDebugAgent (
       VerifyMailboxChecksum (Mailbox);\r
     }\r
     //\r
+    // Save Mailbox pointer in global variable\r
+    //\r
+    mMailboxPointer = Mailbox;\r
+    //\r
     // Set up IDT table and prepare for IDT entries\r
     //\r
     SetupDebugAgentEnviroment (Mailbox);\r