]>
Commit | Line | Data |
---|---|---|
30fdf114 | 1 | /** @file\r |
97fa0ee9 | 2 | Defines and prototypes for common EFI utility error and debug messages.\r |
30fdf114 | 3 | \r |
97fa0ee9 | 4 | Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r |
40d841f6 | 5 | This program and the accompanying materials \r |
30fdf114 LG |
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 | |
30fdf114 LG |
13 | **/\r |
14 | \r | |
15 | #ifndef _EFI_UTILITY_MSGS_H_\r | |
16 | #define _EFI_UTILITY_MSGS_H_\r | |
17 | \r | |
18 | #include <Common/UefiBaseTypes.h>\r | |
19 | \r | |
20 | //\r | |
21 | // Log message print Level\r | |
22 | //\r | |
23 | #define VERBOSE_LOG_LEVEL 15\r | |
24 | #define WARNING_LOG_LEVEL 15\r | |
25 | #define INFO_LOG_LEVEL 20\r | |
26 | #define KEY_LOG_LEVEL 40\r | |
27 | #define ERROR_LOG_LEVLE 50\r | |
28 | \r | |
29 | //\r | |
30 | // Status codes returned by EFI utility programs and functions\r | |
31 | //\r | |
32 | #define STATUS_SUCCESS 0\r | |
33 | #define STATUS_WARNING 1\r | |
34 | #define STATUS_ERROR 2\r | |
35 | #define VOID void \r | |
36 | \r | |
37 | typedef int STATUS;\r | |
38 | \r | |
39 | #define MAX_LINE_LEN 0x200\r | |
40 | #define MAXIMUM_INPUT_FILE_NUM 10\r | |
41 | \r | |
42 | #ifdef __cplusplus\r | |
43 | extern "C" {\r | |
44 | #endif\r | |
45 | //\r | |
46 | // When we call Error() or Warning(), the module keeps track of the worst\r | |
47 | // case reported. GetUtilityStatus() will get the worst-case results, which\r | |
48 | // can be used as the return value from the app.\r | |
49 | //\r | |
50 | STATUS\r | |
51 | GetUtilityStatus (\r | |
52 | VOID\r | |
53 | );\r | |
54 | \r | |
55 | //\r | |
56 | // If someone prints an error message and didn't specify a source file name,\r | |
57 | // then we print the utility name instead. However they must tell us the\r | |
58 | // utility name early on via this function.\r | |
59 | //\r | |
60 | VOID\r | |
61 | SetUtilityName (\r | |
62 | CHAR8 *ProgramName\r | |
63 | )\r | |
64 | ;\r | |
65 | \r | |
52302d4d LG |
66 | VOID\r |
67 | PrintMessage (\r | |
68 | CHAR8 *Type,\r | |
69 | CHAR8 *FileName,\r | |
70 | UINT32 LineNumber,\r | |
71 | UINT32 MessageCode,\r | |
72 | CHAR8 *Text,\r | |
73 | CHAR8 *MsgFmt,\r | |
74 | va_list List\r | |
75 | );\r | |
76 | \r | |
30fdf114 LG |
77 | VOID\r |
78 | Error (\r | |
79 | CHAR8 *FileName,\r | |
80 | UINT32 LineNumber,\r | |
81 | UINT32 ErrorCode,\r | |
82 | CHAR8 *OffendingText,\r | |
83 | CHAR8 *MsgFmt,\r | |
84 | ...\r | |
85 | )\r | |
86 | ;\r | |
87 | \r | |
88 | VOID\r | |
89 | Warning (\r | |
90 | CHAR8 *FileName,\r | |
91 | UINT32 LineNumber,\r | |
92 | UINT32 WarningCode,\r | |
93 | CHAR8 *OffendingText,\r | |
94 | CHAR8 *MsgFmt,\r | |
95 | ...\r | |
96 | )\r | |
97 | ;\r | |
98 | \r | |
99 | VOID\r | |
100 | DebugMsg (\r | |
101 | CHAR8 *FileName,\r | |
102 | UINT32 LineNumber,\r | |
fd171542 | 103 | UINT64 MsgLevel,\r |
30fdf114 LG |
104 | CHAR8 *OffendingText,\r |
105 | CHAR8 *MsgFmt,\r | |
106 | ...\r | |
107 | )\r | |
108 | ;\r | |
109 | \r | |
110 | VOID\r | |
111 | VerboseMsg (\r | |
112 | CHAR8 *MsgFmt,\r | |
113 | ...\r | |
114 | );\r | |
115 | \r | |
116 | VOID\r | |
117 | NormalMsg (\r | |
118 | CHAR8 *MsgFmt,\r | |
119 | ...\r | |
120 | );\r | |
121 | \r | |
122 | VOID\r | |
123 | KeyMsg (\r | |
124 | CHAR8 *MsgFmt,\r | |
125 | ...\r | |
126 | );\r | |
127 | \r | |
128 | VOID\r | |
129 | SetPrintLevel (\r | |
fd171542 | 130 | UINT64 LogLevel\r |
30fdf114 LG |
131 | );\r |
132 | \r | |
133 | VOID\r | |
134 | ParserSetPosition (\r | |
135 | CHAR8 *SourceFileName,\r | |
136 | UINT32 LineNum\r | |
137 | )\r | |
138 | ;\r | |
139 | \r | |
140 | VOID\r | |
141 | ParserError (\r | |
142 | UINT32 ErrorCode,\r | |
143 | CHAR8 *OffendingText,\r | |
144 | CHAR8 *MsgFmt,\r | |
145 | ...\r | |
146 | )\r | |
147 | ;\r | |
148 | \r | |
149 | VOID\r | |
150 | ParserWarning (\r | |
151 | UINT32 ErrorCode,\r | |
152 | CHAR8 *OffendingText,\r | |
153 | CHAR8 *MsgFmt,\r | |
154 | ...\r | |
155 | )\r | |
156 | ;\r | |
157 | \r | |
158 | VOID\r | |
159 | SetPrintLimits (\r | |
160 | UINT32 NumErrors,\r | |
161 | UINT32 NumWarnings,\r | |
162 | UINT32 NumWarningsPlusErrors\r | |
163 | )\r | |
164 | ;\r | |
165 | \r | |
166 | #ifdef __cplusplus\r | |
167 | }\r | |
168 | #endif\r | |
169 | \r | |
170 | #endif // #ifndef _EFI_UTILITY_MSGS_H_\r |