1 /*******************************************************************************
3 * Module Name: utxferror - Various error/warning output functions
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2015, 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 #define EXPORT_ACPI_INTERFACES
46 #include <acpi/acpi.h>
49 #define _COMPONENT ACPI_UTILITIES
50 ACPI_MODULE_NAME("utxferror")
53 * This module is used for the in-kernel ACPICA as well as the ACPICA
56 #ifndef ACPI_NO_ERROR_MESSAGES /* Entire module */
57 /*******************************************************************************
59 * FUNCTION: acpi_error
61 * PARAMETERS: module_name - Caller's module name (for error output)
62 * line_number - Caller's line number (for error output)
63 * format - Printf format string + additional args
67 * DESCRIPTION: Print "ACPI Error" message with module/line/version info
69 ******************************************************************************/
70 void ACPI_INTERNAL_VAR_XFACE
71 acpi_error(const char *module_name
, u32 line_number
, const char *format
, ...)
75 ACPI_MSG_REDIRECT_BEGIN
;
76 acpi_os_printf(ACPI_MSG_ERROR
);
78 va_start(arg_list
, format
);
79 acpi_os_vprintf(format
, arg_list
);
83 ACPI_MSG_REDIRECT_END
;
86 ACPI_EXPORT_SYMBOL(acpi_error
)
88 /*******************************************************************************
90 * FUNCTION: acpi_exception
92 * PARAMETERS: module_name - Caller's module name (for error output)
93 * line_number - Caller's line number (for error output)
94 * status - Status to be formatted
95 * format - Printf format string + additional args
99 * DESCRIPTION: Print "ACPI Exception" message with module/line/version info
100 * and decoded acpi_status.
102 ******************************************************************************/
103 void ACPI_INTERNAL_VAR_XFACE
104 acpi_exception(const char *module_name
,
105 u32 line_number
, acpi_status status
, const char *format
, ...)
109 ACPI_MSG_REDIRECT_BEGIN
;
110 acpi_os_printf(ACPI_MSG_EXCEPTION
"%s, ",
111 acpi_format_exception(status
));
113 va_start(arg_list
, format
);
114 acpi_os_vprintf(format
, arg_list
);
118 ACPI_MSG_REDIRECT_END
;
121 ACPI_EXPORT_SYMBOL(acpi_exception
)
123 /*******************************************************************************
125 * FUNCTION: acpi_warning
127 * PARAMETERS: module_name - Caller's module name (for error output)
128 * line_number - Caller's line number (for error output)
129 * format - Printf format string + additional args
133 * DESCRIPTION: Print "ACPI Warning" message with module/line/version info
135 ******************************************************************************/
136 void ACPI_INTERNAL_VAR_XFACE
137 acpi_warning(const char *module_name
, u32 line_number
, const char *format
, ...)
141 ACPI_MSG_REDIRECT_BEGIN
;
142 acpi_os_printf(ACPI_MSG_WARNING
);
144 va_start(arg_list
, format
);
145 acpi_os_vprintf(format
, arg_list
);
149 ACPI_MSG_REDIRECT_END
;
152 ACPI_EXPORT_SYMBOL(acpi_warning
)
154 /*******************************************************************************
156 * FUNCTION: acpi_info
158 * PARAMETERS: module_name - Caller's module name (for error output)
159 * line_number - Caller's line number (for error output)
160 * format - Printf format string + additional args
164 * DESCRIPTION: Print generic "ACPI:" information message. There is no
165 * module/line/version info in order to keep the message simple.
167 * TBD: module_name and line_number args are not needed, should be removed.
169 ******************************************************************************/
170 void ACPI_INTERNAL_VAR_XFACE
171 acpi_info(const char *module_name
, u32 line_number
, const char *format
, ...)
175 ACPI_MSG_REDIRECT_BEGIN
;
176 acpi_os_printf(ACPI_MSG_INFO
);
178 va_start(arg_list
, format
);
179 acpi_os_vprintf(format
, arg_list
);
180 acpi_os_printf("\n");
183 ACPI_MSG_REDIRECT_END
;
186 ACPI_EXPORT_SYMBOL(acpi_info
)
188 /*******************************************************************************
190 * FUNCTION: acpi_bios_error
192 * PARAMETERS: module_name - Caller's module name (for error output)
193 * line_number - Caller's line number (for error output)
194 * format - Printf format string + additional args
198 * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version
201 ******************************************************************************/
202 void ACPI_INTERNAL_VAR_XFACE
203 acpi_bios_error(const char *module_name
,
204 u32 line_number
, const char *format
, ...)
208 ACPI_MSG_REDIRECT_BEGIN
;
209 acpi_os_printf(ACPI_MSG_BIOS_ERROR
);
211 va_start(arg_list
, format
);
212 acpi_os_vprintf(format
, arg_list
);
216 ACPI_MSG_REDIRECT_END
;
219 ACPI_EXPORT_SYMBOL(acpi_bios_error
)
221 /*******************************************************************************
223 * FUNCTION: acpi_bios_warning
225 * PARAMETERS: module_name - Caller's module name (for error output)
226 * line_number - Caller's line number (for error output)
227 * format - Printf format string + additional args
231 * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version
234 ******************************************************************************/
235 void ACPI_INTERNAL_VAR_XFACE
236 acpi_bios_warning(const char *module_name
,
237 u32 line_number
, const char *format
, ...)
241 ACPI_MSG_REDIRECT_BEGIN
;
242 acpi_os_printf(ACPI_MSG_BIOS_WARNING
);
244 va_start(arg_list
, format
);
245 acpi_os_vprintf(format
, arg_list
);
249 ACPI_MSG_REDIRECT_END
;
252 ACPI_EXPORT_SYMBOL(acpi_bios_warning
)
253 #endif /* ACPI_NO_ERROR_MESSAGES */