1. Add init flag DEBUG_AGENT_INIT_DXE_AP.

2. Add definition DEBUG_AGENT_CONTINUE.
3. Update the definition of InitializeDebugAgent() more comments.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10660 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
vanjeff 2010-07-19 02:26:09 +00:00
parent 635021c594
commit 4cf7e0380e
3 changed files with 71 additions and 14 deletions

View File

@ -244,7 +244,7 @@ DxeMain (
// //
// Initialize Debug Agent to support source level debug in DXE phase // Initialize Debug Agent to support source level debug in DXE phase
// //
InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_CORE, HobStart); InitializeDebugAgent (DEBUG_AGENT_INIT_DXE_CORE, HobStart, NULL);
// //
// Initialize Memory Services // Initialize Memory Services

View File

@ -22,21 +22,60 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define DEBUG_AGENT_INIT_ENTER_SMI 5 #define DEBUG_AGENT_INIT_ENTER_SMI 5
#define DEBUG_AGENT_INIT_EXIT_SMI 6 #define DEBUG_AGENT_INIT_EXIT_SMI 6
#define DEBUG_AGENT_INIT_S3 7 #define DEBUG_AGENT_INIT_S3 7
#define DEBUG_AGENT_INIT_DXE_AP 8
//
// Context for DEBUG_AGENT_INIT_POSTMEM_SEC
//
typedef struct {
UINTN HeapMigrateOffset;
UINTN StackMigrateOffset;
} DEBUG_AGENT_CONTEXT_POSTMEM_SEC;
/**
Caller provided function to be invoked at the end of InitializeDebugAgent().
Refer to the descrption for InitializeDebugAgent() for more details.
@param[in] Context The first input parameter of InitializeDebugAgent().
**/
typedef
VOID
(EFIAPI * DEBUG_AGENT_CONTINUE)(
IN VOID *Context
);
/** /**
Initialize debug agent. Initialize debug agent.
This function is used to set up debug enviroment. This function is used to set up debug environment to support source level debugging.
If certain Debug Agent Library instance has to save some private data in the stack,
this function must work on the mode that doesn't return to the caller, then
the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one
function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is
responsible to invoke the passing-in function at the end of InitializeDebugAgent().
If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by
passing in the Context to be its parameter.
If Function() is NULL, Debug Agent Library instance will return after setup debug
environment.
@param[in] InitFlag Init flag is used to decide the initialize process. @param[in] InitFlag Init flag is used to decide the initialize process.
@param[in] Context Context needed according to InitFlag; it was optional. @param[in] Context Context needed according to InitFlag; it was optional.
@param[in] Function Continue function called by debug agent library; it was
optional.
**/ **/
VOID VOID
EFIAPI EFIAPI
InitializeDebugAgent ( InitializeDebugAgent (
IN UINT32 InitFlag, IN UINT32 InitFlag,
IN VOID *Context OPTIONAL IN VOID *Context, OPTIONAL
IN DEBUG_AGENT_CONTINUE Function OPTIONAL
); );
/** /**

View File

@ -12,23 +12,41 @@
**/ **/
#include <Library/DebugAgentLib.h>
/** /**
Initialize debug agent. Initialize debug agent.
This function is used to set up debug enviroment. It may enable interrupts. This function is used to set up debug environment to support source level debugging.
If certain Debug Agent Library instance has to save some private data in the stack,
this function must work on the mode that doesn't return to the caller, then
the caller needs to wrap up all rest of logic after InitializeDebugAgent() into one
function and pass it into InitializeDebugAgent(). InitializeDebugAgent() is
responsible to invoke the passing-in function at the end of InitializeDebugAgent().
@param[in] InitFlag Init flag is used to decide initialize process. If the parameter Function is not NULL, Debug Agent Libary instance will invoke it by
@param[in] Context Context needed according to InitFlag, it was optional. passing in the Context to be its parameter.
If Function() is NULL, Debug Agent Library instance will return after setup debug
environment.
@param[in] InitFlag Init flag is used to decide the initialize process.
@param[in] Context Context needed according to InitFlag; it was optional.
@param[in] Function Continue function called by debug agent library; it was
optional.
**/ **/
VOID VOID
EFIAPI EFIAPI
InitializeDebugAgent ( InitializeDebugAgent (
IN UINT32 InitFlag, IN UINT32 InitFlag,
IN VOID *Context OPTIONAL IN VOID *Context, OPTIONAL
IN DEBUG_AGENT_CONTINUE Function OPTIONAL
) )
{ {
if (Function != NULL) {
Function (Context);
}
} }
/** /**