Merge tag 'trace-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[linux/fpc-iii.git] / drivers / acpi / acpica / utxferror.c
bloba1ed7fced4db91b7161aee136965996437372f9b
1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
2 /*******************************************************************************
4 * Module Name: utxferror - Various error/warning output functions
6 ******************************************************************************/
8 #define EXPORT_ACPI_INTERFACES
10 #include <acpi/acpi.h>
11 #include "accommon.h"
13 #define _COMPONENT ACPI_UTILITIES
14 ACPI_MODULE_NAME("utxferror")
17 * This module is used for the in-kernel ACPICA as well as the ACPICA
18 * tools/applications.
20 #ifndef ACPI_NO_ERROR_MESSAGES /* Entire module */
21 /*******************************************************************************
23 * FUNCTION: acpi_error
25 * PARAMETERS: module_name - Caller's module name (for error output)
26 * line_number - Caller's line number (for error output)
27 * format - Printf format string + additional args
29 * RETURN: None
31 * DESCRIPTION: Print "ACPI Error" message with module/line/version info
33 ******************************************************************************/
34 void ACPI_INTERNAL_VAR_XFACE
35 acpi_error(const char *module_name, u32 line_number, const char *format, ...)
37 va_list arg_list;
39 ACPI_MSG_REDIRECT_BEGIN;
40 acpi_os_printf(ACPI_MSG_ERROR);
42 va_start(arg_list, format);
43 acpi_os_vprintf(format, arg_list);
44 ACPI_MSG_SUFFIX;
45 va_end(arg_list);
47 ACPI_MSG_REDIRECT_END;
50 ACPI_EXPORT_SYMBOL(acpi_error)
52 /*******************************************************************************
54 * FUNCTION: acpi_exception
56 * PARAMETERS: module_name - Caller's module name (for error output)
57 * line_number - Caller's line number (for error output)
58 * status - Status value to be decoded/formatted
59 * format - Printf format string + additional args
61 * RETURN: None
63 * DESCRIPTION: Print an "ACPI Error" message with module/line/version
64 * info as well as decoded acpi_status.
66 ******************************************************************************/
67 void ACPI_INTERNAL_VAR_XFACE
68 acpi_exception(const char *module_name,
69 u32 line_number, acpi_status status, const char *format, ...)
71 va_list arg_list;
73 ACPI_MSG_REDIRECT_BEGIN;
75 /* For AE_OK, just print the message */
77 if (ACPI_SUCCESS(status)) {
78 acpi_os_printf(ACPI_MSG_ERROR);
80 } else {
81 acpi_os_printf(ACPI_MSG_ERROR "%s, ",
82 acpi_format_exception(status));
85 va_start(arg_list, format);
86 acpi_os_vprintf(format, arg_list);
87 ACPI_MSG_SUFFIX;
88 va_end(arg_list);
90 ACPI_MSG_REDIRECT_END;
93 ACPI_EXPORT_SYMBOL(acpi_exception)
95 /*******************************************************************************
97 * FUNCTION: acpi_warning
99 * PARAMETERS: module_name - Caller's module name (for warning output)
100 * line_number - Caller's line number (for warning output)
101 * format - Printf format string + additional args
103 * RETURN: None
105 * DESCRIPTION: Print "ACPI Warning" message with module/line/version info
107 ******************************************************************************/
108 void ACPI_INTERNAL_VAR_XFACE
109 acpi_warning(const char *module_name, u32 line_number, const char *format, ...)
111 va_list arg_list;
113 ACPI_MSG_REDIRECT_BEGIN;
114 acpi_os_printf(ACPI_MSG_WARNING);
116 va_start(arg_list, format);
117 acpi_os_vprintf(format, arg_list);
118 ACPI_MSG_SUFFIX;
119 va_end(arg_list);
121 ACPI_MSG_REDIRECT_END;
124 ACPI_EXPORT_SYMBOL(acpi_warning)
126 /*******************************************************************************
128 * FUNCTION: acpi_info
130 * PARAMETERS: format - Printf format string + additional args
132 * RETURN: None
134 * DESCRIPTION: Print generic "ACPI:" information message. There is no
135 * module/line/version info in order to keep the message simple.
137 ******************************************************************************/
138 void ACPI_INTERNAL_VAR_XFACE acpi_info(const char *format, ...)
140 va_list arg_list;
142 ACPI_MSG_REDIRECT_BEGIN;
143 acpi_os_printf(ACPI_MSG_INFO);
145 va_start(arg_list, format);
146 acpi_os_vprintf(format, arg_list);
147 acpi_os_printf("\n");
148 va_end(arg_list);
150 ACPI_MSG_REDIRECT_END;
153 ACPI_EXPORT_SYMBOL(acpi_info)
155 /*******************************************************************************
157 * FUNCTION: acpi_bios_error
159 * PARAMETERS: module_name - Caller's module name (for error output)
160 * line_number - Caller's line number (for error output)
161 * format - Printf format string + additional args
163 * RETURN: None
165 * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version
166 * info
168 ******************************************************************************/
169 void ACPI_INTERNAL_VAR_XFACE
170 acpi_bios_error(const char *module_name,
171 u32 line_number, const char *format, ...)
173 va_list arg_list;
175 ACPI_MSG_REDIRECT_BEGIN;
176 acpi_os_printf(ACPI_MSG_BIOS_ERROR);
178 va_start(arg_list, format);
179 acpi_os_vprintf(format, arg_list);
180 ACPI_MSG_SUFFIX;
181 va_end(arg_list);
183 ACPI_MSG_REDIRECT_END;
186 ACPI_EXPORT_SYMBOL(acpi_bios_error)
188 /*******************************************************************************
190 * FUNCTION: acpi_bios_exception
192 * PARAMETERS: module_name - Caller's module name (for error output)
193 * line_number - Caller's line number (for error output)
194 * status - Status value to be decoded/formatted
195 * format - Printf format string + additional args
197 * RETURN: None
199 * DESCRIPTION: Print an "ACPI Firmware Error" message with module/line/version
200 * info as well as decoded acpi_status.
202 ******************************************************************************/
203 void ACPI_INTERNAL_VAR_XFACE
204 acpi_bios_exception(const char *module_name,
205 u32 line_number,
206 acpi_status status, const char *format, ...)
208 va_list arg_list;
210 ACPI_MSG_REDIRECT_BEGIN;
212 /* For AE_OK, just print the message */
214 if (ACPI_SUCCESS(status)) {
215 acpi_os_printf(ACPI_MSG_BIOS_ERROR);
217 } else {
218 acpi_os_printf(ACPI_MSG_BIOS_ERROR "%s, ",
219 acpi_format_exception(status));
222 va_start(arg_list, format);
223 acpi_os_vprintf(format, arg_list);
224 ACPI_MSG_SUFFIX;
225 va_end(arg_list);
227 ACPI_MSG_REDIRECT_END;
230 ACPI_EXPORT_SYMBOL(acpi_bios_exception)
232 /*******************************************************************************
234 * FUNCTION: acpi_bios_warning
236 * PARAMETERS: module_name - Caller's module name (for warning output)
237 * line_number - Caller's line number (for warning output)
238 * format - Printf format string + additional args
240 * RETURN: None
242 * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version
243 * info
245 ******************************************************************************/
246 void ACPI_INTERNAL_VAR_XFACE
247 acpi_bios_warning(const char *module_name,
248 u32 line_number, const char *format, ...)
250 va_list arg_list;
252 ACPI_MSG_REDIRECT_BEGIN;
253 acpi_os_printf(ACPI_MSG_BIOS_WARNING);
255 va_start(arg_list, format);
256 acpi_os_vprintf(format, arg_list);
257 ACPI_MSG_SUFFIX;
258 va_end(arg_list);
260 ACPI_MSG_REDIRECT_END;
263 ACPI_EXPORT_SYMBOL(acpi_bios_warning)
264 #endif /* ACPI_NO_ERROR_MESSAGES */