]>
Commit | Line | Data |
---|---|---|
e1f414b6 | 1 | /** @file\r |
2 | Report Status Code Library Post Code functions for DXE Phase.\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation<BR>\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 | |
9 | \r | |
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 | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | \r | |
16 | //\r | |
c7d265a9 | 17 | // The package level header files this module uses\r |
e1f414b6 | 18 | //\r |
c7d265a9 | 19 | #include <Base.h>\r |
20 | //\r | |
21 | // The protocols, PPI and GUID defintions for this module\r | |
22 | //\r | |
23 | //\r | |
24 | // The Library classes this module consumes\r | |
25 | //\r | |
26 | #include <Library/PostCodeLib.h>\r | |
27 | #include <Library/PcdLib.h>\r | |
28 | #include <Library/IoLib.h>\r | |
e1f414b6 | 29 | \r |
30 | /**\r | |
31 | Sends an 32-bit value to a POST card.\r | |
32 | \r | |
33 | Sends the 32-bit value specified by Value to a POST card, and returns Value. \r | |
34 | Some implementations of this library function may perform I/O operations \r | |
35 | directly to a POST card device. Other implementations may send Value to \r | |
36 | ReportStatusCode(), and the status code reporting mechanism will eventually \r | |
37 | display the 32-bit value on the status reporting device.\r | |
38 | \r | |
39 | PostCode() must actively prevent recursion. If PostCode() is called while \r | |
40 | processing another any other Report Status Code Library function, then \r | |
41 | PostCode() must return Value immediately.\r | |
42 | \r | |
43 | @param Value The 32-bit value to write to the POST card.\r | |
44 | \r | |
45 | @return Value\r | |
46 | \r | |
47 | **/\r | |
48 | UINT32\r | |
49 | EFIAPI\r | |
50 | PostCode (\r | |
51 | IN UINT32 Value\r | |
52 | )\r | |
53 | {\r | |
54 | IoWrite8 (0x80, (UINT8)(Value));\r | |
55 | return Value;\r | |
56 | }\r | |
57 | \r | |
58 | \r | |
59 | /**\r | |
60 | Sends an 32-bit value to a POST and associated ASCII string.\r | |
61 | \r | |
62 | Sends the 32-bit value specified by Value to a POST card, and returns Value.\r | |
63 | If Description is not NULL, then the ASCII string specified by Description is \r | |
64 | also passed to the handler that displays the POST card value. Some \r | |
65 | implementations of this library function may perform I/O operations directly \r | |
66 | to a POST card device. Other implementations may send Value to ReportStatusCode(), \r | |
67 | and the status code reporting mechanism will eventually display the 32-bit \r | |
68 | value on the status reporting device. \r | |
69 | \r | |
70 | PostCodeWithDescription()must actively prevent recursion. If \r | |
71 | PostCodeWithDescription() is called while processing another any other Report \r | |
72 | Status Code Library function, then PostCodeWithDescription() must return Value \r | |
73 | immediately.\r | |
74 | \r | |
75 | @param Value The 32-bit value to write to the POST card.\r | |
76 | @param Description Pointer to an ASCII string that is a description of the \r | |
77 | POST code value. This is an optional parameter that may \r | |
78 | be NULL.\r | |
79 | \r | |
80 | @return Value\r | |
81 | \r | |
82 | **/\r | |
83 | UINT32\r | |
84 | EFIAPI\r | |
85 | PostCodeWithDescription (\r | |
86 | IN UINT32 Value,\r | |
87 | IN CONST CHAR8 *Description OPTIONAL\r | |
88 | )\r | |
89 | {\r | |
90 | IoWrite8 (0x80, (UINT8)(Value));\r | |
91 | return Value;\r | |
92 | }\r | |
93 | \r | |
94 | \r | |
95 | /**\r | |
96 | Returns TRUE if POST Codes are enabled.\r | |
97 | \r | |
98 | This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED \r | |
99 | bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.\r | |
100 | \r | |
101 | @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of \r | |
102 | PcdPostCodeProperyMask is set.\r | |
103 | @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of \r | |
104 | PcdPostCodeProperyMask is clear.\r | |
105 | \r | |
106 | **/\r | |
107 | BOOLEAN\r | |
108 | EFIAPI\r | |
109 | PostCodeEnabled (\r | |
110 | VOID\r | |
111 | )\r | |
112 | {\r | |
113 | return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);\r | |
114 | }\r | |
115 | \r | |
116 | \r | |
117 | /**\r | |
118 | Returns TRUE if POST code descriptions are enabled.\r | |
119 | \r | |
120 | This function returns TRUE if the \r | |
121 | POST_CODE_PROPERTY_POST_CODE_ENABLED bit of \r | |
122 | PcdPostCodePropertyMask is set. Otherwise FALSE is returned.\r | |
123 | \r | |
124 | @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED \r | |
125 | bit of PcdPostCodeProperyMask is set.\r | |
126 | @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED \r | |
127 | bit of PcdPostCodeProperyMask is clear.\r | |
128 | \r | |
129 | **/\r | |
130 | BOOLEAN\r | |
131 | EFIAPI\r | |
132 | PostCodeDescriptionEnabled (\r | |
133 | VOID\r | |
134 | )\r | |
135 | {\r | |
136 | return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);\r | |
137 | }\r |