mirror of
				https://github.com/acidanthera/audk.git
				synced 2025-11-03 21:17:23 +01:00 
			
		
		
		
	This patch is to use the Context to indicate SMM Debug Agent support or not if InitFlag is DEBUG_AGENT_INIT_SMM. Context must point to a BOOLEAN if it's not NULL. Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@Intel.com>
		
			
				
	
	
		
			78 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/** @file
 | 
						|
  Debug Agent library implementition with empty functions.
 | 
						|
 | 
						|
  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
 | 
						|
  SPDX-License-Identifier: BSD-2-Clause-Patent
 | 
						|
 | 
						|
**/
 | 
						|
 | 
						|
#include <Library/DebugAgentLib.h>
 | 
						|
 | 
						|
/**
 | 
						|
  Initialize debug agent.
 | 
						|
 | 
						|
  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 Library 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.
 | 
						|
 | 
						|
  If InitFlag is DEBUG_AGENT_INIT_SMM, Context must point to a BOOLEAN if it's not
 | 
						|
  NULL, which indicates SMM Debug Agent supported or not.
 | 
						|
 | 
						|
  @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
 | 
						|
EFIAPI
 | 
						|
InitializeDebugAgent (
 | 
						|
  IN UINT32                InitFlag,
 | 
						|
  IN VOID                  *Context  OPTIONAL,
 | 
						|
  IN DEBUG_AGENT_CONTINUE  Function  OPTIONAL
 | 
						|
  )
 | 
						|
{
 | 
						|
  switch (InitFlag) {
 | 
						|
    case DEBUG_AGENT_INIT_SMM:
 | 
						|
      if (Context != NULL) {
 | 
						|
        *(BOOLEAN *)Context = FALSE;
 | 
						|
      }
 | 
						|
 | 
						|
      return;
 | 
						|
  }
 | 
						|
 | 
						|
  if (Function != NULL) {
 | 
						|
    Function (Context);
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
/**
 | 
						|
  Enable/Disable the interrupt of debug timer and return the interrupt state
 | 
						|
  prior to the operation.
 | 
						|
 | 
						|
  If EnableStatus is TRUE, enable the interrupt of debug timer.
 | 
						|
  If EnableStatus is FALSE, disable the interrupt of debug timer.
 | 
						|
 | 
						|
  @param[in] EnableStatus    Enable/Disable.
 | 
						|
 | 
						|
  @return FALSE always.
 | 
						|
 | 
						|
**/
 | 
						|
BOOLEAN
 | 
						|
EFIAPI
 | 
						|
SaveAndSetDebugTimerInterrupt (
 | 
						|
  IN BOOLEAN  EnableStatus
 | 
						|
  )
 | 
						|
{
 | 
						|
  return FALSE;
 | 
						|
}
 |