1 /*******************************************************************************
3 * Module Name: utxferror - Various error/warning output functions
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2013, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
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.
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.
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 MERCHANTIBILITY 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.
44 #include <linux/export.h>
45 #include <acpi/acpi.h>
48 #define _COMPONENT ACPI_UTILITIES
49 ACPI_MODULE_NAME("utxferror")
52 * This module is used for the in-kernel ACPICA as well as the ACPICA
55 /*******************************************************************************
57 * FUNCTION: acpi_error
59 * PARAMETERS: module_name - Caller's module name (for error output)
60 * line_number - Caller's line number (for error output)
61 * format - Printf format string + additional args
65 * DESCRIPTION: Print "ACPI Error" message with module/line/version info
67 ******************************************************************************/
68 void ACPI_INTERNAL_VAR_XFACE
69 acpi_error(const char *module_name, u32 line_number, const char *format, ...)
73 ACPI_MSG_REDIRECT_BEGIN;
74 acpi_os_printf(ACPI_MSG_ERROR);
76 va_start(arg_list, format);
77 acpi_os_vprintf(format, arg_list);
81 ACPI_MSG_REDIRECT_END;
84 ACPI_EXPORT_SYMBOL(acpi_error)
86 /*******************************************************************************
88 * FUNCTION: acpi_exception
90 * PARAMETERS: module_name - Caller's module name (for error output)
91 * line_number - Caller's line number (for error output)
92 * status - Status to be formatted
93 * format - Printf format string + additional args
97 * DESCRIPTION: Print "ACPI Exception" message with module/line/version info
98 * and decoded acpi_status.
100 ******************************************************************************/
101 void ACPI_INTERNAL_VAR_XFACE
102 acpi_exception(const char *module_name,
103 u32 line_number, acpi_status status, const char *format, ...)
107 ACPI_MSG_REDIRECT_BEGIN;
108 acpi_os_printf(ACPI_MSG_EXCEPTION "%s, ",
109 acpi_format_exception(status));
111 va_start(arg_list, format);
112 acpi_os_vprintf(format, arg_list);
116 ACPI_MSG_REDIRECT_END;
119 ACPI_EXPORT_SYMBOL(acpi_exception)
121 /*******************************************************************************
123 * FUNCTION: acpi_warning
125 * PARAMETERS: module_name - Caller's module name (for error output)
126 * line_number - Caller's line number (for error output)
127 * format - Printf format string + additional args
131 * DESCRIPTION: Print "ACPI Warning" message with module/line/version info
133 ******************************************************************************/
134 void ACPI_INTERNAL_VAR_XFACE
135 acpi_warning(const char *module_name, u32 line_number, const char *format, ...)
139 ACPI_MSG_REDIRECT_BEGIN;
140 acpi_os_printf(ACPI_MSG_WARNING);
142 va_start(arg_list, format);
143 acpi_os_vprintf(format, arg_list);
147 ACPI_MSG_REDIRECT_END;
150 ACPI_EXPORT_SYMBOL(acpi_warning)
152 /*******************************************************************************
154 * FUNCTION: acpi_info
156 * PARAMETERS: module_name - Caller's module name (for error output)
157 * line_number - Caller's line number (for error output)
158 * format - Printf format string + additional args
162 * DESCRIPTION: Print generic "ACPI:" information message. There is no
163 * module/line/version info in order to keep the message simple.
165 * TBD: module_name and line_number args are not needed, should be removed.
167 ******************************************************************************/
168 void ACPI_INTERNAL_VAR_XFACE
169 acpi_info(const char *module_name, u32 line_number, const char *format, ...)
173 ACPI_MSG_REDIRECT_BEGIN;
174 acpi_os_printf(ACPI_MSG_INFO);
176 va_start(arg_list, format);
177 acpi_os_vprintf(format, arg_list);
178 acpi_os_printf("\n");
181 ACPI_MSG_REDIRECT_END;
184 ACPI_EXPORT_SYMBOL(acpi_info)
186 /*******************************************************************************
188 * FUNCTION: acpi_bios_error
190 * PARAMETERS: module_name - Caller's module name (for error output)
191 * line_number - Caller's line number (for error output)
192 * format - Printf format string + additional args
196 * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version
199 ******************************************************************************/
200 void ACPI_INTERNAL_VAR_XFACE
201 acpi_bios_error(const char *module_name,
202 u32 line_number, const char *format, ...)
206 ACPI_MSG_REDIRECT_BEGIN;
207 acpi_os_printf(ACPI_MSG_BIOS_ERROR);
209 va_start(arg_list, format);
210 acpi_os_vprintf(format, arg_list);
214 ACPI_MSG_REDIRECT_END;
217 ACPI_EXPORT_SYMBOL(acpi_bios_error)
219 /*******************************************************************************
221 * FUNCTION: acpi_bios_warning
223 * PARAMETERS: module_name - Caller's module name (for error output)
224 * line_number - Caller's line number (for error output)
225 * format - Printf format string + additional args
229 * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version
232 ******************************************************************************/
233 void ACPI_INTERNAL_VAR_XFACE
234 acpi_bios_warning(const char *module_name,
235 u32 line_number, const char *format, ...)
239 ACPI_MSG_REDIRECT_BEGIN;
240 acpi_os_printf(ACPI_MSG_BIOS_WARNING);
242 va_start(arg_list, format);
243 acpi_os_vprintf(format, arg_list);
247 ACPI_MSG_REDIRECT_END;
250 ACPI_EXPORT_SYMBOL(acpi_bios_warning)