utxferror.c revision 212700
1212700Sjkim/*******************************************************************************
2212700Sjkim *
3212700Sjkim * Module Name: utxferror - Various error/warning output functions
4212700Sjkim *
5212700Sjkim ******************************************************************************/
6212700Sjkim
7212700Sjkim/******************************************************************************
8212700Sjkim *
9212700Sjkim * 1. Copyright Notice
10212700Sjkim *
11212700Sjkim * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
12212700Sjkim * All rights reserved.
13212700Sjkim *
14212700Sjkim * 2. License
15212700Sjkim *
16212700Sjkim * 2.1. This is your license from Intel Corp. under its intellectual property
17212700Sjkim * rights.  You may have additional license terms from the party that provided
18212700Sjkim * you this software, covering your right to use that party's intellectual
19212700Sjkim * property rights.
20212700Sjkim *
21212700Sjkim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22212700Sjkim * copy of the source code appearing in this file ("Covered Code") an
23212700Sjkim * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24212700Sjkim * base code distributed originally by Intel ("Original Intel Code") to copy,
25212700Sjkim * make derivatives, distribute, use and display any portion of the Covered
26212700Sjkim * Code in any form, with the right to sublicense such rights; and
27212700Sjkim *
28212700Sjkim * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29212700Sjkim * license (with the right to sublicense), under only those claims of Intel
30212700Sjkim * patents that are infringed by the Original Intel Code, to make, use, sell,
31212700Sjkim * offer to sell, and import the Covered Code and derivative works thereof
32212700Sjkim * solely to the minimum extent necessary to exercise the above copyright
33212700Sjkim * license, and in no event shall the patent license extend to any additions
34212700Sjkim * to or modifications of the Original Intel Code.  No other license or right
35212700Sjkim * is granted directly or by implication, estoppel or otherwise;
36212700Sjkim *
37212700Sjkim * The above copyright and patent license is granted only if the following
38212700Sjkim * conditions are met:
39212700Sjkim *
40212700Sjkim * 3. Conditions
41212700Sjkim *
42212700Sjkim * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43212700Sjkim * Redistribution of source code of any substantial portion of the Covered
44212700Sjkim * Code or modification with rights to further distribute source must include
45212700Sjkim * the above Copyright Notice, the above License, this list of Conditions,
46212700Sjkim * and the following Disclaimer and Export Compliance provision.  In addition,
47212700Sjkim * Licensee must cause all Covered Code to which Licensee contributes to
48212700Sjkim * contain a file documenting the changes Licensee made to create that Covered
49212700Sjkim * Code and the date of any change.  Licensee must include in that file the
50212700Sjkim * documentation of any changes made by any predecessor Licensee.  Licensee
51212700Sjkim * must include a prominent statement that the modification is derived,
52212700Sjkim * directly or indirectly, from Original Intel Code.
53212700Sjkim *
54212700Sjkim * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55212700Sjkim * Redistribution of source code of any substantial portion of the Covered
56212700Sjkim * Code or modification without rights to further distribute source must
57212700Sjkim * include the following Disclaimer and Export Compliance provision in the
58212700Sjkim * documentation and/or other materials provided with distribution.  In
59212700Sjkim * addition, Licensee may not authorize further sublicense of source of any
60212700Sjkim * portion of the Covered Code, and must include terms to the effect that the
61212700Sjkim * license from Licensee to its licensee is limited to the intellectual
62212700Sjkim * property embodied in the software Licensee provides to its licensee, and
63212700Sjkim * not to intellectual property embodied in modifications its licensee may
64212700Sjkim * make.
65212700Sjkim *
66212700Sjkim * 3.3. Redistribution of Executable. Redistribution in executable form of any
67212700Sjkim * substantial portion of the Covered Code or modification must reproduce the
68212700Sjkim * above Copyright Notice, and the following Disclaimer and Export Compliance
69212700Sjkim * provision in the documentation and/or other materials provided with the
70212700Sjkim * distribution.
71212700Sjkim *
72212700Sjkim * 3.4. Intel retains all right, title, and interest in and to the Original
73212700Sjkim * Intel Code.
74212700Sjkim *
75212700Sjkim * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76212700Sjkim * Intel shall be used in advertising or otherwise to promote the sale, use or
77212700Sjkim * other dealings in products derived from or relating to the Covered Code
78212700Sjkim * without prior written authorization from Intel.
79212700Sjkim *
80212700Sjkim * 4. Disclaimer and Export Compliance
81212700Sjkim *
82212700Sjkim * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83212700Sjkim * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84212700Sjkim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
85212700Sjkim * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
86212700Sjkim * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
87212700Sjkim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88212700Sjkim * PARTICULAR PURPOSE.
89212700Sjkim *
90212700Sjkim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91212700Sjkim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92212700Sjkim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93212700Sjkim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94212700Sjkim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95212700Sjkim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
96212700Sjkim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97212700Sjkim * LIMITED REMEDY.
98212700Sjkim *
99212700Sjkim * 4.3. Licensee shall not export, either directly or indirectly, any of this
100212700Sjkim * software or system incorporating such software without first obtaining any
101212700Sjkim * required license or other approval from the U. S. Department of Commerce or
102212700Sjkim * any other agency or department of the United States Government.  In the
103212700Sjkim * event Licensee exports any such software from the United States or
104212700Sjkim * re-exports any such software from a foreign destination, Licensee shall
105212700Sjkim * ensure that the distribution and export/re-export of the software is in
106212700Sjkim * compliance with all laws, regulations, orders, or other restrictions of the
107212700Sjkim * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108212700Sjkim * any of its subsidiaries will export/re-export any technical data, process,
109212700Sjkim * software, or service, directly or indirectly, to any country for which the
110212700Sjkim * United States government or any agency thereof requires an export license,
111212700Sjkim * other governmental approval, or letter of assurance, without first obtaining
112212700Sjkim * such license, approval or letter.
113212700Sjkim *
114212700Sjkim *****************************************************************************/
115212700Sjkim
116212700Sjkim#define __UTXFERROR_C__
117212700Sjkim
118212700Sjkim#include "acpi.h"
119212700Sjkim#include "accommon.h"
120212700Sjkim#include "acnamesp.h"
121212700Sjkim
122212700Sjkim
123212700Sjkim#define _COMPONENT          ACPI_UTILITIES
124212700Sjkim        ACPI_MODULE_NAME    ("utxferror")
125212700Sjkim
126212700Sjkim/*
127212700Sjkim * This module is used for the in-kernel ACPICA as well as the ACPICA
128212700Sjkim * tools/applications.
129212700Sjkim *
130212700Sjkim * For the iASL compiler case, the output is redirected to stderr so that
131212700Sjkim * any of the various ACPI errors and warnings do not appear in the output
132212700Sjkim * files, for either the compiler or disassembler portions of the tool.
133212700Sjkim */
134212700Sjkim#ifdef ACPI_ASL_COMPILER
135212700Sjkim#include <stdio.h>
136212700Sjkim
137212700Sjkimextern FILE                 *AcpiGbl_OutputFile;
138212700Sjkim
139212700Sjkim#define ACPI_MSG_REDIRECT_BEGIN \
140212700Sjkim    FILE                    *OutputFile = AcpiGbl_OutputFile; \
141212700Sjkim    AcpiOsRedirectOutput (stderr);
142212700Sjkim
143212700Sjkim#define ACPI_MSG_REDIRECT_END \
144212700Sjkim    AcpiOsRedirectOutput (OutputFile);
145212700Sjkim
146212700Sjkim#else
147212700Sjkim/*
148212700Sjkim * non-iASL case - no redirection, nothing to do
149212700Sjkim */
150212700Sjkim#define ACPI_MSG_REDIRECT_BEGIN
151212700Sjkim#define ACPI_MSG_REDIRECT_END
152212700Sjkim#endif
153212700Sjkim
154212700Sjkim/*
155212700Sjkim * Common message prefixes
156212700Sjkim */
157212700Sjkim#define ACPI_MSG_ERROR          "ACPI Error: "
158212700Sjkim#define ACPI_MSG_EXCEPTION      "ACPI Exception: "
159212700Sjkim#define ACPI_MSG_WARNING        "ACPI Warning: "
160212700Sjkim#define ACPI_MSG_INFO           "ACPI: "
161212700Sjkim
162212700Sjkim/*
163212700Sjkim * Common message suffix
164212700Sjkim */
165212700Sjkim#define ACPI_MSG_SUFFIX \
166212700Sjkim    AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)
167212700Sjkim
168212700Sjkim
169212700Sjkim/*******************************************************************************
170212700Sjkim *
171212700Sjkim * FUNCTION:    AcpiError
172212700Sjkim *
173212700Sjkim * PARAMETERS:  ModuleName          - Caller's module name (for error output)
174212700Sjkim *              LineNumber          - Caller's line number (for error output)
175212700Sjkim *              Format              - Printf format string + additional args
176212700Sjkim *
177212700Sjkim * RETURN:      None
178212700Sjkim *
179212700Sjkim * DESCRIPTION: Print "ACPI Error" message with module/line/version info
180212700Sjkim *
181212700Sjkim ******************************************************************************/
182212700Sjkim
183212700Sjkimvoid ACPI_INTERNAL_VAR_XFACE
184212700SjkimAcpiError (
185212700Sjkim    const char              *ModuleName,
186212700Sjkim    UINT32                  LineNumber,
187212700Sjkim    const char              *Format,
188212700Sjkim    ...)
189212700Sjkim{
190212700Sjkim    va_list                 ArgList;
191212700Sjkim
192212700Sjkim
193212700Sjkim    ACPI_MSG_REDIRECT_BEGIN;
194212700Sjkim    AcpiOsPrintf (ACPI_MSG_ERROR);
195212700Sjkim
196212700Sjkim    va_start (ArgList, Format);
197212700Sjkim    AcpiOsVprintf (Format, ArgList);
198212700Sjkim    ACPI_MSG_SUFFIX;
199212700Sjkim    va_end (ArgList);
200212700Sjkim
201212700Sjkim    ACPI_MSG_REDIRECT_END;
202212700Sjkim}
203212700Sjkim
204212700SjkimACPI_EXPORT_SYMBOL (AcpiError)
205212700Sjkim
206212700Sjkim
207212700Sjkim/*******************************************************************************
208212700Sjkim *
209212700Sjkim * FUNCTION:    AcpiException
210212700Sjkim *
211212700Sjkim * PARAMETERS:  ModuleName          - Caller's module name (for error output)
212212700Sjkim *              LineNumber          - Caller's line number (for error output)
213212700Sjkim *              Status              - Status to be formatted
214212700Sjkim *              Format              - Printf format string + additional args
215212700Sjkim *
216212700Sjkim * RETURN:      None
217212700Sjkim *
218212700Sjkim * DESCRIPTION: Print "ACPI Exception" message with module/line/version info
219212700Sjkim *              and decoded ACPI_STATUS.
220212700Sjkim *
221212700Sjkim ******************************************************************************/
222212700Sjkim
223212700Sjkimvoid ACPI_INTERNAL_VAR_XFACE
224212700SjkimAcpiException (
225212700Sjkim    const char              *ModuleName,
226212700Sjkim    UINT32                  LineNumber,
227212700Sjkim    ACPI_STATUS             Status,
228212700Sjkim    const char              *Format,
229212700Sjkim    ...)
230212700Sjkim{
231212700Sjkim    va_list                 ArgList;
232212700Sjkim
233212700Sjkim
234212700Sjkim    ACPI_MSG_REDIRECT_BEGIN;
235212700Sjkim    AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ", AcpiFormatException (Status));
236212700Sjkim
237212700Sjkim    va_start (ArgList, Format);
238212700Sjkim    AcpiOsVprintf (Format, ArgList);
239212700Sjkim    ACPI_MSG_SUFFIX;
240212700Sjkim    va_end (ArgList);
241212700Sjkim
242212700Sjkim    ACPI_MSG_REDIRECT_END;
243212700Sjkim}
244212700Sjkim
245212700SjkimACPI_EXPORT_SYMBOL (AcpiException)
246212700Sjkim
247212700Sjkim
248212700Sjkim/*******************************************************************************
249212700Sjkim *
250212700Sjkim * FUNCTION:    AcpiWarning
251212700Sjkim *
252212700Sjkim * PARAMETERS:  ModuleName          - Caller's module name (for error output)
253212700Sjkim *              LineNumber          - Caller's line number (for error output)
254212700Sjkim *              Format              - Printf format string + additional args
255212700Sjkim *
256212700Sjkim * RETURN:      None
257212700Sjkim *
258212700Sjkim * DESCRIPTION: Print "ACPI Warning" message with module/line/version info
259212700Sjkim *
260212700Sjkim ******************************************************************************/
261212700Sjkim
262212700Sjkimvoid ACPI_INTERNAL_VAR_XFACE
263212700SjkimAcpiWarning (
264212700Sjkim    const char              *ModuleName,
265212700Sjkim    UINT32                  LineNumber,
266212700Sjkim    const char              *Format,
267212700Sjkim    ...)
268212700Sjkim{
269212700Sjkim    va_list                 ArgList;
270212700Sjkim
271212700Sjkim
272212700Sjkim    ACPI_MSG_REDIRECT_BEGIN;
273212700Sjkim    AcpiOsPrintf (ACPI_MSG_WARNING);
274212700Sjkim
275212700Sjkim    va_start (ArgList, Format);
276212700Sjkim    AcpiOsVprintf (Format, ArgList);
277212700Sjkim    ACPI_MSG_SUFFIX;
278212700Sjkim    va_end (ArgList);
279212700Sjkim
280212700Sjkim    ACPI_MSG_REDIRECT_END;
281212700Sjkim}
282212700Sjkim
283212700SjkimACPI_EXPORT_SYMBOL (AcpiWarning)
284212700Sjkim
285212700Sjkim
286212700Sjkim/*******************************************************************************
287212700Sjkim *
288212700Sjkim * FUNCTION:    AcpiInfo
289212700Sjkim *
290212700Sjkim * PARAMETERS:  ModuleName          - Caller's module name (for error output)
291212700Sjkim *              LineNumber          - Caller's line number (for error output)
292212700Sjkim *              Format              - Printf format string + additional args
293212700Sjkim *
294212700Sjkim * RETURN:      None
295212700Sjkim *
296212700Sjkim * DESCRIPTION: Print generic "ACPI:" information message. There is no
297212700Sjkim *              module/line/version info in order to keep the message simple.
298212700Sjkim *
299212700Sjkim * TBD: ModuleName and LineNumber args are not needed, should be removed.
300212700Sjkim *
301212700Sjkim ******************************************************************************/
302212700Sjkim
303212700Sjkimvoid ACPI_INTERNAL_VAR_XFACE
304212700SjkimAcpiInfo (
305212700Sjkim    const char              *ModuleName,
306212700Sjkim    UINT32                  LineNumber,
307212700Sjkim    const char              *Format,
308212700Sjkim    ...)
309212700Sjkim{
310212700Sjkim    va_list                 ArgList;
311212700Sjkim
312212700Sjkim
313212700Sjkim    ACPI_MSG_REDIRECT_BEGIN;
314212700Sjkim    AcpiOsPrintf (ACPI_MSG_INFO);
315212700Sjkim
316212700Sjkim    va_start (ArgList, Format);
317212700Sjkim    AcpiOsVprintf (Format, ArgList);
318212700Sjkim    AcpiOsPrintf ("\n");
319212700Sjkim    va_end (ArgList);
320212700Sjkim
321212700Sjkim    ACPI_MSG_REDIRECT_END;
322212700Sjkim}
323212700Sjkim
324212700SjkimACPI_EXPORT_SYMBOL (AcpiInfo)
325212700Sjkim
326212700Sjkim
327212700Sjkim/*
328212700Sjkim * The remainder of this module contains internal error functions that may
329212700Sjkim * be configured out.
330212700Sjkim */
331212700Sjkim#if !defined (ACPI_NO_ERROR_MESSAGES) && !defined (ACPI_BIN_APP)
332212700Sjkim
333212700Sjkim/*******************************************************************************
334212700Sjkim *
335212700Sjkim * FUNCTION:    AcpiUtPredefinedWarning
336212700Sjkim *
337212700Sjkim * PARAMETERS:  ModuleName      - Caller's module name (for error output)
338212700Sjkim *              LineNumber      - Caller's line number (for error output)
339212700Sjkim *              Pathname        - Full pathname to the node
340212700Sjkim *              NodeFlags       - From Namespace node for the method/object
341212700Sjkim *              Format          - Printf format string + additional args
342212700Sjkim *
343212700Sjkim * RETURN:      None
344212700Sjkim *
345212700Sjkim * DESCRIPTION: Warnings for the predefined validation module. Messages are
346212700Sjkim *              only emitted the first time a problem with a particular
347212700Sjkim *              method/object is detected. This prevents a flood of error
348212700Sjkim *              messages for methods that are repeatedly evaluated.
349212700Sjkim *
350212700Sjkim ******************************************************************************/
351212700Sjkim
352212700Sjkimvoid ACPI_INTERNAL_VAR_XFACE
353212700SjkimAcpiUtPredefinedWarning (
354212700Sjkim    const char              *ModuleName,
355212700Sjkim    UINT32                  LineNumber,
356212700Sjkim    char                    *Pathname,
357212700Sjkim    UINT8                   NodeFlags,
358212700Sjkim    const char              *Format,
359212700Sjkim    ...)
360212700Sjkim{
361212700Sjkim    va_list                 ArgList;
362212700Sjkim
363212700Sjkim
364212700Sjkim    /*
365212700Sjkim     * Warning messages for this method/object will be disabled after the
366212700Sjkim     * first time a validation fails or an object is successfully repaired.
367212700Sjkim     */
368212700Sjkim    if (NodeFlags & ANOBJ_EVALUATED)
369212700Sjkim    {
370212700Sjkim        return;
371212700Sjkim    }
372212700Sjkim
373212700Sjkim    AcpiOsPrintf (ACPI_MSG_WARNING "For %s: ", Pathname);
374212700Sjkim
375212700Sjkim    va_start (ArgList, Format);
376212700Sjkim    AcpiOsVprintf (Format, ArgList);
377212700Sjkim    ACPI_MSG_SUFFIX;
378212700Sjkim    va_end (ArgList);
379212700Sjkim}
380212700Sjkim
381212700Sjkim
382212700Sjkim/*******************************************************************************
383212700Sjkim *
384212700Sjkim * FUNCTION:    AcpiUtPredefinedInfo
385212700Sjkim *
386212700Sjkim * PARAMETERS:  ModuleName      - Caller's module name (for error output)
387212700Sjkim *              LineNumber      - Caller's line number (for error output)
388212700Sjkim *              Pathname        - Full pathname to the node
389212700Sjkim *              NodeFlags       - From Namespace node for the method/object
390212700Sjkim *              Format          - Printf format string + additional args
391212700Sjkim *
392212700Sjkim * RETURN:      None
393212700Sjkim *
394212700Sjkim * DESCRIPTION: Info messages for the predefined validation module. Messages
395212700Sjkim *              are only emitted the first time a problem with a particular
396212700Sjkim *              method/object is detected. This prevents a flood of
397212700Sjkim *              messages for methods that are repeatedly evaluated.
398212700Sjkim *
399212700Sjkim ******************************************************************************/
400212700Sjkim
401212700Sjkimvoid ACPI_INTERNAL_VAR_XFACE
402212700SjkimAcpiUtPredefinedInfo (
403212700Sjkim    const char              *ModuleName,
404212700Sjkim    UINT32                  LineNumber,
405212700Sjkim    char                    *Pathname,
406212700Sjkim    UINT8                   NodeFlags,
407212700Sjkim    const char              *Format,
408212700Sjkim    ...)
409212700Sjkim{
410212700Sjkim    va_list                 ArgList;
411212700Sjkim
412212700Sjkim
413212700Sjkim    /*
414212700Sjkim     * Warning messages for this method/object will be disabled after the
415212700Sjkim     * first time a validation fails or an object is successfully repaired.
416212700Sjkim     */
417212700Sjkim    if (NodeFlags & ANOBJ_EVALUATED)
418212700Sjkim    {
419212700Sjkim        return;
420212700Sjkim    }
421212700Sjkim
422212700Sjkim    AcpiOsPrintf (ACPI_MSG_INFO "For %s: ", Pathname);
423212700Sjkim
424212700Sjkim    va_start (ArgList, Format);
425212700Sjkim    AcpiOsVprintf (Format, ArgList);
426212700Sjkim    ACPI_MSG_SUFFIX;
427212700Sjkim    va_end (ArgList);
428212700Sjkim}
429212700Sjkim
430212700Sjkim
431212700Sjkim/*******************************************************************************
432212700Sjkim *
433212700Sjkim * FUNCTION:    AcpiUtNamespaceError
434212700Sjkim *
435212700Sjkim * PARAMETERS:  ModuleName          - Caller's module name (for error output)
436212700Sjkim *              LineNumber          - Caller's line number (for error output)
437212700Sjkim *              InternalName        - Name or path of the namespace node
438212700Sjkim *              LookupStatus        - Exception code from NS lookup
439212700Sjkim *
440212700Sjkim * RETURN:      None
441212700Sjkim *
442212700Sjkim * DESCRIPTION: Print error message with the full pathname for the NS node.
443212700Sjkim *
444212700Sjkim ******************************************************************************/
445212700Sjkim
446212700Sjkimvoid
447212700SjkimAcpiUtNamespaceError (
448212700Sjkim    const char              *ModuleName,
449212700Sjkim    UINT32                  LineNumber,
450212700Sjkim    const char              *InternalName,
451212700Sjkim    ACPI_STATUS             LookupStatus)
452212700Sjkim{
453212700Sjkim    ACPI_STATUS             Status;
454212700Sjkim    UINT32                  BadName;
455212700Sjkim    char                    *Name = NULL;
456212700Sjkim
457212700Sjkim
458212700Sjkim    ACPI_MSG_REDIRECT_BEGIN;
459212700Sjkim    AcpiOsPrintf (ACPI_MSG_ERROR);
460212700Sjkim
461212700Sjkim    if (LookupStatus == AE_BAD_CHARACTER)
462212700Sjkim    {
463212700Sjkim        /* There is a non-ascii character in the name */
464212700Sjkim
465212700Sjkim        ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName));
466212700Sjkim        AcpiOsPrintf ("[0x%4.4X] (NON-ASCII)", BadName);
467212700Sjkim    }
468212700Sjkim    else
469212700Sjkim    {
470212700Sjkim        /* Convert path to external format */
471212700Sjkim
472212700Sjkim        Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
473212700Sjkim                    InternalName, NULL, &Name);
474212700Sjkim
475212700Sjkim        /* Print target name */
476212700Sjkim
477212700Sjkim        if (ACPI_SUCCESS (Status))
478212700Sjkim        {
479212700Sjkim            AcpiOsPrintf ("[%s]", Name);
480212700Sjkim        }
481212700Sjkim        else
482212700Sjkim        {
483212700Sjkim            AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]");
484212700Sjkim        }
485212700Sjkim
486212700Sjkim        if (Name)
487212700Sjkim        {
488212700Sjkim            ACPI_FREE (Name);
489212700Sjkim        }
490212700Sjkim    }
491212700Sjkim
492212700Sjkim    AcpiOsPrintf (" Namespace lookup failure, %s",
493212700Sjkim        AcpiFormatException (LookupStatus));
494212700Sjkim
495212700Sjkim    ACPI_MSG_SUFFIX;
496212700Sjkim    ACPI_MSG_REDIRECT_END;
497212700Sjkim}
498212700Sjkim
499212700Sjkim
500212700Sjkim/*******************************************************************************
501212700Sjkim *
502212700Sjkim * FUNCTION:    AcpiUtMethodError
503212700Sjkim *
504212700Sjkim * PARAMETERS:  ModuleName          - Caller's module name (for error output)
505212700Sjkim *              LineNumber          - Caller's line number (for error output)
506212700Sjkim *              Message             - Error message to use on failure
507212700Sjkim *              PrefixNode          - Prefix relative to the path
508212700Sjkim *              Path                - Path to the node (optional)
509212700Sjkim *              MethodStatus        - Execution status
510212700Sjkim *
511212700Sjkim * RETURN:      None
512212700Sjkim *
513212700Sjkim * DESCRIPTION: Print error message with the full pathname for the method.
514212700Sjkim *
515212700Sjkim ******************************************************************************/
516212700Sjkim
517212700Sjkimvoid
518212700SjkimAcpiUtMethodError (
519212700Sjkim    const char              *ModuleName,
520212700Sjkim    UINT32                  LineNumber,
521212700Sjkim    const char              *Message,
522212700Sjkim    ACPI_NAMESPACE_NODE     *PrefixNode,
523212700Sjkim    const char              *Path,
524212700Sjkim    ACPI_STATUS             MethodStatus)
525212700Sjkim{
526212700Sjkim    ACPI_STATUS             Status;
527212700Sjkim    ACPI_NAMESPACE_NODE     *Node = PrefixNode;
528212700Sjkim
529212700Sjkim
530212700Sjkim    ACPI_MSG_REDIRECT_BEGIN;
531212700Sjkim    AcpiOsPrintf (ACPI_MSG_ERROR);
532212700Sjkim
533212700Sjkim    if (Path)
534212700Sjkim    {
535212700Sjkim        Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH,
536212700Sjkim                    &Node);
537212700Sjkim        if (ACPI_FAILURE (Status))
538212700Sjkim        {
539212700Sjkim            AcpiOsPrintf ("[Could not get node by pathname]");
540212700Sjkim        }
541212700Sjkim    }
542212700Sjkim
543212700Sjkim    AcpiNsPrintNodePathname (Node, Message);
544212700Sjkim    AcpiOsPrintf (", %s", AcpiFormatException (MethodStatus));
545212700Sjkim
546212700Sjkim    ACPI_MSG_SUFFIX;
547212700Sjkim    ACPI_MSG_REDIRECT_END;
548212700Sjkim}
549212700Sjkim
550212700Sjkim#endif /* ACPI_NO_ERROR_MESSAGES */
551