diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-03-15 00:52:27 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-03-15 00:52:27 +0000 |
commit | d4e0afd8261eb00f66e2af591333e31be667579c (patch) | |
tree | ef805783af904b05314ba04a46721b124f4dd966 /MdeModulePkg | |
parent | 640dfdc31da71ed374544d38208a62fdb38ccda0 (diff) | |
download | edk2-d4e0afd8261eb00f66e2af591333e31be667579c.tar.gz edk2-d4e0afd8261eb00f66e2af591333e31be667579c.tar.bz2 edk2-d4e0afd8261eb00f66e2af591333e31be667579c.zip |
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11399 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c | 57 |
1 files changed, 44 insertions, 13 deletions
diff --git a/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c b/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c index 195432ddfd..1182e2eb5b 100644 --- a/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c +++ b/MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.c @@ -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),
|