diff options
Diffstat (limited to 'Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib')
4 files changed, 64 insertions, 85 deletions
diff --git a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/CommonHeader.h b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/CommonHeader.h deleted file mode 100644 index 32e7299f2e..0000000000 --- a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/CommonHeader.h +++ /dev/null @@ -1,41 +0,0 @@ -/**@file
- Common header file shared by all source files.
-
- This file includes package header files, library classes and protocol, PPI & GUID definitions.
-
- Copyright (c) 2007, Intel Corporation.
- All rights reserved.
- This software and associated documentation (if any) is furnished
- under a license and may only be used or copied in accordance
- with the terms of the license. Except as permitted by such
- license, no part of this software or documentation may be
- reproduced, stored in a retrieval system, or transmitted in any
- form or by any means without the express written consent of
- Intel Corporation.
-**/
-
-#ifndef __COMMON_HEADER_H_
-#define __COMMON_HEADER_H_
-
-
-//
-// The package level header files this module uses
-//
-#include <Dxe.h>
-#include <EdkDxe.h>
-#include <WinNtDxe.h>
-//
-// The protocols, PPI and GUID defintions for this module
-//
-#include <Guid/StatusCodeDataTypeId.h>
-//
-// The Library classes this module consumes
-//
-#include <Library/OemHookStatusCodeLib.h>
-#include <Library/DebugLib.h>
-#include <Library/HobLib.h>
-#include <Library/PrintLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/ReportStatusCodeLib.h>
-
-#endif
diff --git a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf index 0a92734927..bd00ebf909 100644 --- a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf +++ b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.inf @@ -27,7 +27,7 @@ FILE_GUID = EF172A23-C7C5-47b7-B24E-D10DFE15540F
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
- LIBRARY_CLASS = OemHookStatusCodeLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
+ LIBRARY_CLASS = OemHookStatusCodeLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
@@ -48,7 +48,6 @@ [Sources.common]
Nt32OemHookStatusCodeLib.c
- CommonHeader.h
################################################################################
@@ -61,6 +60,8 @@ [Packages]
MdePkg/MdePkg.dec
Nt32Pkg/Nt32Pkg.dec
+ IntelFrameworkPkg/IntelFrameworkPkg.dec
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
################################################################################
@@ -87,3 +88,5 @@ [Guids]
gEfiStatusCodeSpecificDataGuid # ALWAYS_CONSUMED
+[Protocols]
+ gEfiWinNtThunkProtocolGuid # ALWAYS_CONSUMED
diff --git a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.msa b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.msa index 394fc24654..e1bebd5b0b 100644 --- a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.msa +++ b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/DxeNt32OemHookStatusCodeLib.msa @@ -51,11 +51,12 @@ <Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
<Package PackageGuid="0fb2aa2d-10d5-40a5-a9dc-060c12a4a3f3"/>
</PackageDependencies>
- <Hobs>
- <HobTypes HobGuidCName="gEfiWinNtThunkProtocolGuid" Usage="ALWAYS_CONSUMED">
- <HobType>GUID_EXTENSION</HobType>
- </HobTypes>
- </Hobs>
+ <Protocols>
+ <Protocols>
+ <Protocol Usage="ALWAYS_CONSUMED">
+ <ProtocolCName>gEfiWinNtThunkProtocolGuid</ProtocolCName>
+ </Protocol>
+ </Protocols>
<Guids>
<GuidCNames Usage="ALWAYS_CONSUMED">
<GuidCName>gEfiStatusCodeSpecificDataGuid</GuidCName>
diff --git a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c index 75acde6020..c9b2aa7a10 100644 --- a/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c +++ b/Nt32Pkg/Library/DxeNt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c @@ -15,18 +15,34 @@ **/
//
-// Include common header file for this module.
+// The package level header files this module uses
//
-#include "CommonHeader.h"
+#include <FrameWorkDxe.h>
+#include <WinNtDxe.h>
//
-// Cache of WinNtThunk protocol
+// The protocols, PPI and GUID defintions for this module
+//
+#include <Protocol/WinNtThunk.h>
+#include <Guid/StatusCodeDataTypeId.h>
+//
+// The Library classes this module consumes
+//
+#include <Library/OemHookStatusCodeLib.h>
+#include <Library/DebugLib.h>
+#include <Library/HobLib.h>
+#include <Library/PrintLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/ReportStatusCodeLib.h>
+
+//
+// Cache of WinNtThunk protocol
//
STATIC
EFI_WIN_NT_THUNK_PROTOCOL *mWinNt;
//
-// Cache of standard output handle .
+// Cache of standard output handle .
//
STATIC
HANDLE mStdOut;
@@ -64,29 +80,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.
**/
@@ -145,12 +161,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) {
//
@@ -166,18 +182,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],
@@ -203,19 +219,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
);
}
|