TianoCore EDK2 master
Loading...
Searching...
No Matches
PeiDebugPrintHobLib.c
Go to the documentation of this file.
1
10#include <PiPei.h>
11
12#include <Library/HobLib.h>
13#include <Library/DebugLib.h>
15
17#include <Guid/DebugMask.h>
18
29EFIAPI
31 IN EFI_PEI_FILE_HANDLE FileHandle,
32 IN CONST EFI_PEI_SERVICES **PeiServices
33 )
34{
35 EFI_STATUS Status;
37 UINTN Size;
38 UINT64 GlobalErrorLevel;
39 UINT32 HobErrorLevel;
40
41 Status = PeiServicesLocatePpi (
42 &gEfiPeiReadOnlyVariable2PpiGuid,
43 0,
44 NULL,
45 (VOID **)&Variable
46 );
47 if (!EFI_ERROR (Status)) {
48 Size = sizeof (GlobalErrorLevel);
49 Status = Variable->GetVariable (
50 Variable,
51 DEBUG_MASK_VARIABLE_NAME,
52 &gEfiGenericVariableGuid,
53 NULL,
54 &Size,
55 &GlobalErrorLevel
56 );
57 if (!EFI_ERROR (Status)) {
58 //
59 // Build the GUID'ed HOB for DXE
60 //
61 HobErrorLevel = (UINT32)GlobalErrorLevel;
63 &gEfiGenericVariableGuid,
64 &HobErrorLevel,
65 sizeof (HobErrorLevel)
66 );
67 }
68 }
69
70 return EFI_SUCCESS;
71}
UINT64 UINTN
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
Definition: HobLib.c:375
EFI_STATUS EFIAPI PeiServicesLocatePpi(IN CONST EFI_GUID *Guid, IN UINTN Instance, IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor, IN OUT VOID **Ppi)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
EFI_STATUS EFIAPI PeiDebugPrintHobLibConstructor(IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
VOID * EFI_PEI_FILE_HANDLE
Definition: PiPeiCis.h:26
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
#define EFI_SUCCESS
Definition: UefiBaseType.h:112