]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/PostCodeLib.h
2 Provides services to send progress/error codes to a POST card.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef __POST_CODE_LIB_H__
10 #define __POST_CODE_LIB_H__
12 #define POST_CODE_PROPERTY_POST_CODE_ENABLED 0x00000008
13 #define POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED 0x00000010
16 Sends a 32-bit value to a POST card.
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.
24 PostCode() must actively prevent recursion. If PostCode() is called while
25 processing another Post Code Library function, then
26 PostCode() must return Value immediately.
28 @param Value The 32-bit value to write to the POST card.
30 @return The 32-bit value to write to the POST card.
41 Sends a 32-bit value to a POST and associated ASCII string.
43 Sends the 32-bit value specified by Value to a POST card, and returns Value.
44 If Description is not NULL, then the ASCII string specified by Description is
45 also passed to the handler that displays the POST card value. Some
46 implementations of this library function may perform I/O operations directly
47 to a POST card device. Other implementations may send Value to ReportStatusCode(),
48 and the status code reporting mechanism will eventually display the 32-bit
49 value on the status reporting device.
51 PostCodeWithDescription()must actively prevent recursion. If
52 PostCodeWithDescription() is called while processing another any other Post
53 Code Library function, then PostCodeWithDescription() must return Value
56 @param Value The 32-bit value to write to the POST card.
57 @param Description Pointer to an ASCII string that is a description of the
58 POST code value. This is an optional parameter that may
61 @return The 32-bit value to write to the POST card.
66 PostCodeWithDescription (
68 IN CONST CHAR8
*Description OPTIONAL
73 Returns TRUE if POST Codes are enabled.
75 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
76 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
78 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
79 PcdPostCodeProperyMask is set.
80 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
81 PcdPostCodeProperyMask is clear.
92 Returns TRUE if POST code descriptions are enabled.
94 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED
95 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
97 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
98 PcdPostCodeProperyMask is set.
99 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
100 PcdPostCodeProperyMask is clear.
105 PostCodeDescriptionEnabled (
111 Sends a 32-bit value to a POST card.
113 If POST codes are enabled in PcdPostCodeProperyMask, then call PostCode()
114 passing in Value. Value is returned.
116 @param Value The 32-bit value to write to the POST card.
118 @return Value The 32-bit value to write to the POST card.
121 #define POST_CODE(Value) PostCodeEnabled() ? PostCode(Value) : Value
124 Sends a 32-bit value to a POST and associated ASCII string.
126 If POST codes and POST code descriptions are enabled in
127 PcdPostCodeProperyMask, then call PostCodeWithDescription() passing in
128 Value and Description. If only POST codes are enabled, then call PostCode()
129 passing in Value. Value is returned.
131 @param Value The 32-bit value to write to the POST card.
132 @param Description Pointer to an ASCII string that is a description of the
135 @return Value The 32-bit value to write to the POST card.
137 #define POST_CODE_WITH_DESCRIPTION(Value,Description) \
138 PostCodeEnabled() ? \
139 (PostCodeDescriptionEnabled() ? \
140 PostCodeWithDescription(Value,Description) : \