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