X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=EdkNt32Pkg%2FLibrary%2FNt32OemHookStatusCodeLib%2FNt32OemHookStatusCodeLib.c;h=25f2c3c81ec12ecefd50f75e33ffde70bcab8093;hp=955842d464c37ff2a59f25ea42f1c8338e9c0fbd;hb=7aa2023efad3864245d046697864d1430ec92e2a;hpb=ba53dd4a1a070ab69a29f013f037fb8c8ce4bcc7 diff --git a/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c b/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c index 955842d464..25f2c3c81e 100644 --- a/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c +++ b/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c @@ -14,24 +14,26 @@ **/ -#include - // // Cache of WinNtThunk protocol -// +// +STATIC EFI_WIN_NT_THUNK_PROTOCOL *mWinNt; // // Cache of standard output handle . -// +// +STATIC HANDLE mStdOut; /** Initialize OEM status code device . + @return Always return EFI_SUCCESS. + **/ -VOID +EFI_STATUS EFIAPI OemHookStatusCodeInitialize ( VOID @@ -45,11 +47,11 @@ OemHookStatusCodeInitialize ( // Locate NtThunkPpi for retrieving standard output handle // Status = PeiServicesLocatePpi ( - &gPeiNtThunkPpiGuid, - 0, - NULL, - (VOID **) &NtThunkPpi - ); + &gPeiNtThunkPpiGuid, + 0, + NULL, + (VOID **) &NtThunkPpi + ); ASSERT_EFI_ERROR (Status); @@ -71,19 +73,19 @@ OemHookStatusCodeInitialize ( // mStdOut = mWinNt->GetStdHandle (STD_OUTPUT_HANDLE); - return; + return EFI_SUCCESS; } /** 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 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. + 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. @@ -149,8 +151,6 @@ OemHookStatusCodeReport ( NULL ); - CpuBreakpoint (); - return EFI_SUCCESS; } else if (Data != NULL && @@ -179,7 +179,14 @@ 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, Instance); + CharCount = AsciiSPrint ( + 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. @@ -194,7 +201,7 @@ OemHookStatusCodeReport ( ); } - if (Data) { + if (Data != NULL) { CharCount += AsciiSPrint ( &Buffer[CharCount - 1], (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)), @@ -209,9 +216,22 @@ OemHookStatusCodeReport ( "\n\r" ); } 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, Instance); + CharCount = AsciiSPrint ( + 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, Instance); + CharCount = AsciiSPrint ( + Buffer, + EFI_STATUS_CODE_DATA_MAX_SIZE, + "Undefined: C%x:V%x I%x\n\r", + CodeType, + Value, + Instance + ); } //