2 Post Code Library instance that writes post code values to I/O port 0x80.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Library/PostCodeLib.h>
12 #include <Library/PcdLib.h>
13 #include <Library/IoLib.h>
14 #include <Library/DebugLib.h>
17 Sends an 32-bit value to a POST card.
19 Sends the 32-bit value specified by Value to a POST card, and returns Value.
20 Some implementations of this library function may perform I/O operations
21 directly to a POST card device. Other implementations may send Value to
22 ReportStatusCode(), and the status code reporting mechanism will eventually
23 display the 32-bit value on the status reporting device.
25 PostCode() must actively prevent recursion. If PostCode() is called while
26 processing another any other Post Code Library function, then
27 PostCode() must return Value immediately.
29 @param Value The 32-bit value to write to the POST card.
31 @return The 32-bit value to write to the POST card.
40 switch (PcdGet8 (PcdPort80DataWidth
)) {
42 IoWrite8 (0x80, (UINT8
)(Value
));
45 IoWrite16 (0x80, (UINT16
)(Value
));
48 IoWrite32 (0x80, Value
);
52 // Assert on the invalid data width
63 Sends an 32-bit value to a POST and associated ASCII string.
65 Sends the 32-bit value specified by Value to a POST card, and returns Value.
66 If Description is not NULL, then the ASCII string specified by Description is
67 also passed to the handler that displays the POST card value. Some
68 implementations of this library function may perform I/O operations directly
69 to a POST card device. Other implementations may send Value to ReportStatusCode(),
70 and the status code reporting mechanism will eventually display the 32-bit
71 value on the status reporting device.
73 PostCodeWithDescription()must actively prevent recursion. If
74 PostCodeWithDescription() is called while processing another any other Post
75 Code Library function, then PostCodeWithDescription() must return Value
78 @param Value The 32-bit value to write to the POST card.
79 @param Description The pointer to an ASCII string that is a description of the
80 POST code value. This is an optional parameter that may
83 @return The 32-bit value to write to the POST card.
88 PostCodeWithDescription (
90 IN CONST CHAR8
*Description OPTIONAL
99 Returns TRUE if POST Codes are enabled.
101 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
102 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
104 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
105 PcdPostCodeProperyMask is set.
106 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
107 PcdPostCodeProperyMask is clear.
116 return (BOOLEAN
) ((PcdGet8(PcdPostCodePropertyMask
) & POST_CODE_PROPERTY_POST_CODE_ENABLED
) != 0);
121 Returns TRUE if POST code descriptions are enabled.
123 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED
124 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
126 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
127 PcdPostCodeProperyMask is set.
128 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
129 PcdPostCodeProperyMask is clear.
134 PostCodeDescriptionEnabled (
138 return (BOOLEAN
) ((PcdGet8(PcdPostCodePropertyMask
) & POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED
) != 0);