1 /*******************************************************************************
3 * Module Name: uterror - Various internal 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.
51 #define _COMPONENT ACPI_UTILITIES
52 ACPI_MODULE_NAME ("uterror")
56 * This module contains internal error functions that may
59 #if !defined (ACPI_NO_ERROR_MESSAGES)
61 /*******************************************************************************
63 * FUNCTION: AcpiUtPredefinedWarning
65 * PARAMETERS: ModuleName - Caller's module name (for error output)
66 * LineNumber - Caller's line number (for error output)
67 * Pathname - Full pathname to the node
68 * NodeFlags - From Namespace node for the method/object
69 * Format - Printf format string + additional args
73 * DESCRIPTION: Warnings for the predefined validation module. Messages are
74 * only emitted the first time a problem with a particular
75 * method/object is detected. This prevents a flood of error
76 * messages for methods that are repeatedly evaluated.
78 ******************************************************************************/
80 void ACPI_INTERNAL_VAR_XFACE
81 AcpiUtPredefinedWarning (
82 const char *ModuleName
,
93 * Warning messages for this method/object will be disabled after the
94 * first time a validation fails or an object is successfully repaired.
96 if (NodeFlags
& ANOBJ_EVALUATED
)
101 AcpiOsPrintf (ACPI_MSG_WARNING
"%s: ", Pathname
);
103 va_start (ArgList
, Format
);
104 AcpiOsVprintf (Format
, ArgList
);
110 /*******************************************************************************
112 * FUNCTION: AcpiUtPredefinedInfo
114 * PARAMETERS: ModuleName - Caller's module name (for error output)
115 * LineNumber - Caller's line number (for error output)
116 * Pathname - Full pathname to the node
117 * NodeFlags - From Namespace node for the method/object
118 * Format - Printf format string + additional args
122 * DESCRIPTION: Info messages for the predefined validation module. Messages
123 * are only emitted the first time a problem with a particular
124 * method/object is detected. This prevents a flood of
125 * messages for methods that are repeatedly evaluated.
127 ******************************************************************************/
129 void ACPI_INTERNAL_VAR_XFACE
130 AcpiUtPredefinedInfo (
131 const char *ModuleName
,
142 * Warning messages for this method/object will be disabled after the
143 * first time a validation fails or an object is successfully repaired.
145 if (NodeFlags
& ANOBJ_EVALUATED
)
150 AcpiOsPrintf (ACPI_MSG_INFO
"%s: ", Pathname
);
152 va_start (ArgList
, Format
);
153 AcpiOsVprintf (Format
, ArgList
);
159 /*******************************************************************************
161 * FUNCTION: AcpiUtPredefinedBiosError
163 * PARAMETERS: ModuleName - Caller's module name (for error output)
164 * LineNumber - Caller's line number (for error output)
165 * Pathname - Full pathname to the node
166 * NodeFlags - From Namespace node for the method/object
167 * Format - Printf format string + additional args
171 * DESCRIPTION: BIOS error message for predefined names. Messages
172 * are only emitted the first time a problem with a particular
173 * method/object is detected. This prevents a flood of
174 * messages for methods that are repeatedly evaluated.
176 ******************************************************************************/
178 void ACPI_INTERNAL_VAR_XFACE
179 AcpiUtPredefinedBiosError (
180 const char *ModuleName
,
191 * Warning messages for this method/object will be disabled after the
192 * first time a validation fails or an object is successfully repaired.
194 if (NodeFlags
& ANOBJ_EVALUATED
)
199 AcpiOsPrintf (ACPI_MSG_BIOS_ERROR
"%s: ", Pathname
);
201 va_start (ArgList
, Format
);
202 AcpiOsVprintf (Format
, ArgList
);
208 /*******************************************************************************
210 * FUNCTION: AcpiUtNamespaceError
212 * PARAMETERS: ModuleName - Caller's module name (for error output)
213 * LineNumber - Caller's line number (for error output)
214 * InternalName - Name or path of the namespace node
215 * LookupStatus - Exception code from NS lookup
219 * DESCRIPTION: Print error message with the full pathname for the NS node.
221 ******************************************************************************/
224 AcpiUtNamespaceError (
225 const char *ModuleName
,
227 const char *InternalName
,
228 ACPI_STATUS LookupStatus
)
235 ACPI_MSG_REDIRECT_BEGIN
;
236 AcpiOsPrintf (ACPI_MSG_ERROR
);
238 if (LookupStatus
== AE_BAD_CHARACTER
)
240 /* There is a non-ascii character in the name */
242 ACPI_MOVE_32_TO_32 (&BadName
, ACPI_CAST_PTR (UINT32
, InternalName
));
243 AcpiOsPrintf ("[0x%.8X] (NON-ASCII)", BadName
);
247 /* Convert path to external format */
249 Status
= AcpiNsExternalizeName (ACPI_UINT32_MAX
,
250 InternalName
, NULL
, &Name
);
252 /* Print target name */
254 if (ACPI_SUCCESS (Status
))
256 AcpiOsPrintf ("[%s]", Name
);
260 AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]");
269 AcpiOsPrintf (" Namespace lookup failure, %s",
270 AcpiFormatException (LookupStatus
));
273 ACPI_MSG_REDIRECT_END
;
277 /*******************************************************************************
279 * FUNCTION: AcpiUtMethodError
281 * PARAMETERS: ModuleName - Caller's module name (for error output)
282 * LineNumber - Caller's line number (for error output)
283 * Message - Error message to use on failure
284 * PrefixNode - Prefix relative to the path
285 * Path - Path to the node (optional)
286 * MethodStatus - Execution status
290 * DESCRIPTION: Print error message with the full pathname for the method.
292 ******************************************************************************/
296 const char *ModuleName
,
299 ACPI_NAMESPACE_NODE
*PrefixNode
,
301 ACPI_STATUS MethodStatus
)
304 ACPI_NAMESPACE_NODE
*Node
= PrefixNode
;
307 ACPI_MSG_REDIRECT_BEGIN
;
308 AcpiOsPrintf (ACPI_MSG_ERROR
);
312 Status
= AcpiNsGetNode (PrefixNode
, Path
, ACPI_NS_NO_UPSEARCH
,
314 if (ACPI_FAILURE (Status
))
316 AcpiOsPrintf ("[Could not get node by pathname]");
320 AcpiNsPrintNodePathname (Node
, Message
);
321 AcpiOsPrintf (", %s", AcpiFormatException (MethodStatus
));
324 ACPI_MSG_REDIRECT_END
;
327 #endif /* ACPI_NO_ERROR_MESSAGES */