ReactOS 0.4.16-dev-311-g9382aa2
utxferror.c
Go to the documentation of this file.
1/*******************************************************************************
2 *
3 * Module Name: utxferror - Various error/warning output functions
4 *
5 ******************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2022, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#define EXPORT_ACPI_INTERFACES
45
46#include "acpi.h"
47#include "accommon.h"
48
49
50#define _COMPONENT ACPI_UTILITIES
51 ACPI_MODULE_NAME ("utxferror")
52
53/*
54 * This module is used for the in-kernel ACPICA as well as the ACPICA
55 * tools/applications.
56 */
57
58#ifndef ACPI_NO_ERROR_MESSAGES /* Entire module */
59
60/*******************************************************************************
61 *
62 * FUNCTION: AcpiError
63 *
64 * PARAMETERS: ModuleName - Caller's module name (for error output)
65 * LineNumber - Caller's line number (for error output)
66 * Format - Printf format string + additional args
67 *
68 * RETURN: None
69 *
70 * DESCRIPTION: Print "ACPI Error" message with module/line/version info
71 *
72 ******************************************************************************/
73
76 const char *ModuleName,
78 const char *Format,
79 ...)
80{
81 va_list ArgList;
82
83
86
87 va_start (ArgList, Format);
88 AcpiOsVprintf (Format, ArgList);
90 va_end (ArgList);
91
93}
94
96
97
98/*******************************************************************************
99 *
100 * FUNCTION: AcpiException
101 *
102 * PARAMETERS: ModuleName - Caller's module name (for error output)
103 * LineNumber - Caller's line number (for error output)
104 * Status - Status value to be decoded/formatted
105 * Format - Printf format string + additional args
106 *
107 * RETURN: None
108 *
109 * DESCRIPTION: Print an "ACPI Error" message with module/line/version
110 * info as well as decoded ACPI_STATUS.
111 *
112 ******************************************************************************/
113
116 const char *ModuleName,
119 const char *Format,
120 ...)
121{
122 va_list ArgList;
123
124
126
127 /* For AE_OK, just print the message */
128
129 if (ACPI_SUCCESS (Status))
130 {
132
133 }
134 else
135 {
138 }
139
140 va_start (ArgList, Format);
141 AcpiOsVprintf (Format, ArgList);
143 va_end (ArgList);
144
146}
147
149
150
151/*******************************************************************************
152 *
153 * FUNCTION: AcpiWarning
154 *
155 * PARAMETERS: ModuleName - Caller's module name (for warning output)
156 * LineNumber - Caller's line number (for warning output)
157 * Format - Printf format string + additional args
158 *
159 * RETURN: None
160 *
161 * DESCRIPTION: Print "ACPI Warning" message with module/line/version info
162 *
163 ******************************************************************************/
164
167 const char *ModuleName,
169 const char *Format,
170 ...)
171{
172 va_list ArgList;
173
174
177
178 va_start (ArgList, Format);
179 AcpiOsVprintf (Format, ArgList);
181 va_end (ArgList);
182
184}
185
187
188
189/*******************************************************************************
190 *
191 * FUNCTION: AcpiInfo
192 *
193 * PARAMETERS: Format - Printf format string + additional args
194 *
195 * RETURN: None
196 *
197 * DESCRIPTION: Print generic "ACPI:" information message. There is no
198 * module/line/version info in order to keep the message simple.
199 *
200 ******************************************************************************/
201
204 const char *Format,
205 ...)
206{
207 va_list ArgList;
208
209
212
213 va_start (ArgList, Format);
214 AcpiOsVprintf (Format, ArgList);
215 AcpiOsPrintf ("\n");
216 va_end (ArgList);
217
219}
220
222
223
224/*******************************************************************************
225 *
226 * FUNCTION: AcpiBiosError
227 *
228 * PARAMETERS: ModuleName - Caller's module name (for error output)
229 * LineNumber - Caller's line number (for error output)
230 * Format - Printf format string + additional args
231 *
232 * RETURN: None
233 *
234 * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version
235 * info
236 *
237 ******************************************************************************/
238
241 const char *ModuleName,
243 const char *Format,
244 ...)
245{
246 va_list ArgList;
247
248
251
252 va_start (ArgList, Format);
253 AcpiOsVprintf (Format, ArgList);
255 va_end (ArgList);
256
258}
259
261
262
263/*******************************************************************************
264 *
265 * FUNCTION: AcpiBiosException
266 *
267 * PARAMETERS: ModuleName - Caller's module name (for error output)
268 * LineNumber - Caller's line number (for error output)
269 * Status - Status value to be decoded/formatted
270 * Format - Printf format string + additional args
271 *
272 * RETURN: None
273 *
274 * DESCRIPTION: Print an "ACPI Firmware Error" message with module/line/version
275 * info as well as decoded ACPI_STATUS.
276 *
277 ******************************************************************************/
278
281 const char *ModuleName,
284 const char *Format,
285 ...)
286{
287 va_list ArgList;
288
289
291
292 /* For AE_OK, just print the message */
293
294 if (ACPI_SUCCESS (Status))
295 {
297
298 }
299 else
300 {
303 }
304
305 va_start (ArgList, Format);
306 AcpiOsVprintf (Format, ArgList);
308 va_end (ArgList);
309
311}
312
314
315
316/*******************************************************************************
317 *
318 * FUNCTION: AcpiBiosWarning
319 *
320 * PARAMETERS: ModuleName - Caller's module name (for warning output)
321 * LineNumber - Caller's line number (for warning output)
322 * Format - Printf format string + additional args
323 *
324 * RETURN: None
325 *
326 * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version
327 * info
328 *
329 ******************************************************************************/
330
333 const char *ModuleName,
335 const char *Format,
336 ...)
337{
338 va_list ArgList;
339
340
343
344 va_start (ArgList, Format);
345 AcpiOsVprintf (Format, ArgList);
347 va_end (ArgList);
348
350}
351
353
354#endif /* ACPI_NO_ERROR_MESSAGES */
unsigned int UINT32
#define ACPI_INTERNAL_VAR_XFACE
Definition: acenv.h:338
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define ACPI_MODULE_NAME(Name)
Definition: acoutput.h:216
void AcpiOsVprintf(const char *Format, va_list Args)
Definition: osl.c:865
void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf(const char *Format,...)
Definition: osl.c:851
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1220
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1280
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_EXPORT_SYMBOL(Symbol)
Definition: actypes.h:343
#define ACPI_MSG_BIOS_ERROR
Definition: acutils.h:131
#define ACPI_MSG_ERROR
Definition: acutils.h:121
#define ACPI_MSG_BIOS_WARNING
Definition: acutils.h:134
#define ACPI_MSG_REDIRECT_BEGIN
Definition: acutils.h:113
#define ACPI_MSG_SUFFIX
Definition: acutils.h:140
#define ACPI_MSG_WARNING
Definition: acutils.h:124
#define ACPI_MSG_INFO
Definition: acutils.h:127
#define ACPI_MSG_REDIRECT_END
Definition: acutils.h:114
Status
Definition: gdiplustypes.h:25
const char * AcpiFormatException(ACPI_STATUS Status)
Definition: utexcep.c:70
void ACPI_INTERNAL_VAR_XFACE AcpiError(const char *ModuleName, UINT32 LineNumber, const char *Format,...)
Definition: utxferror.c:75
void ACPI_INTERNAL_VAR_XFACE AcpiWarning(const char *ModuleName, UINT32 LineNumber, const char *Format,...)
Definition: utxferror.c:166
void ACPI_INTERNAL_VAR_XFACE AcpiBiosError(const char *ModuleName, UINT32 LineNumber, const char *Format,...)
Definition: utxferror.c:240
void ACPI_INTERNAL_VAR_XFACE AcpiInfo(const char *Format,...)
Definition: utxferror.c:203
void ACPI_INTERNAL_VAR_XFACE AcpiBiosWarning(const char *ModuleName, UINT32 LineNumber, const char *Format,...)
Definition: utxferror.c:332
void ACPI_INTERNAL_VAR_XFACE AcpiException(const char *ModuleName, UINT32 LineNumber, ACPI_STATUS Status, const char *Format,...)
Definition: utxferror.c:115
void ACPI_INTERNAL_VAR_XFACE AcpiBiosException(const char *ModuleName, UINT32 LineNumber, ACPI_STATUS Status, const char *Format,...)
Definition: utxferror.c:280