VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdeModulePkg/Library/PeiDebugPrintHobLib/PeiDebugPrintHobLib.c@ 95057

最後變更 在這個檔案從95057是 80721,由 vboxsync 提交於 6 年 前

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), 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/**
21 The constructor reads variable and sets HOB
22
23 @param FileHandle The handle of FFS header the loaded driver.
24 @param PeiServices The pointer to the PEI services.
25
26 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
27
28**/
29EFI_STATUS
30EFIAPI
31PeiDebugPrintHobLibConstructor (
32 IN EFI_PEI_FILE_HANDLE FileHandle,
33 IN CONST EFI_PEI_SERVICES **PeiServices
34 )
35{
36 EFI_STATUS Status;
37 EFI_PEI_READ_ONLY_VARIABLE2_PPI *Variable;
38 UINTN Size;
39 UINT64 GlobalErrorLevel;
40 UINT32 HobErrorLevel;
41
42 Status = PeiServicesLocatePpi (
43 &gEfiPeiReadOnlyVariable2PpiGuid,
44 0,
45 NULL,
46 (VOID **)&Variable
47 );
48 if (!EFI_ERROR (Status)) {
49 Size = sizeof (GlobalErrorLevel);
50 Status = Variable->GetVariable (
51 Variable,
52 DEBUG_MASK_VARIABLE_NAME,
53 &gEfiGenericVariableGuid,
54 NULL,
55 &Size,
56 &GlobalErrorLevel
57 );
58 if (!EFI_ERROR (Status)) {
59 //
60 // Build the GUID'ed HOB for DXE
61 //
62 HobErrorLevel = (UINT32)GlobalErrorLevel;
63 BuildGuidDataHob (
64 &gEfiGenericVariableGuid,
65 &HobErrorLevel,
66 sizeof (HobErrorLevel)
67 );
68 }
69 }
70
71 return EFI_SUCCESS;
72}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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