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 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Library/PostCodeLib.h>
18 #include <Library/PcdLib.h>
19 #include <Library/IoLib.h>
20 #include <Library/DebugLib.h>
23 Sends an 32-bit value to a POST card.
25 Sends the 32-bit value specified by Value to a POST card, and returns Value.
26 Some implementations of this library function may perform I/O operations
27 directly to a POST card device. Other implementations may send Value to
28 ReportStatusCode(), and the status code reporting mechanism will eventually
29 display the 32-bit value on the status reporting device.
31 PostCode() must actively prevent recursion. If PostCode() is called while
32 processing another any other Post Code Library function, then
33 PostCode() must return Value immediately.
35 @param Value The 32-bit value to write to the POST card.
37 @return The 32-bit value to write to the POST card.
46 switch (PcdGet8 (PcdPort80DataWidth
)) {
48 IoWrite8 (0x80, (UINT8
)(Value
));
51 IoWrite16 (0x80, (UINT16
)(Value
));
54 IoWrite32 (0x80, Value
);
58 // Assert on the invalid data width
69 Sends an 32-bit value to a POST and associated ASCII string.
71 Sends the 32-bit value specified by Value to a POST card, and returns Value.
72 If Description is not NULL, then the ASCII string specified by Description is
73 also passed to the handler that displays the POST card value. Some
74 implementations of this library function may perform I/O operations directly
75 to a POST card device. Other implementations may send Value to ReportStatusCode(),
76 and the status code reporting mechanism will eventually display the 32-bit
77 value on the status reporting device.
79 PostCodeWithDescription()must actively prevent recursion. If
80 PostCodeWithDescription() is called while processing another any other Post
81 Code Library function, then PostCodeWithDescription() must return Value
84 @param Value The 32-bit value to write to the POST card.
85 @param Description The pointer to an ASCII string that is a description of the
86 POST code value. This is an optional parameter that may
89 @return The 32-bit value to write to the POST card.
94 PostCodeWithDescription (
96 IN CONST CHAR8
*Description OPTIONAL
105 Returns TRUE if POST Codes are enabled.
107 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
108 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
110 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
111 PcdPostCodeProperyMask is set.
112 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
113 PcdPostCodeProperyMask is clear.
122 return (BOOLEAN
) ((PcdGet8(PcdPostCodePropertyMask
) & POST_CODE_PROPERTY_POST_CODE_ENABLED
) != 0);
127 Returns TRUE if POST code descriptions are enabled.
129 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED
130 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
132 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
133 PcdPostCodeProperyMask is set.
134 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of
135 PcdPostCodeProperyMask is clear.
140 PostCodeDescriptionEnabled (
144 return (BOOLEAN
) ((PcdGet8(PcdPostCodePropertyMask
) & POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED
) != 0);