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