]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.c
MdeModulePkg/CapsuleLib: Fix runtime issue
[mirror_edk2.git] / MdeModulePkg / Library / DebugAgentLibNull / DebugAgentLibNull.c
index cf945d01ad6b10d74cd0b3ebcb82ef4cc33c557f..253fbdc967e83499e83fdd1be2a7b5830d4ff5dc 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Debug Agent library implementition with empty functions.\r
 \r
-  Copyright (c) 2010, Intel Corporation\r
-  All rights reserved. This program and the accompanying materials\r
+  Copyright (c) 2010, 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
   http://opensource.org/licenses/bsd-license.php\r
 \r
 **/\r
 \r
+#include <Library/DebugAgentLib.h>\r
+\r
 /**\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
+  If the parameter Function is not NULL, Debug Agent Library instance will invoke it by\r
+  passing in the Context to be its parameter.\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 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
 {\r
-\r
+  if (Function != NULL) {\r
+    Function (Context);\r
+  }\r
 }\r
 \r
 /**\r
-  Enable/Disable the interrupt of debug timer.\r
+  Enable/Disable the interrupt of debug timer and return the interrupt state\r
+  prior to the operation.\r
 \r
   If EnableStatus is TRUE, enable the interrupt of debug timer.\r
   If EnableStatus is FALSE, disable the interrupt of debug timer.\r
 \r
   @param[in] EnableStatus    Enable/Disable.\r
 \r
+  @return FALSE always.\r
+\r
 **/\r
-VOID\r
+BOOLEAN\r
 EFIAPI\r
-SetDebugTimerInterrupt (\r
+SaveAndSetDebugTimerInterrupt (\r
   IN BOOLEAN                EnableStatus\r
   )\r
 {\r
-\r
+  return FALSE;\r
 }\r
 \r