VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BasePostCodeLibDebug/PostCode.c@ 80721

最後變更 在這個檔案從80721是 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
檔案大小: 3.6 KB
 
1/** @file
2 The instance of Post Code Library that layers on top of a Debug Library instance.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#include <Base.h>
10
11#include <Library/PostCodeLib.h>
12#include <Library/DebugLib.h>
13#include <Library/PcdLib.h>
14
15/**
16 Sends an 32-bit value to a POST card.
17
18 Sends the 32-bit value specified by Value to a POST card, and returns Value.
19 Some implementations of this library function may perform I/O operations
20 directly to a POST card device. Other implementations may send Value to
21 ReportStatusCode(), and the status code reporting mechanism will eventually
22 display the 32-bit value on the status reporting device.
23
24 PostCode() must actively prevent recursion. If PostCode() is called while
25 processing another any other Post Code Library function, then
26 PostCode() must return Value immediately.
27
28 @param Value The 32-bit value to write to the POST card.
29
30 @return The 32-bit value to write to the POST card.
31
32**/
33UINT32
34EFIAPI
35PostCode (
36 IN UINT32 Value
37 )
38{
39 DEBUG((EFI_D_INFO, "POST %08x\n", Value));
40 return Value;
41}
42
43
44/**
45 Sends an 32-bit value to a POST and associated ASCII string.
46
47 Sends the 32-bit value specified by Value to a POST card, and returns Value.
48 If Description is not NULL, then the ASCII string specified by Description is
49 also passed to the handler that displays the POST card value. Some
50 implementations of this library function may perform I/O operations directly
51 to a POST card device. Other implementations may send Value to ReportStatusCode(),
52 and the status code reporting mechanism will eventually display the 32-bit
53 value on the status reporting device.
54
55 PostCodeWithDescription()must actively prevent recursion. If
56 PostCodeWithDescription() is called while processing another any other Post
57 Code Library function, then PostCodeWithDescription() must return Value
58 immediately.
59
60 @param Value The 32-bit value to write to the POST card.
61 @param Description The pointer to an ASCII string that is a description of the
62 POST code value. This is an optional parameter that may
63 be NULL.
64
65 @return The 32-bit value to write to the POST card.
66
67**/
68UINT32
69EFIAPI
70PostCodeWithDescription (
71 IN UINT32 Value,
72 IN CONST CHAR8 *Description OPTIONAL
73 )
74{
75 DEBUG((EFI_D_INFO, "POST %08x - %s\n", Value, Description));
76 return Value;
77}
78
79
80/**
81 Returns TRUE if POST Codes are enabled.
82
83 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
84 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
85
86 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
87 PcdPostCodeProperyMask is set.
88 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
89 PcdPostCodeProperyMask is clear.
90
91**/
92BOOLEAN
93EFIAPI
94PostCodeEnabled (
95 VOID
96 )
97{
98 return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
99}
100
101
102/**
103 Returns TRUE if POST code descriptions are enabled.
104
105 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED
106 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
107
108 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
109 PcdPostCodeProperyMask is set.
110 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
111 PcdPostCodeProperyMask is clear.
112
113**/
114BOOLEAN
115EFIAPI
116PostCodeDescriptionEnabled (
117 VOID
118 )
119{
120 return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED) != 0);
121}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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