1 /*******************************************************************************
3 * Module Name: uterror - Various internal 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.
49 #define _COMPONENT ACPI_UTILITIES
50 ACPI_MODULE_NAME ("uterror")
54 * This module contains internal error functions that may
57 #if !defined (ACPI_NO_ERROR_MESSAGES)
59 /*******************************************************************************
61 * FUNCTION: AcpiUtPredefinedWarning
63 * PARAMETERS: ModuleName - Caller's module name (for error output)
64 * LineNumber - Caller's line number (for error output)
65 * Pathname - Full pathname to the node
66 * NodeFlags - From Namespace node for the method/object
67 * Format - Printf format string + additional args
71 * DESCRIPTION: Warnings for the predefined validation module. Messages are
72 * only emitted the first time a problem with a particular
73 * method/object is detected. This prevents a flood of error
74 * messages for methods that are repeatedly evaluated.
76 ******************************************************************************/
78 void ACPI_INTERNAL_VAR_XFACE
79 AcpiUtPredefinedWarning (
80 const char *ModuleName,
91 * Warning messages for this method/object will be disabled after the
92 * first time a validation fails or an object is successfully repaired.
94 if (NodeFlags & ANOBJ_EVALUATED)
99 AcpiOsPrintf (ACPI_MSG_WARNING "%s: ", Pathname);
101 va_start (ArgList, Format);
102 AcpiOsVprintf (Format, ArgList);
108 /*******************************************************************************
110 * FUNCTION: AcpiUtPredefinedInfo
112 * PARAMETERS: ModuleName - Caller's module name (for error output)
113 * LineNumber - Caller's line number (for error output)
114 * Pathname - Full pathname to the node
115 * NodeFlags - From Namespace node for the method/object
116 * Format - Printf format string + additional args
120 * DESCRIPTION: Info messages for the predefined validation module. Messages
121 * are only emitted the first time a problem with a particular
122 * method/object is detected. This prevents a flood of
123 * messages for methods that are repeatedly evaluated.
125 ******************************************************************************/
127 void ACPI_INTERNAL_VAR_XFACE
128 AcpiUtPredefinedInfo (
129 const char *ModuleName,
140 * Warning messages for this method/object will be disabled after the
141 * first time a validation fails or an object is successfully repaired.
143 if (NodeFlags & ANOBJ_EVALUATED)
148 AcpiOsPrintf (ACPI_MSG_INFO "%s: ", Pathname);
150 va_start (ArgList, Format);
151 AcpiOsVprintf (Format, ArgList);
157 /*******************************************************************************
159 * FUNCTION: AcpiUtPredefinedBiosError
161 * PARAMETERS: ModuleName - Caller's module name (for error output)
162 * LineNumber - Caller's line number (for error output)
163 * Pathname - Full pathname to the node
164 * NodeFlags - From Namespace node for the method/object
165 * Format - Printf format string + additional args
169 * DESCRIPTION: BIOS error message for predefined names. Messages
170 * are only emitted the first time a problem with a particular
171 * method/object is detected. This prevents a flood of
172 * messages for methods that are repeatedly evaluated.
174 ******************************************************************************/
176 void ACPI_INTERNAL_VAR_XFACE
177 AcpiUtPredefinedBiosError (
178 const char *ModuleName,
189 * Warning messages for this method/object will be disabled after the
190 * first time a validation fails or an object is successfully repaired.
192 if (NodeFlags & ANOBJ_EVALUATED)
197 AcpiOsPrintf (ACPI_MSG_BIOS_ERROR "%s: ", Pathname);
199 va_start (ArgList, Format);
200 AcpiOsVprintf (Format, ArgList);
206 /*******************************************************************************
208 * FUNCTION: AcpiUtNamespaceError
210 * PARAMETERS: ModuleName - Caller's module name (for error output)
211 * LineNumber - Caller's line number (for error output)
212 * InternalName - Name or path of the namespace node
213 * LookupStatus - Exception code from NS lookup
217 * DESCRIPTION: Print error message with the full pathname for the NS node.
219 ******************************************************************************/
222 AcpiUtNamespaceError (
223 const char *ModuleName,
225 const char *InternalName,
226 ACPI_STATUS LookupStatus)
233 ACPI_MSG_REDIRECT_BEGIN;
234 AcpiOsPrintf (ACPI_MSG_ERROR);
236 if (LookupStatus == AE_BAD_CHARACTER)
238 /* There is a non-ascii character in the name */
240 ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName));
241 AcpiOsPrintf ("[0x%.8X] (NON-ASCII)", BadName);
245 /* Convert path to external format */
247 Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
248 InternalName, NULL, &Name);
250 /* Print target name */
252 if (ACPI_SUCCESS (Status))
254 AcpiOsPrintf ("[%s]", Name);
258 AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]");
267 AcpiOsPrintf (" Namespace lookup failure, %s",
268 AcpiFormatException (LookupStatus));
271 ACPI_MSG_REDIRECT_END;
275 /*******************************************************************************
277 * FUNCTION: AcpiUtMethodError
279 * PARAMETERS: ModuleName - Caller's module name (for error output)
280 * LineNumber - Caller's line number (for error output)
281 * Message - Error message to use on failure
282 * PrefixNode - Prefix relative to the path
283 * Path - Path to the node (optional)
284 * MethodStatus - Execution status
288 * DESCRIPTION: Print error message with the full pathname for the method.
290 ******************************************************************************/
294 const char *ModuleName,
297 ACPI_NAMESPACE_NODE *PrefixNode,
299 ACPI_STATUS MethodStatus)
302 ACPI_NAMESPACE_NODE *Node = PrefixNode;
305 ACPI_MSG_REDIRECT_BEGIN;
306 AcpiOsPrintf (ACPI_MSG_ERROR);
310 Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH,
312 if (ACPI_FAILURE (Status))
314 AcpiOsPrintf ("[Could not get node by pathname]");
318 AcpiNsPrintNodePathname (Node, Message);
319 AcpiOsPrintf (", %s", AcpiFormatException (MethodStatus));
322 ACPI_MSG_REDIRECT_END;
325 #endif /* ACPI_NO_ERROR_MESSAGES */