]> git.proxmox.com Git - mirror_edk2.git/commitdiff
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11399 6f19259b...
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 15 Mar 2011 00:52:27 +0000 (00:52 +0000)
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 15 Mar 2011 00:52:27 +0000 (00:52 +0000)
MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c

index 195432ddfd10c7323bda90d4887d2babc09ada92..1182e2eb5b49c7bcf3962777cdc7960f0b3c6205 100644 (file)
 ///\r
 /// Debug Mask Protocol function prototypes\r
 ///\r
+\r
+/**\r
+  Retrieves the current debug print error level mask for a module are returns\r
+  it in CurrentDebugMask.\r
+\r
+  @param  This              The protocol instance pointer.\r
+  @param  CurrentDebugMask  Pointer to the debug print error level mask that \r
+                            is returned.\r
+\r
+  @retval EFI_SUCCESS            The current debug print error level mask was\r
+                                 returned in CurrentDebugMask.\r
+  @retval EFI_INVALID_PARAMETER  CurrentDebugMask is NULL.\r
+  @retval EFI_DEVICE_ERROR       The current debug print error level mask could\r
+                                 not be retrieved.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 GetDebugMask (\r
@@ -32,6 +48,19 @@ GetDebugMask (
   IN OUT UINTN                *CurrentDebugMask  \r
   );\r
 \r
+/**\r
+  Sets the current debug print error level mask for a module to the value\r
+  specified by NewDebugMask.\r
+\r
+  @param  This          The protocol instance pointer.\r
+  @param  NewDebugMask  The new debug print error level mask for this module.\r
+\r
+  @retval EFI_SUCCESS            The current debug print error level mask was\r
+                                 set to the value specified by NewDebugMask.\r
+  @retval EFI_DEVICE_ERROR       The current debug print error level mask could\r
+                                 not be set to the value specified by NewDebugMask.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 SetDebugMask (\r
@@ -73,7 +102,7 @@ UINT32            mDebugPrintErrorLevel        = 0;
 /// the global debug print error level mask value.  The UefiBootServicesTableLib\r
 /// is not used to prevent a circular dependency between these libraries.\r
 ///\r
-EFI_SYSTEM_TABLE  *mST                         = NULL;\r
+EFI_SYSTEM_TABLE  *mSystemTable                         = NULL;\r
 \r
 /**\r
   The constructor function caches the PCI Express Base Address and creates a \r
@@ -103,7 +132,7 @@ DxeDebugPrintErrorLevelLibConstructor (
   //\r
   // Install Debug Mask Protocol onto ImageHandle\r
   //  \r
-  mST = SystemTable;\r
+  mSystemTable = SystemTable;\r
   Status = SystemTable->BootServices->InstallMultipleProtocolInterfaces (\r
                                         &ImageHandle,\r
                                         &gEfiDebugMaskProtocolGuid, &mDebugMaskProtocol,\r
@@ -171,7 +200,7 @@ GetDebugPrintErrorLevel (
   // This case should only occur if debug print is generated by a library\r
   // constructor for this module\r
   //\r
-  if (mST == NULL) {\r
+  if (mSystemTable == NULL) {\r
     return PcdGet32 (PcdDebugPrintErrorLevel);\r
   }\r
 \r
@@ -185,15 +214,15 @@ GetDebugPrintErrorLevel (
     //\r
     // Make sure the TPL Level is low enough for EFI Variable Services to be called\r
     //\r
-    CurrentTpl = mST->BootServices->RaiseTPL (TPL_HIGH_LEVEL);\r
-    mST->BootServices->RestoreTPL (CurrentTpl);\r
+    CurrentTpl = mSystemTable->BootServices->RaiseTPL (TPL_HIGH_LEVEL);\r
+    mSystemTable->BootServices->RestoreTPL (CurrentTpl);\r
     if (CurrentTpl <= TPL_CALLBACK) {\r
       //\r
       // Attempt to retrieve the global debug print error level mask from the \r
       // EFI Variable\r
       //\r
       Size = sizeof (GlobalErrorLevel);\r
-      Status = mST->RuntimeServices->GetVariable (\r
+      Status = mSystemTable->RuntimeServices->GetVariable (\r
                                        DEBUG_MASK_VARIABLE_NAME, \r
                                        &gEfiGenericVariableGuid, \r
                                        NULL, \r
@@ -225,9 +254,11 @@ GetDebugPrintErrorLevel (
 \r
 /**\r
   Sets the global debug print error level mask fpr the entire platform.\r
-\r
-  @retval  TRUE   The debug print error level mask was sucessfully set.\r
-  @retval  FALSE  The debug print error level mask could not be set.\r
+  \r
+  @param   ErrorLevel     Global debug print error level\r
+  \r
+  @retval  TRUE           The debug print error level mask was sucessfully set.\r
+  @retval  FALSE          The debug print error level mask could not be set.\r
 \r
 **/\r
 BOOLEAN\r
@@ -244,19 +275,19 @@ SetDebugPrintErrorLevel (
   //\r
   // Make sure the constructor has been executed\r
   //\r
-  if (mST != NULL) {\r
+  if (mSystemTable != NULL) {\r
     //\r
     // Make sure the TPL Level is low enough for EFI Variable Services\r
     //\r
-    CurrentTpl = mST->BootServices->RaiseTPL (TPL_HIGH_LEVEL);\r
-    mST->BootServices->RestoreTPL (CurrentTpl);\r
+    CurrentTpl = mSystemTable->BootServices->RaiseTPL (TPL_HIGH_LEVEL);\r
+    mSystemTable->BootServices->RestoreTPL (CurrentTpl);\r
     if (CurrentTpl <= TPL_CALLBACK) {\r
       //\r
       // Attempt to store the global debug print error level mask in an EFI Variable\r
       //\r
       GlobalErrorLevel = (UINTN)ErrorLevel;\r
       Size = sizeof (GlobalErrorLevel);\r
-      Status = mST->RuntimeServices->SetVariable (\r
+      Status = mSystemTable->RuntimeServices->SetVariable (\r
                                        DEBUG_MASK_VARIABLE_NAME, \r
                                        &gEfiGenericVariableGuid, \r
                                        (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS),\r