2 NULL Library class that reads Debug Mask variable and if it exists makes a
3 HOB that contains the debug mask.
5 Copyright (c) 2011, Apple, Inc. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 #include <Library/HobLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/PeiServicesLib.h>
22 #include <Ppi/ReadOnlyVariable2.h>
23 #include <Guid/DebugMask.h>
27 The constructor reads variable and sets HOB
29 @param FileHandle The handle of FFS header the loaded driver.
30 @param PeiServices The pointer to the PEI services.
32 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
37 PeiDebugPrintHobLibConstructor (
38 IN EFI_PEI_FILE_HANDLE FileHandle
,
39 IN CONST EFI_PEI_SERVICES
**PeiServices
43 EFI_PEI_READ_ONLY_VARIABLE2_PPI
*Variable
;
45 UINT64 GlobalErrorLevel
;
48 Status
= PeiServicesLocatePpi (
49 &gEfiPeiReadOnlyVariable2PpiGuid
,
54 if (!EFI_ERROR (Status
)) {
55 Size
= sizeof (GlobalErrorLevel
);
56 Status
= Variable
->GetVariable (
58 DEBUG_MASK_VARIABLE_NAME
,
59 &gEfiGenericVariableGuid
,
64 if (!EFI_ERROR (Status
)) {
66 // Build the GUID'ed HOB for DXE
68 HobErrorLevel
= (UINT32
)GlobalErrorLevel
;
70 &gEfiGenericVariableGuid
,
72 sizeof (HobErrorLevel
)