8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / acpi / common / utxferror.c
blobe79ffc94f3017a20e1587336c29993fafcc4cb28
1 /*******************************************************************************
3 * Module Name: utxferror - Various error/warning output functions
5 ******************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2016, Intel Corp.
9 * All rights reserved.
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.
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.
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 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.h"
47 #include "accommon.h"
50 #define _COMPONENT ACPI_UTILITIES
51 ACPI_MODULE_NAME ("utxferror")
54 * This module is used for the in-kernel ACPICA as well as the ACPICA
55 * tools/applications.
58 #ifndef ACPI_NO_ERROR_MESSAGES /* Entire module */
60 /*******************************************************************************
62 * FUNCTION: AcpiError
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
68 * RETURN: None
70 * DESCRIPTION: Print "ACPI Error" message with module/line/version info
72 ******************************************************************************/
74 void ACPI_INTERNAL_VAR_XFACE
75 AcpiError (
76 const char *ModuleName,
77 UINT32 LineNumber,
78 const char *Format,
79 ...)
81 va_list ArgList;
84 ACPI_MSG_REDIRECT_BEGIN;
85 AcpiOsPrintf (ACPI_MSG_ERROR);
87 va_start (ArgList, Format);
88 AcpiOsVprintf (Format, ArgList);
89 ACPI_MSG_SUFFIX;
90 va_end (ArgList);
92 ACPI_MSG_REDIRECT_END;
95 ACPI_EXPORT_SYMBOL (AcpiError)
98 /*******************************************************************************
100 * FUNCTION: AcpiException
102 * PARAMETERS: ModuleName - Caller's module name (for error output)
103 * LineNumber - Caller's line number (for error output)
104 * Status - Status to be formatted
105 * Format - Printf format string + additional args
107 * RETURN: None
109 * DESCRIPTION: Print "ACPI Exception" message with module/line/version info
110 * and decoded ACPI_STATUS.
112 ******************************************************************************/
114 void ACPI_INTERNAL_VAR_XFACE
115 AcpiException (
116 const char *ModuleName,
117 UINT32 LineNumber,
118 ACPI_STATUS Status,
119 const char *Format,
120 ...)
122 va_list ArgList;
125 ACPI_MSG_REDIRECT_BEGIN;
127 /* For AE_OK, just print the message */
129 if (ACPI_SUCCESS (Status))
131 AcpiOsPrintf (ACPI_MSG_EXCEPTION);
134 else
136 AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ",
137 AcpiFormatException (Status));
140 va_start (ArgList, Format);
141 AcpiOsVprintf (Format, ArgList);
142 ACPI_MSG_SUFFIX;
143 va_end (ArgList);
145 ACPI_MSG_REDIRECT_END;
148 ACPI_EXPORT_SYMBOL (AcpiException)
151 /*******************************************************************************
153 * FUNCTION: AcpiWarning
155 * PARAMETERS: ModuleName - Caller's module name (for error output)
156 * LineNumber - Caller's line number (for error output)
157 * Format - Printf format string + additional args
159 * RETURN: None
161 * DESCRIPTION: Print "ACPI Warning" message with module/line/version info
163 ******************************************************************************/
165 void ACPI_INTERNAL_VAR_XFACE
166 AcpiWarning (
167 const char *ModuleName,
168 UINT32 LineNumber,
169 const char *Format,
170 ...)
172 va_list ArgList;
175 ACPI_MSG_REDIRECT_BEGIN;
176 AcpiOsPrintf (ACPI_MSG_WARNING);
178 va_start (ArgList, Format);
179 AcpiOsVprintf (Format, ArgList);
180 ACPI_MSG_SUFFIX;
181 va_end (ArgList);
183 ACPI_MSG_REDIRECT_END;
186 ACPI_EXPORT_SYMBOL (AcpiWarning)
189 /*******************************************************************************
191 * FUNCTION: AcpiInfo
193 * PARAMETERS: ModuleName - Caller's module name (for error output)
194 * LineNumber - Caller's line number (for error output)
195 * Format - Printf format string + additional args
197 * RETURN: None
199 * DESCRIPTION: Print generic "ACPI:" information message. There is no
200 * module/line/version info in order to keep the message simple.
202 * TBD: ModuleName and LineNumber args are not needed, should be removed.
204 ******************************************************************************/
206 void ACPI_INTERNAL_VAR_XFACE
207 AcpiInfo (
208 const char *Format,
209 ...)
211 va_list ArgList;
214 ACPI_MSG_REDIRECT_BEGIN;
215 AcpiOsPrintf (ACPI_MSG_INFO);
217 va_start (ArgList, Format);
218 AcpiOsVprintf (Format, ArgList);
219 AcpiOsPrintf ("\n");
220 va_end (ArgList);
222 ACPI_MSG_REDIRECT_END;
225 ACPI_EXPORT_SYMBOL (AcpiInfo)
228 /*******************************************************************************
230 * FUNCTION: AcpiBiosError
232 * PARAMETERS: ModuleName - Caller's module name (for error output)
233 * LineNumber - Caller's line number (for error output)
234 * Format - Printf format string + additional args
236 * RETURN: None
238 * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version
239 * info
241 ******************************************************************************/
243 void ACPI_INTERNAL_VAR_XFACE
244 AcpiBiosError (
245 const char *ModuleName,
246 UINT32 LineNumber,
247 const char *Format,
248 ...)
250 va_list ArgList;
253 ACPI_MSG_REDIRECT_BEGIN;
254 AcpiOsPrintf (ACPI_MSG_BIOS_ERROR);
256 va_start (ArgList, Format);
257 AcpiOsVprintf (Format, ArgList);
258 ACPI_MSG_SUFFIX;
259 va_end (ArgList);
261 ACPI_MSG_REDIRECT_END;
264 ACPI_EXPORT_SYMBOL (AcpiBiosError)
267 /*******************************************************************************
269 * FUNCTION: AcpiBiosWarning
271 * PARAMETERS: ModuleName - Caller's module name (for error output)
272 * LineNumber - Caller's line number (for error output)
273 * Format - Printf format string + additional args
275 * RETURN: None
277 * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version
278 * info
280 ******************************************************************************/
282 void ACPI_INTERNAL_VAR_XFACE
283 AcpiBiosWarning (
284 const char *ModuleName,
285 UINT32 LineNumber,
286 const char *Format,
287 ...)
289 va_list ArgList;
292 ACPI_MSG_REDIRECT_BEGIN;
293 AcpiOsPrintf (ACPI_MSG_BIOS_WARNING);
295 va_start (ArgList, Format);
296 AcpiOsVprintf (Format, ArgList);
297 ACPI_MSG_SUFFIX;
298 va_end (ArgList);
300 ACPI_MSG_REDIRECT_END;
303 ACPI_EXPORT_SYMBOL (AcpiBiosWarning)
305 #endif /* ACPI_NO_ERROR_MESSAGES */