diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-07-02 03:11:11 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-07-02 03:11:11 +0000 |
commit | 552065964397c0492bcfd69ae1475f5437900267 (patch) | |
tree | 0db784f9748fbc8510e755b814a3355824247ad4 /Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c | |
parent | 70c94b3b6ddf1d84ddb20118d898fd7a85725386 (diff) | |
download | edk2-platforms-552065964397c0492bcfd69ae1475f5437900267.tar.xz |
1. Clean up DxeNt32OemHookStatusCodeLib.inf and PeiNt32OemHookStatusCodeLib.inf
2. Updated Dsc file
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2928 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c')
-rw-r--r-- | Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c | 93 |
1 files changed, 54 insertions, 39 deletions
diff --git a/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c b/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c index fcab1036f4..599c9c7751 100644 --- a/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c +++ b/Nt32Pkg/Library/PeiNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c @@ -15,18 +15,33 @@ **/
//
-// Include common header file for this module.
+// The package level header files this module uses
//
-#include "CommonHeader.h"
+#include <FrameworkPei.h>
+#include <WinNtPeim.h>
+//
+// The protocols, PPI and GUID defintions for this module
+//
+#include <Guid/StatusCodeDataTypeId.h>
+#include <Ppi/NtThunk.h>
+//
+// The Library classes this module consumes
+//
+#include <Library/OemHookStatusCodeLib.h>
+#include <Library/DebugLib.h>
+#include <Library/PrintLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/ReportStatusCodeLib.h>
+#include <Library/PeiServicesLib.h>
//
-// Cache of WinNtThunk protocol
+// Cache of WinNtThunk protocol
//
STATIC
EFI_WIN_NT_THUNK_PROTOCOL *mWinNt;
//
-// Cache of standard output handle .
+// Cache of standard output handle .
//
STATIC
HANDLE mStdOut;
@@ -47,7 +62,7 @@ OemHookStatusCodeInitialize ( PEI_NT_THUNK_PPI *NtThunkPpi;
EFI_STATUS Status;
-
+
//
// Locate NtThunkPpi for retrieving standard output handle
//
@@ -61,7 +76,7 @@ OemHookStatusCodeInitialize ( ASSERT_EFI_ERROR (Status);
mWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *) NtThunkPpi->NtThunk ();
-
+
//
// Cache standard output handle.
@@ -73,29 +88,29 @@ OemHookStatusCodeInitialize ( /**
Report status code to OEM device.
-
+
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
-
- @param Value Describes the current status of a hardware or software entity.
- This included information about the class and subclass that is used to classify the entity
- as well as an operation. For progress codes, the operation is the current activity.
- For error codes, it is the exception. For debug codes, it is not defined at this time.
- Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
+
+ @param Value Describes the current status of a hardware or software entity.
+ This included information about the class and subclass that is used to classify the entity
+ as well as an operation. For progress codes, the operation is the current activity.
+ For error codes, it is the exception. For debug codes, it is not defined at this time.
+ Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
-
- @param Instance The enumeration of a hardware or software entity within the system.
- A system may contain multiple entities that match a class/subclass pairing.
- The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
+
+ @param Instance The enumeration of a hardware or software entity within the system.
+ A system may contain multiple entities that match a class/subclass pairing.
+ The instance differentiates between them. An instance of 0 indicates that instance information is unavailable,
not meaningful, or not relevant. Valid instance numbers start with 1.
- @param CallerId This optional parameter may be used to identify the caller.
- This parameter allows the status code driver to apply different rules to different callers.
+ @param CallerId This optional parameter may be used to identify the caller.
+ This parameter allows the status code driver to apply different rules to different callers.
Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.
@param Data This optional parameter may be used to pass additional data
-
+
@return The function always return EFI_SUCCESS.
**/
@@ -154,12 +169,12 @@ OemHookStatusCodeReport ( // Print DEBUG() information into output buffer.
//
CharCount = AsciiVSPrint (
- Buffer,
- EFI_STATUS_CODE_DATA_MAX_SIZE,
- Format,
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ Format,
Marker
);
- } else if (Data != NULL &&
+ } else if (Data != NULL &&
CompareGuid (&Data->Type, &gEfiStatusCodeSpecificDataGuid) &&
(CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) {
//
@@ -175,18 +190,18 @@ OemHookStatusCodeReport ( // Print ERROR information into output buffer.
//
CharCount = AsciiSPrint (
- Buffer,
- EFI_STATUS_CODE_DATA_MAX_SIZE,
- "ERROR: C%x:V%x I%x",
- CodeType,
- Value,
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ "ERROR: C%x:V%x I%x",
+ CodeType,
+ Value,
Instance
);
//
// Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
//
-
+
if (CallerId != NULL) {
CharCount += AsciiSPrint (
&Buffer[CharCount - 1],
@@ -212,19 +227,19 @@ OemHookStatusCodeReport ( );
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
CharCount = AsciiSPrint (
- Buffer,
- EFI_STATUS_CODE_DATA_MAX_SIZE,
- "PROGRESS CODE: V%x I%x\n\r",
- Value,
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ "PROGRESS CODE: V%x I%x\n\r",
+ Value,
Instance
);
} else {
CharCount = AsciiSPrint (
- Buffer,
- EFI_STATUS_CODE_DATA_MAX_SIZE,
- "Undefined: C%x:V%x I%x\n\r",
- CodeType,
- Value,
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ "Undefined: C%x:V%x I%x\n\r",
+ CodeType,
+ Value,
Instance
);
}
|