]>
Commit | Line | Data |
---|---|---|
fb3df220 | 1 | /** @file\r |
50a64e5b | 2 | Provides services to send progress/error codes to a POST card.\r |
fb3df220 | 3 | \r |
9095d37b | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
fb3df220 | 6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef __POST_CODE_LIB_H__\r | |
10 | #define __POST_CODE_LIB_H__\r | |
11 | \r | |
12 | #define POST_CODE_PROPERTY_POST_CODE_ENABLED 0x00000008\r | |
13 | #define POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED 0x00000010\r | |
14 | \r | |
15 | /**\r | |
1a2f870c | 16 | Sends a 32-bit value to a POST card.\r |
fb3df220 | 17 | \r |
9095d37b LG |
18 | Sends the 32-bit value specified by Value to a POST card, and returns Value.\r |
19 | Some implementations of this library function may perform I/O operations\r | |
20 | directly to a POST card device. Other implementations may send Value to\r | |
21 | ReportStatusCode(), and the status code reporting mechanism will eventually\r | |
fb3df220 | 22 | display the 32-bit value on the status reporting device.\r |
9095d37b LG |
23 | \r |
24 | PostCode() must actively prevent recursion. If PostCode() is called while\r | |
25 | processing another Post Code Library function, then\r | |
fb3df220 | 26 | PostCode() must return Value immediately.\r |
27 | \r | |
28 | @param Value The 32-bit value to write to the POST card.\r | |
29 | \r | |
122e2191 | 30 | @return The 32-bit value to write to the POST card.\r |
fb3df220 | 31 | \r |
32 | **/\r | |
33 | UINT32\r | |
34 | EFIAPI\r | |
35 | PostCode (\r | |
36 | IN UINT32 Value\r | |
37 | );\r | |
38 | \r | |
39 | \r | |
40 | /**\r | |
1a2f870c | 41 | Sends a 32-bit value to a POST and associated ASCII string.\r |
fb3df220 | 42 | \r |
43 | Sends the 32-bit value specified by Value to a POST card, and returns Value.\r | |
9095d37b LG |
44 | If Description is not NULL, then the ASCII string specified by Description is\r |
45 | also passed to the handler that displays the POST card value. Some\r | |
46 | implementations of this library function may perform I/O operations directly\r | |
47 | to a POST card device. Other implementations may send Value to ReportStatusCode(),\r | |
48 | and the status code reporting mechanism will eventually display the 32-bit\r | |
49 | value on the status reporting device.\r | |
50 | \r | |
51 | PostCodeWithDescription()must actively prevent recursion. If\r | |
52 | PostCodeWithDescription() is called while processing another any other Post\r | |
53 | Code Library function, then PostCodeWithDescription() must return Value\r | |
122e2191 | 54 | immediately.\r |
fb3df220 | 55 | \r |
56 | @param Value The 32-bit value to write to the POST card.\r | |
9095d37b LG |
57 | @param Description Pointer to an ASCII string that is a description of the\r |
58 | POST code value. This is an optional parameter that may\r | |
fb3df220 | 59 | be NULL.\r |
60 | \r | |
122e2191 | 61 | @return The 32-bit value to write to the POST card.\r |
fb3df220 | 62 | \r |
63 | **/\r | |
64 | UINT32\r | |
65 | EFIAPI\r | |
66 | PostCodeWithDescription (\r | |
67 | IN UINT32 Value,\r | |
68 | IN CONST CHAR8 *Description OPTIONAL\r | |
69 | );\r | |
70 | \r | |
71 | \r | |
72 | /**\r | |
73 | Returns TRUE if POST Codes are enabled.\r | |
74 | \r | |
9095d37b | 75 | This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED\r |
fb3df220 | 76 | bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.\r |
77 | \r | |
9095d37b | 78 | @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of\r |
fb3df220 | 79 | PcdPostCodeProperyMask is set.\r |
9095d37b | 80 | @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of\r |
fb3df220 | 81 | PcdPostCodeProperyMask is clear.\r |
82 | \r | |
83 | **/\r | |
84 | BOOLEAN\r | |
85 | EFIAPI\r | |
86 | PostCodeEnabled (\r | |
87 | VOID\r | |
88 | );\r | |
89 | \r | |
90 | \r | |
91 | /**\r | |
92 | Returns TRUE if POST code descriptions are enabled.\r | |
93 | \r | |
eceb3a4c LG |
94 | This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED\r |
95 | bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.\r | |
fb3df220 | 96 | \r |
eceb3a4c LG |
97 | @retval TRUE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of\r |
98 | PcdPostCodeProperyMask is set.\r | |
99 | @retval FALSE The POST_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED bit of\r | |
100 | PcdPostCodeProperyMask is clear.\r | |
fb3df220 | 101 | \r |
102 | **/\r | |
103 | BOOLEAN\r | |
104 | EFIAPI\r | |
105 | PostCodeDescriptionEnabled (\r | |
106 | VOID\r | |
107 | );\r | |
108 | \r | |
109 | \r | |
110 | /**\r | |
1a2f870c | 111 | Sends a 32-bit value to a POST card.\r |
fb3df220 | 112 | \r |
9095d37b | 113 | If POST codes are enabled in PcdPostCodeProperyMask, then call PostCode()\r |
fb3df220 | 114 | passing in Value. Value is returned.\r |
115 | \r | |
116 | @param Value The 32-bit value to write to the POST card.\r | |
117 | \r | |
eceb3a4c | 118 | @return Value The 32-bit value to write to the POST card.\r |
fb3df220 | 119 | \r |
120 | **/\r | |
121 | #define POST_CODE(Value) PostCodeEnabled() ? PostCode(Value) : Value\r | |
122 | \r | |
123 | /**\r | |
1a2f870c | 124 | Sends a 32-bit value to a POST and associated ASCII string.\r |
fb3df220 | 125 | \r |
9095d37b LG |
126 | If POST codes and POST code descriptions are enabled in\r |
127 | PcdPostCodeProperyMask, then call PostCodeWithDescription() passing in\r | |
128 | Value and Description. If only POST codes are enabled, then call PostCode()\r | |
fb3df220 | 129 | passing in Value. Value is returned.\r |
130 | \r | |
131 | @param Value The 32-bit value to write to the POST card.\r | |
9095d37b | 132 | @param Description Pointer to an ASCII string that is a description of the\r |
fb3df220 | 133 | POST code value.\r |
134 | \r | |
eceb3a4c | 135 | @return Value The 32-bit value to write to the POST card.\r |
fb3df220 | 136 | **/\r |
137 | #define POST_CODE_WITH_DESCRIPTION(Value,Description) \\r | |
138 | PostCodeEnabled() ? \\r | |
139 | (PostCodeDescriptionEnabled() ? \\r | |
140 | PostCodeWithDescription(Value,Description) : \\r | |
141 | PostCode(Value)) : \\r | |
142 | Value\r | |
143 | \r | |
144 | #endif\r |