]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Library/GdbDebugAgent/Arm/Processor.c
Fix more InitializeDebugAgent API change bugs. GDB stub was not turned on in example...
[mirror_edk2.git] / EmbeddedPkg / Library / GdbDebugAgent / Arm / Processor.c
index 21c868aeb2b44fe55b19a183cbae7b609fd244ff..d3c050499a302fb2f9155649bc8f669ab4429122 100755 (executable)
@@ -1,9 +1,9 @@
 /** @file\r
   Processor specific parts of the GDB stub\r
 \r
-  Copyright (c) 2008-2010, Apple Inc. All rights reserved.\r
+  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
   \r
-  All rights reserved. This program and the accompanying materials\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
   http://opensource.org/licenses/bsd-license.php\r
@@ -15,7 +15,6 @@
 \r
 \r
 #include <GdbDebugAgent.h>\r
-#include <Library/CacheMaintenanceLib.h>\r
 #include <Library/PrintLib.h>\r
 #include <Library/ArmLib.h>\r
 \r
@@ -597,17 +596,31 @@ GdbFPutString (
 /**\r
   Initialize debug agent.\r
 \r
-  This function is used to set up debug enviroment. It may enable interrupts.\r
+  This function is used to set up debug environment to support source level debugging.\r
+  If certain Debug Agent Library instance has to save some private data in the stack,\r
+  this function must work on the mode that doesn't return to the caller, then\r
+  the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one\r
+  function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is\r
+  responsible to invoke the passing-in function at the end of InitializeDebugAgent().\r
 \r
-  @param[in] InitFlag   Init flag is used to decide initialize process.\r
-  @param[in] Context    Context needed according to InitFlag, it was optional.\r
+  If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by\r
+  passing in the Context to be its parameter.\r
+\r
+  If Function() is NULL, Debug Agent Library instance will return after setup debug\r
+  environment.\r
+\r
+  @param[in] InitFlag     Init flag is used to decide the initialize process.\r
+  @param[in] Context      Context needed according to InitFlag; it was optional.\r
+  @param[in] Function     Continue function called by debug agent library; it was\r
+                          optional.\r
 \r
 **/\r
 VOID\r
 EFIAPI\r
 InitializeDebugAgent (\r
   IN UINT32                InitFlag,\r
-  IN VOID                  *Context  OPTIONAL\r
+  IN VOID                  *Context, OPTIONAL\r
+  IN DEBUG_AGENT_CONTINUE  Function  OPTIONAL\r
   )\r
 {  
   UINTN                Offset;\r
@@ -653,6 +666,10 @@ InitializeDebugAgent (
     ArmEnableInterrupts ();\r
   }\r
 \r
+  if (Function != NULL) {\r
+    Function (Context);\r
+  }\r
+\r
   return;\r
 }\r
 \r