mirror of
				https://git.proxmox.com/git/mirror_edk2
				synced 2025-11-04 02:40:26 +00:00 
			
		
		
		
	git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11399 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		
							parent
							
								
									640dfdc31d
								
							
						
					
					
						commit
						d4e0afd826
					
				@ -25,6 +25,22 @@
 | 
			
		||||
///
 | 
			
		||||
/// Debug Mask Protocol function prototypes
 | 
			
		||||
///
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Retrieves the current debug print error level mask for a module are returns
 | 
			
		||||
  it in CurrentDebugMask.
 | 
			
		||||
 | 
			
		||||
  @param  This              The protocol instance pointer.
 | 
			
		||||
  @param  CurrentDebugMask  Pointer to the debug print error level mask that 
 | 
			
		||||
                            is returned.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The current debug print error level mask was
 | 
			
		||||
                                 returned in CurrentDebugMask.
 | 
			
		||||
  @retval EFI_INVALID_PARAMETER  CurrentDebugMask is NULL.
 | 
			
		||||
  @retval EFI_DEVICE_ERROR       The current debug print error level mask could
 | 
			
		||||
                                 not be retrieved.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
EFI_STATUS
 | 
			
		||||
EFIAPI
 | 
			
		||||
GetDebugMask (
 | 
			
		||||
@ -32,6 +48,19 @@ GetDebugMask (
 | 
			
		||||
  IN OUT UINTN                *CurrentDebugMask  
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Sets the current debug print error level mask for a module to the value
 | 
			
		||||
  specified by NewDebugMask.
 | 
			
		||||
 | 
			
		||||
  @param  This          The protocol instance pointer.
 | 
			
		||||
  @param  NewDebugMask  The new debug print error level mask for this module.
 | 
			
		||||
 | 
			
		||||
  @retval EFI_SUCCESS            The current debug print error level mask was
 | 
			
		||||
                                 set to the value specified by NewDebugMask.
 | 
			
		||||
  @retval EFI_DEVICE_ERROR       The current debug print error level mask could
 | 
			
		||||
                                 not be set to the value specified by NewDebugMask.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
EFI_STATUS
 | 
			
		||||
EFIAPI
 | 
			
		||||
SetDebugMask (
 | 
			
		||||
@ -73,7 +102,7 @@ UINT32            mDebugPrintErrorLevel        = 0;
 | 
			
		||||
/// the global debug print error level mask value.  The UefiBootServicesTableLib
 | 
			
		||||
/// is not used to prevent a circular dependency between these libraries.
 | 
			
		||||
///
 | 
			
		||||
EFI_SYSTEM_TABLE  *mST                         = NULL;
 | 
			
		||||
EFI_SYSTEM_TABLE  *mSystemTable                         = NULL;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  The constructor function caches the PCI Express Base Address and creates a 
 | 
			
		||||
@ -103,7 +132,7 @@ DxeDebugPrintErrorLevelLibConstructor (
 | 
			
		||||
  //
 | 
			
		||||
  // Install Debug Mask Protocol onto ImageHandle
 | 
			
		||||
  //  
 | 
			
		||||
  mST = SystemTable;
 | 
			
		||||
  mSystemTable = SystemTable;
 | 
			
		||||
  Status = SystemTable->BootServices->InstallMultipleProtocolInterfaces (
 | 
			
		||||
                                        &ImageHandle,
 | 
			
		||||
                                        &gEfiDebugMaskProtocolGuid, &mDebugMaskProtocol,
 | 
			
		||||
@ -171,7 +200,7 @@ GetDebugPrintErrorLevel (
 | 
			
		||||
  // This case should only occur if debug print is generated by a library
 | 
			
		||||
  // constructor for this module
 | 
			
		||||
  //
 | 
			
		||||
  if (mST == NULL) {
 | 
			
		||||
  if (mSystemTable == NULL) {
 | 
			
		||||
    return PcdGet32 (PcdDebugPrintErrorLevel);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -185,15 +214,15 @@ GetDebugPrintErrorLevel (
 | 
			
		||||
    //
 | 
			
		||||
    // Make sure the TPL Level is low enough for EFI Variable Services to be called
 | 
			
		||||
    //
 | 
			
		||||
    CurrentTpl = mST->BootServices->RaiseTPL (TPL_HIGH_LEVEL);
 | 
			
		||||
    mST->BootServices->RestoreTPL (CurrentTpl);
 | 
			
		||||
    CurrentTpl = mSystemTable->BootServices->RaiseTPL (TPL_HIGH_LEVEL);
 | 
			
		||||
    mSystemTable->BootServices->RestoreTPL (CurrentTpl);
 | 
			
		||||
    if (CurrentTpl <= TPL_CALLBACK) {
 | 
			
		||||
      //
 | 
			
		||||
      // Attempt to retrieve the global debug print error level mask from the 
 | 
			
		||||
      // EFI Variable
 | 
			
		||||
      //
 | 
			
		||||
      Size = sizeof (GlobalErrorLevel);
 | 
			
		||||
      Status = mST->RuntimeServices->GetVariable (
 | 
			
		||||
      Status = mSystemTable->RuntimeServices->GetVariable (
 | 
			
		||||
                                       DEBUG_MASK_VARIABLE_NAME, 
 | 
			
		||||
                                       &gEfiGenericVariableGuid, 
 | 
			
		||||
                                       NULL, 
 | 
			
		||||
@ -225,9 +254,11 @@ GetDebugPrintErrorLevel (
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
  Sets the global debug print error level mask fpr the entire platform.
 | 
			
		||||
 | 
			
		||||
  @retval  TRUE   The debug print error level mask was sucessfully set.
 | 
			
		||||
  @retval  FALSE  The debug print error level mask could not be set.
 | 
			
		||||
  
 | 
			
		||||
  @param   ErrorLevel     Global debug print error level
 | 
			
		||||
  
 | 
			
		||||
  @retval  TRUE           The debug print error level mask was sucessfully set.
 | 
			
		||||
  @retval  FALSE          The debug print error level mask could not be set.
 | 
			
		||||
 | 
			
		||||
**/
 | 
			
		||||
BOOLEAN
 | 
			
		||||
@ -244,19 +275,19 @@ SetDebugPrintErrorLevel (
 | 
			
		||||
  //
 | 
			
		||||
  // Make sure the constructor has been executed
 | 
			
		||||
  //
 | 
			
		||||
  if (mST != NULL) {
 | 
			
		||||
  if (mSystemTable != NULL) {
 | 
			
		||||
    //
 | 
			
		||||
    // Make sure the TPL Level is low enough for EFI Variable Services
 | 
			
		||||
    //
 | 
			
		||||
    CurrentTpl = mST->BootServices->RaiseTPL (TPL_HIGH_LEVEL);
 | 
			
		||||
    mST->BootServices->RestoreTPL (CurrentTpl);
 | 
			
		||||
    CurrentTpl = mSystemTable->BootServices->RaiseTPL (TPL_HIGH_LEVEL);
 | 
			
		||||
    mSystemTable->BootServices->RestoreTPL (CurrentTpl);
 | 
			
		||||
    if (CurrentTpl <= TPL_CALLBACK) {
 | 
			
		||||
      //
 | 
			
		||||
      // Attempt to store the global debug print error level mask in an EFI Variable
 | 
			
		||||
      //
 | 
			
		||||
      GlobalErrorLevel = (UINTN)ErrorLevel;
 | 
			
		||||
      Size = sizeof (GlobalErrorLevel);
 | 
			
		||||
      Status = mST->RuntimeServices->SetVariable (
 | 
			
		||||
      Status = mSystemTable->RuntimeServices->SetVariable (
 | 
			
		||||
                                       DEBUG_MASK_VARIABLE_NAME, 
 | 
			
		||||
                                       &gEfiGenericVariableGuid, 
 | 
			
		||||
                                       (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS),
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user