1a9d8d09cSJung-uk Kim /*******************************************************************************
2a9d8d09cSJung-uk Kim *
3a9d8d09cSJung-uk Kim * Module Name: uterror - Various internal error/warning output functions
4a9d8d09cSJung-uk Kim *
5a9d8d09cSJung-uk Kim ******************************************************************************/
6a9d8d09cSJung-uk Kim
70d84335fSJung-uk Kim /******************************************************************************
80d84335fSJung-uk Kim *
90d84335fSJung-uk Kim * 1. Copyright Notice
100d84335fSJung-uk Kim *
11*58308fadSJung-uk Kim * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
12a9d8d09cSJung-uk Kim * All rights reserved.
13a9d8d09cSJung-uk Kim *
140d84335fSJung-uk Kim * 2. License
150d84335fSJung-uk Kim *
160d84335fSJung-uk Kim * 2.1. This is your license from Intel Corp. under its intellectual property
170d84335fSJung-uk Kim * rights. You may have additional license terms from the party that provided
180d84335fSJung-uk Kim * you this software, covering your right to use that party's intellectual
190d84335fSJung-uk Kim * property rights.
200d84335fSJung-uk Kim *
210d84335fSJung-uk Kim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
220d84335fSJung-uk Kim * copy of the source code appearing in this file ("Covered Code") an
230d84335fSJung-uk Kim * irrevocable, perpetual, worldwide license under Intel's copyrights in the
240d84335fSJung-uk Kim * base code distributed originally by Intel ("Original Intel Code") to copy,
250d84335fSJung-uk Kim * make derivatives, distribute, use and display any portion of the Covered
260d84335fSJung-uk Kim * Code in any form, with the right to sublicense such rights; and
270d84335fSJung-uk Kim *
280d84335fSJung-uk Kim * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
290d84335fSJung-uk Kim * license (with the right to sublicense), under only those claims of Intel
300d84335fSJung-uk Kim * patents that are infringed by the Original Intel Code, to make, use, sell,
310d84335fSJung-uk Kim * offer to sell, and import the Covered Code and derivative works thereof
320d84335fSJung-uk Kim * solely to the minimum extent necessary to exercise the above copyright
330d84335fSJung-uk Kim * license, and in no event shall the patent license extend to any additions
340d84335fSJung-uk Kim * to or modifications of the Original Intel Code. No other license or right
350d84335fSJung-uk Kim * is granted directly or by implication, estoppel or otherwise;
360d84335fSJung-uk Kim *
370d84335fSJung-uk Kim * The above copyright and patent license is granted only if the following
380d84335fSJung-uk Kim * conditions are met:
390d84335fSJung-uk Kim *
400d84335fSJung-uk Kim * 3. Conditions
410d84335fSJung-uk Kim *
420d84335fSJung-uk Kim * 3.1. Redistribution of Source with Rights to Further Distribute Source.
430d84335fSJung-uk Kim * Redistribution of source code of any substantial portion of the Covered
440d84335fSJung-uk Kim * Code or modification with rights to further distribute source must include
450d84335fSJung-uk Kim * the above Copyright Notice, the above License, this list of Conditions,
460d84335fSJung-uk Kim * and the following Disclaimer and Export Compliance provision. In addition,
470d84335fSJung-uk Kim * Licensee must cause all Covered Code to which Licensee contributes to
480d84335fSJung-uk Kim * contain a file documenting the changes Licensee made to create that Covered
490d84335fSJung-uk Kim * Code and the date of any change. Licensee must include in that file the
500d84335fSJung-uk Kim * documentation of any changes made by any predecessor Licensee. Licensee
510d84335fSJung-uk Kim * must include a prominent statement that the modification is derived,
520d84335fSJung-uk Kim * directly or indirectly, from Original Intel Code.
530d84335fSJung-uk Kim *
540d84335fSJung-uk Kim * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
550d84335fSJung-uk Kim * Redistribution of source code of any substantial portion of the Covered
560d84335fSJung-uk Kim * Code or modification without rights to further distribute source must
570d84335fSJung-uk Kim * include the following Disclaimer and Export Compliance provision in the
580d84335fSJung-uk Kim * documentation and/or other materials provided with distribution. In
590d84335fSJung-uk Kim * addition, Licensee may not authorize further sublicense of source of any
600d84335fSJung-uk Kim * portion of the Covered Code, and must include terms to the effect that the
610d84335fSJung-uk Kim * license from Licensee to its licensee is limited to the intellectual
620d84335fSJung-uk Kim * property embodied in the software Licensee provides to its licensee, and
630d84335fSJung-uk Kim * not to intellectual property embodied in modifications its licensee may
640d84335fSJung-uk Kim * make.
650d84335fSJung-uk Kim *
660d84335fSJung-uk Kim * 3.3. Redistribution of Executable. Redistribution in executable form of any
670d84335fSJung-uk Kim * substantial portion of the Covered Code or modification must reproduce the
680d84335fSJung-uk Kim * above Copyright Notice, and the following Disclaimer and Export Compliance
690d84335fSJung-uk Kim * provision in the documentation and/or other materials provided with the
700d84335fSJung-uk Kim * distribution.
710d84335fSJung-uk Kim *
720d84335fSJung-uk Kim * 3.4. Intel retains all right, title, and interest in and to the Original
730d84335fSJung-uk Kim * Intel Code.
740d84335fSJung-uk Kim *
750d84335fSJung-uk Kim * 3.5. Neither the name Intel nor any other trademark owned or controlled by
760d84335fSJung-uk Kim * Intel shall be used in advertising or otherwise to promote the sale, use or
770d84335fSJung-uk Kim * other dealings in products derived from or relating to the Covered Code
780d84335fSJung-uk Kim * without prior written authorization from Intel.
790d84335fSJung-uk Kim *
800d84335fSJung-uk Kim * 4. Disclaimer and Export Compliance
810d84335fSJung-uk Kim *
820d84335fSJung-uk Kim * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
830d84335fSJung-uk Kim * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
840d84335fSJung-uk Kim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
850d84335fSJung-uk Kim * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
860d84335fSJung-uk Kim * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
870d84335fSJung-uk Kim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
880d84335fSJung-uk Kim * PARTICULAR PURPOSE.
890d84335fSJung-uk Kim *
900d84335fSJung-uk Kim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
910d84335fSJung-uk Kim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
920d84335fSJung-uk Kim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
930d84335fSJung-uk Kim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
940d84335fSJung-uk Kim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
950d84335fSJung-uk Kim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
960d84335fSJung-uk Kim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
970d84335fSJung-uk Kim * LIMITED REMEDY.
980d84335fSJung-uk Kim *
990d84335fSJung-uk Kim * 4.3. Licensee shall not export, either directly or indirectly, any of this
1000d84335fSJung-uk Kim * software or system incorporating such software without first obtaining any
1010d84335fSJung-uk Kim * required license or other approval from the U. S. Department of Commerce or
1020d84335fSJung-uk Kim * any other agency or department of the United States Government. In the
1030d84335fSJung-uk Kim * event Licensee exports any such software from the United States or
1040d84335fSJung-uk Kim * re-exports any such software from a foreign destination, Licensee shall
1050d84335fSJung-uk Kim * ensure that the distribution and export/re-export of the software is in
1060d84335fSJung-uk Kim * compliance with all laws, regulations, orders, or other restrictions of the
1070d84335fSJung-uk Kim * U.S. Export Administration Regulations. Licensee agrees that neither it nor
1080d84335fSJung-uk Kim * any of its subsidiaries will export/re-export any technical data, process,
1090d84335fSJung-uk Kim * software, or service, directly or indirectly, to any country for which the
1100d84335fSJung-uk Kim * United States government or any agency thereof requires an export license,
1110d84335fSJung-uk Kim * other governmental approval, or letter of assurance, without first obtaining
1120d84335fSJung-uk Kim * such license, approval or letter.
1130d84335fSJung-uk Kim *
1140d84335fSJung-uk Kim *****************************************************************************
1150d84335fSJung-uk Kim *
1160d84335fSJung-uk Kim * Alternatively, you may choose to be licensed under the terms of the
1170d84335fSJung-uk Kim * following license:
1180d84335fSJung-uk Kim *
119a9d8d09cSJung-uk Kim * Redistribution and use in source and binary forms, with or without
120a9d8d09cSJung-uk Kim * modification, are permitted provided that the following conditions
121a9d8d09cSJung-uk Kim * are met:
122a9d8d09cSJung-uk Kim * 1. Redistributions of source code must retain the above copyright
123a9d8d09cSJung-uk Kim * notice, this list of conditions, and the following disclaimer,
124a9d8d09cSJung-uk Kim * without modification.
125a9d8d09cSJung-uk Kim * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126a9d8d09cSJung-uk Kim * substantially similar to the "NO WARRANTY" disclaimer below
127a9d8d09cSJung-uk Kim * ("Disclaimer") and any redistribution must be conditioned upon
128a9d8d09cSJung-uk Kim * including a substantially similar Disclaimer requirement for further
129a9d8d09cSJung-uk Kim * binary redistribution.
130a9d8d09cSJung-uk Kim * 3. Neither the names of the above-listed copyright holders nor the names
131a9d8d09cSJung-uk Kim * of any contributors may be used to endorse or promote products derived
132a9d8d09cSJung-uk Kim * from this software without specific prior written permission.
133a9d8d09cSJung-uk Kim *
1340d84335fSJung-uk Kim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1350d84335fSJung-uk Kim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1360d84335fSJung-uk Kim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1370d84335fSJung-uk Kim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1380d84335fSJung-uk Kim * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1390d84335fSJung-uk Kim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1400d84335fSJung-uk Kim * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1410d84335fSJung-uk Kim * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1420d84335fSJung-uk Kim * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1430d84335fSJung-uk Kim * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1440d84335fSJung-uk Kim * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1450d84335fSJung-uk Kim *
1460d84335fSJung-uk Kim * Alternatively, you may choose to be licensed under the terms of the
147a9d8d09cSJung-uk Kim * GNU General Public License ("GPL") version 2 as published by the Free
148a9d8d09cSJung-uk Kim * Software Foundation.
149a9d8d09cSJung-uk Kim *
1500d84335fSJung-uk Kim *****************************************************************************/
151a9d8d09cSJung-uk Kim
152a9d8d09cSJung-uk Kim #include <contrib/dev/acpica/include/acpi.h>
153a9d8d09cSJung-uk Kim #include <contrib/dev/acpica/include/accommon.h>
154a9d8d09cSJung-uk Kim #include <contrib/dev/acpica/include/acnamesp.h>
155a9d8d09cSJung-uk Kim
156a9d8d09cSJung-uk Kim
157a9d8d09cSJung-uk Kim #define _COMPONENT ACPI_UTILITIES
158a9d8d09cSJung-uk Kim ACPI_MODULE_NAME ("uterror")
159a9d8d09cSJung-uk Kim
160a9d8d09cSJung-uk Kim
161a9d8d09cSJung-uk Kim /*
162a9d8d09cSJung-uk Kim * This module contains internal error functions that may
163a9d8d09cSJung-uk Kim * be configured out.
164a9d8d09cSJung-uk Kim */
165a9d8d09cSJung-uk Kim #if !defined (ACPI_NO_ERROR_MESSAGES)
166a9d8d09cSJung-uk Kim
167a9d8d09cSJung-uk Kim /*******************************************************************************
168a9d8d09cSJung-uk Kim *
169a9d8d09cSJung-uk Kim * FUNCTION: AcpiUtPredefinedWarning
170a9d8d09cSJung-uk Kim *
171a9d8d09cSJung-uk Kim * PARAMETERS: ModuleName - Caller's module name (for error output)
172a9d8d09cSJung-uk Kim * LineNumber - Caller's line number (for error output)
173a9d8d09cSJung-uk Kim * Pathname - Full pathname to the node
174a9d8d09cSJung-uk Kim * NodeFlags - From Namespace node for the method/object
175a9d8d09cSJung-uk Kim * Format - Printf format string + additional args
176a9d8d09cSJung-uk Kim *
177a9d8d09cSJung-uk Kim * RETURN: None
178a9d8d09cSJung-uk Kim *
179a9d8d09cSJung-uk Kim * DESCRIPTION: Warnings for the predefined validation module. Messages are
180a9d8d09cSJung-uk Kim * only emitted the first time a problem with a particular
181a9d8d09cSJung-uk Kim * method/object is detected. This prevents a flood of error
182a9d8d09cSJung-uk Kim * messages for methods that are repeatedly evaluated.
183a9d8d09cSJung-uk Kim *
184a9d8d09cSJung-uk Kim ******************************************************************************/
185a9d8d09cSJung-uk Kim
186a9d8d09cSJung-uk Kim void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedWarning(const char * ModuleName,UINT32 LineNumber,char * Pathname,UINT16 NodeFlags,const char * Format,...)187a9d8d09cSJung-uk Kim AcpiUtPredefinedWarning (
188a9d8d09cSJung-uk Kim const char *ModuleName,
189a9d8d09cSJung-uk Kim UINT32 LineNumber,
190a9d8d09cSJung-uk Kim char *Pathname,
191a009b7dcSJung-uk Kim UINT16 NodeFlags,
192a9d8d09cSJung-uk Kim const char *Format,
193a9d8d09cSJung-uk Kim ...)
194a9d8d09cSJung-uk Kim {
195a9d8d09cSJung-uk Kim va_list ArgList;
196a9d8d09cSJung-uk Kim
197a9d8d09cSJung-uk Kim
198a9d8d09cSJung-uk Kim /*
199a9d8d09cSJung-uk Kim * Warning messages for this method/object will be disabled after the
200a9d8d09cSJung-uk Kim * first time a validation fails or an object is successfully repaired.
201a9d8d09cSJung-uk Kim */
202a9d8d09cSJung-uk Kim if (NodeFlags & ANOBJ_EVALUATED)
203a9d8d09cSJung-uk Kim {
204a9d8d09cSJung-uk Kim return;
205a9d8d09cSJung-uk Kim }
206a9d8d09cSJung-uk Kim
207a9d8d09cSJung-uk Kim AcpiOsPrintf (ACPI_MSG_WARNING "%s: ", Pathname);
208a9d8d09cSJung-uk Kim
209a9d8d09cSJung-uk Kim va_start (ArgList, Format);
210a9d8d09cSJung-uk Kim AcpiOsVprintf (Format, ArgList);
211a9d8d09cSJung-uk Kim ACPI_MSG_SUFFIX;
212a9d8d09cSJung-uk Kim va_end (ArgList);
213a9d8d09cSJung-uk Kim }
214a9d8d09cSJung-uk Kim
215a9d8d09cSJung-uk Kim
216a9d8d09cSJung-uk Kim /*******************************************************************************
217a9d8d09cSJung-uk Kim *
218a9d8d09cSJung-uk Kim * FUNCTION: AcpiUtPredefinedInfo
219a9d8d09cSJung-uk Kim *
220a9d8d09cSJung-uk Kim * PARAMETERS: ModuleName - Caller's module name (for error output)
221a9d8d09cSJung-uk Kim * LineNumber - Caller's line number (for error output)
222a9d8d09cSJung-uk Kim * Pathname - Full pathname to the node
223a9d8d09cSJung-uk Kim * NodeFlags - From Namespace node for the method/object
224a9d8d09cSJung-uk Kim * Format - Printf format string + additional args
225a9d8d09cSJung-uk Kim *
226a9d8d09cSJung-uk Kim * RETURN: None
227a9d8d09cSJung-uk Kim *
228a9d8d09cSJung-uk Kim * DESCRIPTION: Info messages for the predefined validation module. Messages
229a9d8d09cSJung-uk Kim * are only emitted the first time a problem with a particular
230a9d8d09cSJung-uk Kim * method/object is detected. This prevents a flood of
231a9d8d09cSJung-uk Kim * messages for methods that are repeatedly evaluated.
232a9d8d09cSJung-uk Kim *
233a9d8d09cSJung-uk Kim ******************************************************************************/
234a9d8d09cSJung-uk Kim
235a9d8d09cSJung-uk Kim void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedInfo(const char * ModuleName,UINT32 LineNumber,char * Pathname,UINT16 NodeFlags,const char * Format,...)236a9d8d09cSJung-uk Kim AcpiUtPredefinedInfo (
237a9d8d09cSJung-uk Kim const char *ModuleName,
238a9d8d09cSJung-uk Kim UINT32 LineNumber,
239a9d8d09cSJung-uk Kim char *Pathname,
240a009b7dcSJung-uk Kim UINT16 NodeFlags,
241a9d8d09cSJung-uk Kim const char *Format,
242a9d8d09cSJung-uk Kim ...)
243a9d8d09cSJung-uk Kim {
244a9d8d09cSJung-uk Kim va_list ArgList;
245a9d8d09cSJung-uk Kim
246a9d8d09cSJung-uk Kim
247a9d8d09cSJung-uk Kim /*
248a9d8d09cSJung-uk Kim * Warning messages for this method/object will be disabled after the
249a9d8d09cSJung-uk Kim * first time a validation fails or an object is successfully repaired.
250a9d8d09cSJung-uk Kim */
251a9d8d09cSJung-uk Kim if (NodeFlags & ANOBJ_EVALUATED)
252a9d8d09cSJung-uk Kim {
253a9d8d09cSJung-uk Kim return;
254a9d8d09cSJung-uk Kim }
255a9d8d09cSJung-uk Kim
256a9d8d09cSJung-uk Kim AcpiOsPrintf (ACPI_MSG_INFO "%s: ", Pathname);
257a9d8d09cSJung-uk Kim
258a9d8d09cSJung-uk Kim va_start (ArgList, Format);
259a9d8d09cSJung-uk Kim AcpiOsVprintf (Format, ArgList);
260a9d8d09cSJung-uk Kim ACPI_MSG_SUFFIX;
261a9d8d09cSJung-uk Kim va_end (ArgList);
262a9d8d09cSJung-uk Kim }
263a9d8d09cSJung-uk Kim
264a9d8d09cSJung-uk Kim
265a9d8d09cSJung-uk Kim /*******************************************************************************
266a9d8d09cSJung-uk Kim *
267a9d8d09cSJung-uk Kim * FUNCTION: AcpiUtPredefinedBiosError
268a9d8d09cSJung-uk Kim *
269a9d8d09cSJung-uk Kim * PARAMETERS: ModuleName - Caller's module name (for error output)
270a9d8d09cSJung-uk Kim * LineNumber - Caller's line number (for error output)
271a9d8d09cSJung-uk Kim * Pathname - Full pathname to the node
272a9d8d09cSJung-uk Kim * NodeFlags - From Namespace node for the method/object
273a9d8d09cSJung-uk Kim * Format - Printf format string + additional args
274a9d8d09cSJung-uk Kim *
275a9d8d09cSJung-uk Kim * RETURN: None
276a9d8d09cSJung-uk Kim *
277a9d8d09cSJung-uk Kim * DESCRIPTION: BIOS error message for predefined names. Messages
278a9d8d09cSJung-uk Kim * are only emitted the first time a problem with a particular
279a9d8d09cSJung-uk Kim * method/object is detected. This prevents a flood of
280a9d8d09cSJung-uk Kim * messages for methods that are repeatedly evaluated.
281a9d8d09cSJung-uk Kim *
282a9d8d09cSJung-uk Kim ******************************************************************************/
283a9d8d09cSJung-uk Kim
284a9d8d09cSJung-uk Kim void ACPI_INTERNAL_VAR_XFACE
AcpiUtPredefinedBiosError(const char * ModuleName,UINT32 LineNumber,char * Pathname,UINT16 NodeFlags,const char * Format,...)285a9d8d09cSJung-uk Kim AcpiUtPredefinedBiosError (
286a9d8d09cSJung-uk Kim const char *ModuleName,
287a9d8d09cSJung-uk Kim UINT32 LineNumber,
288a9d8d09cSJung-uk Kim char *Pathname,
289a009b7dcSJung-uk Kim UINT16 NodeFlags,
290a9d8d09cSJung-uk Kim const char *Format,
291a9d8d09cSJung-uk Kim ...)
292a9d8d09cSJung-uk Kim {
293a9d8d09cSJung-uk Kim va_list ArgList;
294a9d8d09cSJung-uk Kim
295a9d8d09cSJung-uk Kim
296a9d8d09cSJung-uk Kim /*
297a9d8d09cSJung-uk Kim * Warning messages for this method/object will be disabled after the
298a9d8d09cSJung-uk Kim * first time a validation fails or an object is successfully repaired.
299a9d8d09cSJung-uk Kim */
300a9d8d09cSJung-uk Kim if (NodeFlags & ANOBJ_EVALUATED)
301a9d8d09cSJung-uk Kim {
302a9d8d09cSJung-uk Kim return;
303a9d8d09cSJung-uk Kim }
304a9d8d09cSJung-uk Kim
305a9d8d09cSJung-uk Kim AcpiOsPrintf (ACPI_MSG_BIOS_ERROR "%s: ", Pathname);
306a9d8d09cSJung-uk Kim
307a9d8d09cSJung-uk Kim va_start (ArgList, Format);
308a9d8d09cSJung-uk Kim AcpiOsVprintf (Format, ArgList);
309a9d8d09cSJung-uk Kim ACPI_MSG_SUFFIX;
310a9d8d09cSJung-uk Kim va_end (ArgList);
311a9d8d09cSJung-uk Kim }
312a9d8d09cSJung-uk Kim
313a9d8d09cSJung-uk Kim
314a9d8d09cSJung-uk Kim /*******************************************************************************
315a9d8d09cSJung-uk Kim *
316b7b7e711SJung-uk Kim * FUNCTION: AcpiUtPrefixedNamespaceError
317b7b7e711SJung-uk Kim *
318b7b7e711SJung-uk Kim * PARAMETERS: ModuleName - Caller's module name (for error output)
319b7b7e711SJung-uk Kim * LineNumber - Caller's line number (for error output)
320b7b7e711SJung-uk Kim * PrefixScope - Scope/Path that prefixes the internal path
321b7b7e711SJung-uk Kim * InternalPath - Name or path of the namespace node
322b7b7e711SJung-uk Kim * LookupStatus - Exception code from NS lookup
323b7b7e711SJung-uk Kim *
324b7b7e711SJung-uk Kim * RETURN: None
325b7b7e711SJung-uk Kim *
326b7b7e711SJung-uk Kim * DESCRIPTION: Print error message with the full pathname constructed this way:
327b7b7e711SJung-uk Kim *
328b7b7e711SJung-uk Kim * PrefixScopeNodeFullPath.ExternalizedInternalPath
329b7b7e711SJung-uk Kim *
330b7b7e711SJung-uk Kim * NOTE: 10/2017: Treat the major NsLookup errors as firmware errors
331b7b7e711SJung-uk Kim *
332b7b7e711SJung-uk Kim ******************************************************************************/
333b7b7e711SJung-uk Kim
334b7b7e711SJung-uk Kim void
AcpiUtPrefixedNamespaceError(const char * ModuleName,UINT32 LineNumber,ACPI_GENERIC_STATE * PrefixScope,const char * InternalPath,ACPI_STATUS LookupStatus)335b7b7e711SJung-uk Kim AcpiUtPrefixedNamespaceError (
336b7b7e711SJung-uk Kim const char *ModuleName,
337b7b7e711SJung-uk Kim UINT32 LineNumber,
338b7b7e711SJung-uk Kim ACPI_GENERIC_STATE *PrefixScope,
339b7b7e711SJung-uk Kim const char *InternalPath,
340b7b7e711SJung-uk Kim ACPI_STATUS LookupStatus)
341b7b7e711SJung-uk Kim {
342b7b7e711SJung-uk Kim char *FullPath;
343b7b7e711SJung-uk Kim const char *Message;
344b7b7e711SJung-uk Kim
345b7b7e711SJung-uk Kim
346b7b7e711SJung-uk Kim /*
347b7b7e711SJung-uk Kim * Main cases:
348b7b7e711SJung-uk Kim * 1) Object creation, object must not already exist
349b7b7e711SJung-uk Kim * 2) Object lookup, object must exist
350b7b7e711SJung-uk Kim */
351b7b7e711SJung-uk Kim switch (LookupStatus)
352b7b7e711SJung-uk Kim {
353b7b7e711SJung-uk Kim case AE_ALREADY_EXISTS:
354b7b7e711SJung-uk Kim
35551f42badSJung-uk Kim AcpiOsPrintf (ACPI_MSG_BIOS_ERROR);
356cd6518c7SJung-uk Kim Message = "Failure creating named object";
357b7b7e711SJung-uk Kim break;
358b7b7e711SJung-uk Kim
359b7b7e711SJung-uk Kim case AE_NOT_FOUND:
360b7b7e711SJung-uk Kim
36151f42badSJung-uk Kim AcpiOsPrintf (ACPI_MSG_BIOS_ERROR);
362cd6518c7SJung-uk Kim Message = "Could not resolve symbol";
363b7b7e711SJung-uk Kim break;
364b7b7e711SJung-uk Kim
365b7b7e711SJung-uk Kim default:
366b7b7e711SJung-uk Kim
36751f42badSJung-uk Kim AcpiOsPrintf (ACPI_MSG_ERROR);
368cd6518c7SJung-uk Kim Message = "Failure resolving symbol";
369b7b7e711SJung-uk Kim break;
370b7b7e711SJung-uk Kim }
371b7b7e711SJung-uk Kim
372b7b7e711SJung-uk Kim /* Concatenate the prefix path and the internal path */
373b7b7e711SJung-uk Kim
374b7b7e711SJung-uk Kim FullPath = AcpiNsBuildPrefixedPathname (PrefixScope, InternalPath);
375b7b7e711SJung-uk Kim
376b7b7e711SJung-uk Kim AcpiOsPrintf ("%s [%s], %s", Message,
377b7b7e711SJung-uk Kim FullPath ? FullPath : "Could not get pathname",
378b7b7e711SJung-uk Kim AcpiFormatException (LookupStatus));
379b7b7e711SJung-uk Kim
380b7b7e711SJung-uk Kim if (FullPath)
381b7b7e711SJung-uk Kim {
382b7b7e711SJung-uk Kim ACPI_FREE (FullPath);
383b7b7e711SJung-uk Kim }
384b7b7e711SJung-uk Kim
385b7b7e711SJung-uk Kim ACPI_MSG_SUFFIX;
386b7b7e711SJung-uk Kim }
387b7b7e711SJung-uk Kim
388b7b7e711SJung-uk Kim
389b7b7e711SJung-uk Kim #ifdef __OBSOLETE_FUNCTION
390b7b7e711SJung-uk Kim /*******************************************************************************
391b7b7e711SJung-uk Kim *
392a9d8d09cSJung-uk Kim * FUNCTION: AcpiUtNamespaceError
393a9d8d09cSJung-uk Kim *
394a9d8d09cSJung-uk Kim * PARAMETERS: ModuleName - Caller's module name (for error output)
395a9d8d09cSJung-uk Kim * LineNumber - Caller's line number (for error output)
396a9d8d09cSJung-uk Kim * InternalName - Name or path of the namespace node
397a9d8d09cSJung-uk Kim * LookupStatus - Exception code from NS lookup
398a9d8d09cSJung-uk Kim *
399a9d8d09cSJung-uk Kim * RETURN: None
400a9d8d09cSJung-uk Kim *
401a9d8d09cSJung-uk Kim * DESCRIPTION: Print error message with the full pathname for the NS node.
402a9d8d09cSJung-uk Kim *
403a9d8d09cSJung-uk Kim ******************************************************************************/
404a9d8d09cSJung-uk Kim
405a9d8d09cSJung-uk Kim void
AcpiUtNamespaceError(const char * ModuleName,UINT32 LineNumber,const char * InternalName,ACPI_STATUS LookupStatus)406a9d8d09cSJung-uk Kim AcpiUtNamespaceError (
407a9d8d09cSJung-uk Kim const char *ModuleName,
408a9d8d09cSJung-uk Kim UINT32 LineNumber,
409a9d8d09cSJung-uk Kim const char *InternalName,
410a9d8d09cSJung-uk Kim ACPI_STATUS LookupStatus)
411a9d8d09cSJung-uk Kim {
412a9d8d09cSJung-uk Kim ACPI_STATUS Status;
413a9d8d09cSJung-uk Kim UINT32 BadName;
414a9d8d09cSJung-uk Kim char *Name = NULL;
415a9d8d09cSJung-uk Kim
416a9d8d09cSJung-uk Kim
417a9d8d09cSJung-uk Kim ACPI_MSG_REDIRECT_BEGIN;
418a9d8d09cSJung-uk Kim AcpiOsPrintf (ACPI_MSG_ERROR);
419a9d8d09cSJung-uk Kim
420a9d8d09cSJung-uk Kim if (LookupStatus == AE_BAD_CHARACTER)
421a9d8d09cSJung-uk Kim {
422a9d8d09cSJung-uk Kim /* There is a non-ascii character in the name */
423a9d8d09cSJung-uk Kim
424a9d8d09cSJung-uk Kim ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName));
425a9d8d09cSJung-uk Kim AcpiOsPrintf ("[0x%.8X] (NON-ASCII)", BadName);
426a9d8d09cSJung-uk Kim }
427a9d8d09cSJung-uk Kim else
428a9d8d09cSJung-uk Kim {
429a9d8d09cSJung-uk Kim /* Convert path to external format */
430a9d8d09cSJung-uk Kim
431f8146b88SJung-uk Kim Status = AcpiNsExternalizeName (
432f8146b88SJung-uk Kim ACPI_UINT32_MAX, InternalName, NULL, &Name);
433a9d8d09cSJung-uk Kim
434a9d8d09cSJung-uk Kim /* Print target name */
435a9d8d09cSJung-uk Kim
436a9d8d09cSJung-uk Kim if (ACPI_SUCCESS (Status))
437a9d8d09cSJung-uk Kim {
438a9d8d09cSJung-uk Kim AcpiOsPrintf ("[%s]", Name);
439a9d8d09cSJung-uk Kim }
440a9d8d09cSJung-uk Kim else
441a9d8d09cSJung-uk Kim {
442a9d8d09cSJung-uk Kim AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]");
443a9d8d09cSJung-uk Kim }
444a9d8d09cSJung-uk Kim
445a9d8d09cSJung-uk Kim if (Name)
446a9d8d09cSJung-uk Kim {
447a9d8d09cSJung-uk Kim ACPI_FREE (Name);
448a9d8d09cSJung-uk Kim }
449a9d8d09cSJung-uk Kim }
450a9d8d09cSJung-uk Kim
451a9d8d09cSJung-uk Kim AcpiOsPrintf (" Namespace lookup failure, %s",
452a9d8d09cSJung-uk Kim AcpiFormatException (LookupStatus));
453a9d8d09cSJung-uk Kim
454a9d8d09cSJung-uk Kim ACPI_MSG_SUFFIX;
455a9d8d09cSJung-uk Kim ACPI_MSG_REDIRECT_END;
456a9d8d09cSJung-uk Kim }
457b7b7e711SJung-uk Kim #endif
458a9d8d09cSJung-uk Kim
459a9d8d09cSJung-uk Kim /*******************************************************************************
460a9d8d09cSJung-uk Kim *
461a9d8d09cSJung-uk Kim * FUNCTION: AcpiUtMethodError
462a9d8d09cSJung-uk Kim *
463a9d8d09cSJung-uk Kim * PARAMETERS: ModuleName - Caller's module name (for error output)
464a9d8d09cSJung-uk Kim * LineNumber - Caller's line number (for error output)
465a9d8d09cSJung-uk Kim * Message - Error message to use on failure
466a9d8d09cSJung-uk Kim * PrefixNode - Prefix relative to the path
467a9d8d09cSJung-uk Kim * Path - Path to the node (optional)
468a9d8d09cSJung-uk Kim * MethodStatus - Execution status
469a9d8d09cSJung-uk Kim *
470a9d8d09cSJung-uk Kim * RETURN: None
471a9d8d09cSJung-uk Kim *
472a9d8d09cSJung-uk Kim * DESCRIPTION: Print error message with the full pathname for the method.
473a9d8d09cSJung-uk Kim *
474a9d8d09cSJung-uk Kim ******************************************************************************/
475a9d8d09cSJung-uk Kim
476a9d8d09cSJung-uk Kim void
AcpiUtMethodError(const char * ModuleName,UINT32 LineNumber,const char * Message,ACPI_NAMESPACE_NODE * PrefixNode,const char * Path,ACPI_STATUS MethodStatus)477a9d8d09cSJung-uk Kim AcpiUtMethodError (
478a9d8d09cSJung-uk Kim const char *ModuleName,
479a9d8d09cSJung-uk Kim UINT32 LineNumber,
480a9d8d09cSJung-uk Kim const char *Message,
481a9d8d09cSJung-uk Kim ACPI_NAMESPACE_NODE *PrefixNode,
482a9d8d09cSJung-uk Kim const char *Path,
483a9d8d09cSJung-uk Kim ACPI_STATUS MethodStatus)
484a9d8d09cSJung-uk Kim {
485a9d8d09cSJung-uk Kim ACPI_STATUS Status;
486a9d8d09cSJung-uk Kim ACPI_NAMESPACE_NODE *Node = PrefixNode;
487a9d8d09cSJung-uk Kim
488a9d8d09cSJung-uk Kim
489a9d8d09cSJung-uk Kim ACPI_MSG_REDIRECT_BEGIN;
490a9d8d09cSJung-uk Kim AcpiOsPrintf (ACPI_MSG_ERROR);
491a9d8d09cSJung-uk Kim
492a9d8d09cSJung-uk Kim if (Path)
493a9d8d09cSJung-uk Kim {
494f8146b88SJung-uk Kim Status = AcpiNsGetNode (PrefixNode, Path,
495f8146b88SJung-uk Kim ACPI_NS_NO_UPSEARCH, &Node);
496a9d8d09cSJung-uk Kim if (ACPI_FAILURE (Status))
497a9d8d09cSJung-uk Kim {
498a9d8d09cSJung-uk Kim AcpiOsPrintf ("[Could not get node by pathname]");
499a9d8d09cSJung-uk Kim }
500a9d8d09cSJung-uk Kim }
501a9d8d09cSJung-uk Kim
502a9d8d09cSJung-uk Kim AcpiNsPrintNodePathname (Node, Message);
503cd6518c7SJung-uk Kim AcpiOsPrintf (" due to previous error (%s)",
504cd6518c7SJung-uk Kim AcpiFormatException (MethodStatus));
505a9d8d09cSJung-uk Kim
506a9d8d09cSJung-uk Kim ACPI_MSG_SUFFIX;
507a9d8d09cSJung-uk Kim ACPI_MSG_REDIRECT_END;
508a9d8d09cSJung-uk Kim }
509a9d8d09cSJung-uk Kim
510a9d8d09cSJung-uk Kim #endif /* ACPI_NO_ERROR_MESSAGES */
511