VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.c@ 99404

最後變更 在這個檔案從99404是 99404,由 vboxsync 提交於 2 年 前

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.8 KB
 
1/** @file
2 NULL Library class that reads Debug Mask variable and if it exists makes a
3 HOB that contains the debug mask.
4
5 Copyright (c) 2011, Apple, Inc. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8**/
9
10#include <PiPei.h>
11
12#include <Library/HobLib.h>
13#include <Library/DebugLib.h>
14#include <Library/PeiServicesLib.h>
15
16#include <Ppi/ReadOnlyVariable2.h>
17#include <Guid/DebugMask.h>
18
19/**
20 The constructor reads variable and sets HOB
21
22 @param FileHandle The handle of FFS header the loaded driver.
23 @param PeiServices The pointer to the PEI services.
24
25 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
26
27**/
28EFI_STATUS
29EFIAPI
30PeiDebugPrintHobLibConstructor (
31 IN EFI_PEI_FILE_HANDLE FileHandle,
32 IN CONST EFI_PEI_SERVICES **PeiServices
33 )
34{
35 EFI_STATUS Status;
36 EFI_PEI_READ_ONLY_VARIABLE2_PPI *Variable;
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;
62 BuildGuidDataHob (
63 &gEfiGenericVariableGuid,
64 &HobErrorLevel,
65 sizeof (HobErrorLevel)
66 );
67 }
68 }
69
70 return EFI_SUCCESS;
71}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette