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