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