xref: /freebsd/sys/contrib/dev/acpica/include/acoutput.h (revision a88e22b7ad0a8400875be9c3d02d09d0a8010b9c)
1a9f12690SJung-uk Kim /******************************************************************************
2a9f12690SJung-uk Kim  *
3a9f12690SJung-uk Kim  * Name: acoutput.h -- debug output
4a9f12690SJung-uk Kim  *
5a9f12690SJung-uk Kim  *****************************************************************************/
6a9f12690SJung-uk Kim 
7a9f12690SJung-uk Kim /******************************************************************************
8a9f12690SJung-uk Kim  *
9a9f12690SJung-uk Kim  * 1. Copyright Notice
10a9f12690SJung-uk Kim  *
119a179dd8SJung-uk Kim  * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
12a9f12690SJung-uk Kim  * All rights reserved.
13a9f12690SJung-uk Kim  *
14a9f12690SJung-uk Kim  * 2. License
15a9f12690SJung-uk Kim  *
16a9f12690SJung-uk Kim  * 2.1. This is your license from Intel Corp. under its intellectual property
17a9f12690SJung-uk Kim  * rights.  You may have additional license terms from the party that provided
18a9f12690SJung-uk Kim  * you this software, covering your right to use that party's intellectual
19a9f12690SJung-uk Kim  * property rights.
20a9f12690SJung-uk Kim  *
21a9f12690SJung-uk Kim  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22a9f12690SJung-uk Kim  * copy of the source code appearing in this file ("Covered Code") an
23a9f12690SJung-uk Kim  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24a9f12690SJung-uk Kim  * base code distributed originally by Intel ("Original Intel Code") to copy,
25a9f12690SJung-uk Kim  * make derivatives, distribute, use and display any portion of the Covered
26a9f12690SJung-uk Kim  * Code in any form, with the right to sublicense such rights; and
27a9f12690SJung-uk Kim  *
28a9f12690SJung-uk Kim  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29a9f12690SJung-uk Kim  * license (with the right to sublicense), under only those claims of Intel
30a9f12690SJung-uk Kim  * patents that are infringed by the Original Intel Code, to make, use, sell,
31a9f12690SJung-uk Kim  * offer to sell, and import the Covered Code and derivative works thereof
32a9f12690SJung-uk Kim  * solely to the minimum extent necessary to exercise the above copyright
33a9f12690SJung-uk Kim  * license, and in no event shall the patent license extend to any additions
34a9f12690SJung-uk Kim  * to or modifications of the Original Intel Code.  No other license or right
35a9f12690SJung-uk Kim  * is granted directly or by implication, estoppel or otherwise;
36a9f12690SJung-uk Kim  *
37a9f12690SJung-uk Kim  * The above copyright and patent license is granted only if the following
38a9f12690SJung-uk Kim  * conditions are met:
39a9f12690SJung-uk Kim  *
40a9f12690SJung-uk Kim  * 3. Conditions
41a9f12690SJung-uk Kim  *
42a9f12690SJung-uk Kim  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43a9f12690SJung-uk Kim  * Redistribution of source code of any substantial portion of the Covered
44a9f12690SJung-uk Kim  * Code or modification with rights to further distribute source must include
45a9f12690SJung-uk Kim  * the above Copyright Notice, the above License, this list of Conditions,
46a9f12690SJung-uk Kim  * and the following Disclaimer and Export Compliance provision.  In addition,
47a9f12690SJung-uk Kim  * Licensee must cause all Covered Code to which Licensee contributes to
48a9f12690SJung-uk Kim  * contain a file documenting the changes Licensee made to create that Covered
49a9f12690SJung-uk Kim  * Code and the date of any change.  Licensee must include in that file the
50a9f12690SJung-uk Kim  * documentation of any changes made by any predecessor Licensee.  Licensee
51a9f12690SJung-uk Kim  * must include a prominent statement that the modification is derived,
52a9f12690SJung-uk Kim  * directly or indirectly, from Original Intel Code.
53a9f12690SJung-uk Kim  *
54a9f12690SJung-uk Kim  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55a9f12690SJung-uk Kim  * Redistribution of source code of any substantial portion of the Covered
56a9f12690SJung-uk Kim  * Code or modification without rights to further distribute source must
57a9f12690SJung-uk Kim  * include the following Disclaimer and Export Compliance provision in the
58a9f12690SJung-uk Kim  * documentation and/or other materials provided with distribution.  In
59a9f12690SJung-uk Kim  * addition, Licensee may not authorize further sublicense of source of any
60a9f12690SJung-uk Kim  * portion of the Covered Code, and must include terms to the effect that the
61a9f12690SJung-uk Kim  * license from Licensee to its licensee is limited to the intellectual
62a9f12690SJung-uk Kim  * property embodied in the software Licensee provides to its licensee, and
63a9f12690SJung-uk Kim  * not to intellectual property embodied in modifications its licensee may
64a9f12690SJung-uk Kim  * make.
65a9f12690SJung-uk Kim  *
66a9f12690SJung-uk Kim  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67a9f12690SJung-uk Kim  * substantial portion of the Covered Code or modification must reproduce the
68a9f12690SJung-uk Kim  * above Copyright Notice, and the following Disclaimer and Export Compliance
69a9f12690SJung-uk Kim  * provision in the documentation and/or other materials provided with the
70a9f12690SJung-uk Kim  * distribution.
71a9f12690SJung-uk Kim  *
72a9f12690SJung-uk Kim  * 3.4. Intel retains all right, title, and interest in and to the Original
73a9f12690SJung-uk Kim  * Intel Code.
74a9f12690SJung-uk Kim  *
75a9f12690SJung-uk Kim  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76a9f12690SJung-uk Kim  * Intel shall be used in advertising or otherwise to promote the sale, use or
77a9f12690SJung-uk Kim  * other dealings in products derived from or relating to the Covered Code
78a9f12690SJung-uk Kim  * without prior written authorization from Intel.
79a9f12690SJung-uk Kim  *
80a9f12690SJung-uk Kim  * 4. Disclaimer and Export Compliance
81a9f12690SJung-uk Kim  *
82a9f12690SJung-uk Kim  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83a9f12690SJung-uk Kim  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84a9f12690SJung-uk Kim  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
85a9f12690SJung-uk Kim  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
86a9f12690SJung-uk Kim  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
87a9f12690SJung-uk Kim  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88a9f12690SJung-uk Kim  * PARTICULAR PURPOSE.
89a9f12690SJung-uk Kim  *
90a9f12690SJung-uk Kim  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91a9f12690SJung-uk Kim  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92a9f12690SJung-uk Kim  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93a9f12690SJung-uk Kim  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94a9f12690SJung-uk Kim  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95a9f12690SJung-uk Kim  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
96a9f12690SJung-uk Kim  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97a9f12690SJung-uk Kim  * LIMITED REMEDY.
98a9f12690SJung-uk Kim  *
99a9f12690SJung-uk Kim  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100a9f12690SJung-uk Kim  * software or system incorporating such software without first obtaining any
101a9f12690SJung-uk Kim  * required license or other approval from the U. S. Department of Commerce or
102a9f12690SJung-uk Kim  * any other agency or department of the United States Government.  In the
103a9f12690SJung-uk Kim  * event Licensee exports any such software from the United States or
104a9f12690SJung-uk Kim  * re-exports any such software from a foreign destination, Licensee shall
105a9f12690SJung-uk Kim  * ensure that the distribution and export/re-export of the software is in
106a9f12690SJung-uk Kim  * compliance with all laws, regulations, orders, or other restrictions of the
107a9f12690SJung-uk Kim  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108a9f12690SJung-uk Kim  * any of its subsidiaries will export/re-export any technical data, process,
109a9f12690SJung-uk Kim  * software, or service, directly or indirectly, to any country for which the
110a9f12690SJung-uk Kim  * United States government or any agency thereof requires an export license,
111a9f12690SJung-uk Kim  * other governmental approval, or letter of assurance, without first obtaining
112a9f12690SJung-uk Kim  * such license, approval or letter.
113a9f12690SJung-uk Kim  *
114a9f12690SJung-uk Kim  *****************************************************************************/
115a9f12690SJung-uk Kim 
116a9f12690SJung-uk Kim #ifndef __ACOUTPUT_H__
117a9f12690SJung-uk Kim #define __ACOUTPUT_H__
118a9f12690SJung-uk Kim 
119a9f12690SJung-uk Kim /*
120a9f12690SJung-uk Kim  * Debug levels and component IDs. These are used to control the
121a9f12690SJung-uk Kim  * granularity of the output of the ACPI_DEBUG_PRINT macro -- on a
122a9f12690SJung-uk Kim  * per-component basis and a per-exception-type basis.
123a9f12690SJung-uk Kim  */
124a9f12690SJung-uk Kim 
125a9f12690SJung-uk Kim /* Component IDs are used in the global "DebugLayer" */
126a9f12690SJung-uk Kim 
127a9f12690SJung-uk Kim #define ACPI_UTILITIES              0x00000001
128a9f12690SJung-uk Kim #define ACPI_HARDWARE               0x00000002
129a9f12690SJung-uk Kim #define ACPI_EVENTS                 0x00000004
130a9f12690SJung-uk Kim #define ACPI_TABLES                 0x00000008
131a9f12690SJung-uk Kim #define ACPI_NAMESPACE              0x00000010
132a9f12690SJung-uk Kim #define ACPI_PARSER                 0x00000020
133a9f12690SJung-uk Kim #define ACPI_DISPATCHER             0x00000040
134a9f12690SJung-uk Kim #define ACPI_EXECUTER               0x00000080
135a9f12690SJung-uk Kim #define ACPI_RESOURCES              0x00000100
136a9f12690SJung-uk Kim #define ACPI_CA_DEBUGGER            0x00000200
137a9f12690SJung-uk Kim #define ACPI_OS_SERVICES            0x00000400
138a9f12690SJung-uk Kim #define ACPI_CA_DISASSEMBLER        0x00000800
139a9f12690SJung-uk Kim 
140a9f12690SJung-uk Kim /* Component IDs for ACPI tools and utilities */
141a9f12690SJung-uk Kim 
142a9f12690SJung-uk Kim #define ACPI_COMPILER               0x00001000
143a9f12690SJung-uk Kim #define ACPI_TOOLS                  0x00002000
144a9f12690SJung-uk Kim #define ACPI_EXAMPLE                0x00004000
145a9f12690SJung-uk Kim #define ACPI_DRIVER                 0x00008000
146*a88e22b7SJung-uk Kim #define DT_COMPILER                 0x00010000
147a9f12690SJung-uk Kim 
148*a88e22b7SJung-uk Kim #define ACPI_ALL_COMPONENTS         0x0001FFFF
149a9f12690SJung-uk Kim #define ACPI_COMPONENT_DEFAULT      (ACPI_ALL_COMPONENTS)
150a9f12690SJung-uk Kim 
151a9f12690SJung-uk Kim /* Component IDs reserved for ACPI drivers */
152a9f12690SJung-uk Kim 
153a9f12690SJung-uk Kim #define ACPI_ALL_DRIVERS            0xFFFF0000
154a9f12690SJung-uk Kim 
155a9f12690SJung-uk Kim 
156a9f12690SJung-uk Kim /*
157a9f12690SJung-uk Kim  * Raw debug output levels, do not use these in the ACPI_DEBUG_PRINT macros
158a9f12690SJung-uk Kim  */
159a9f12690SJung-uk Kim #define ACPI_LV_INIT                0x00000001
160a9f12690SJung-uk Kim #define ACPI_LV_DEBUG_OBJECT        0x00000002
161a9f12690SJung-uk Kim #define ACPI_LV_INFO                0x00000004
162572c8255SJung-uk Kim #define ACPI_LV_REPAIR              0x00000008
163572c8255SJung-uk Kim #define ACPI_LV_ALL_EXCEPTIONS      0x0000000F
164a9f12690SJung-uk Kim 
165a9f12690SJung-uk Kim /* Trace verbosity level 1 [Standard Trace Level] */
166a9f12690SJung-uk Kim 
167a9f12690SJung-uk Kim #define ACPI_LV_INIT_NAMES          0x00000020
168a9f12690SJung-uk Kim #define ACPI_LV_PARSE               0x00000040
169a9f12690SJung-uk Kim #define ACPI_LV_LOAD                0x00000080
170a9f12690SJung-uk Kim #define ACPI_LV_DISPATCH            0x00000100
171a9f12690SJung-uk Kim #define ACPI_LV_EXEC                0x00000200
172a9f12690SJung-uk Kim #define ACPI_LV_NAMES               0x00000400
173a9f12690SJung-uk Kim #define ACPI_LV_OPREGION            0x00000800
174a9f12690SJung-uk Kim #define ACPI_LV_BFIELD              0x00001000
175a9f12690SJung-uk Kim #define ACPI_LV_TABLES              0x00002000
176a9f12690SJung-uk Kim #define ACPI_LV_VALUES              0x00004000
177a9f12690SJung-uk Kim #define ACPI_LV_OBJECTS             0x00008000
178a9f12690SJung-uk Kim #define ACPI_LV_RESOURCES           0x00010000
179a9f12690SJung-uk Kim #define ACPI_LV_USER_REQUESTS       0x00020000
180a9f12690SJung-uk Kim #define ACPI_LV_PACKAGE             0x00040000
181a9f12690SJung-uk Kim #define ACPI_LV_VERBOSITY1          0x0007FF40 | ACPI_LV_ALL_EXCEPTIONS
182a9f12690SJung-uk Kim 
183a9f12690SJung-uk Kim /* Trace verbosity level 2 [Function tracing and memory allocation] */
184a9f12690SJung-uk Kim 
185a9f12690SJung-uk Kim #define ACPI_LV_ALLOCATIONS         0x00100000
186a9f12690SJung-uk Kim #define ACPI_LV_FUNCTIONS           0x00200000
187a9f12690SJung-uk Kim #define ACPI_LV_OPTIMIZATIONS       0x00400000
188a9f12690SJung-uk Kim #define ACPI_LV_VERBOSITY2          0x00700000 | ACPI_LV_VERBOSITY1
189a9f12690SJung-uk Kim #define ACPI_LV_ALL                 ACPI_LV_VERBOSITY2
190a9f12690SJung-uk Kim 
191a9f12690SJung-uk Kim /* Trace verbosity level 3 [Threading, I/O, and Interrupts] */
192a9f12690SJung-uk Kim 
193a9f12690SJung-uk Kim #define ACPI_LV_MUTEX               0x01000000
194a9f12690SJung-uk Kim #define ACPI_LV_THREADS             0x02000000
195a9f12690SJung-uk Kim #define ACPI_LV_IO                  0x04000000
196a9f12690SJung-uk Kim #define ACPI_LV_INTERRUPTS          0x08000000
197a9f12690SJung-uk Kim #define ACPI_LV_VERBOSITY3          0x0F000000 | ACPI_LV_VERBOSITY2
198a9f12690SJung-uk Kim 
199a9f12690SJung-uk Kim /* Exceptionally verbose output -- also used in the global "DebugLevel"  */
200a9f12690SJung-uk Kim 
201a9f12690SJung-uk Kim #define ACPI_LV_AML_DISASSEMBLE     0x10000000
202a9f12690SJung-uk Kim #define ACPI_LV_VERBOSE_INFO        0x20000000
203a9f12690SJung-uk Kim #define ACPI_LV_FULL_TABLES         0x40000000
204a9f12690SJung-uk Kim #define ACPI_LV_EVENTS              0x80000000
205a9f12690SJung-uk Kim #define ACPI_LV_VERBOSE             0xF0000000
206a9f12690SJung-uk Kim 
207a9f12690SJung-uk Kim 
208a9f12690SJung-uk Kim /*
209a9f12690SJung-uk Kim  * Debug level macros that are used in the DEBUG_PRINT macros
210a9f12690SJung-uk Kim  */
211a9f12690SJung-uk Kim #define ACPI_DEBUG_LEVEL(dl)        (UINT32) dl,ACPI_DEBUG_PARAMETERS
212a9f12690SJung-uk Kim 
213a9f12690SJung-uk Kim /*
214a9f12690SJung-uk Kim  * Exception level -- used in the global "DebugLevel"
215a9f12690SJung-uk Kim  *
216a9f12690SJung-uk Kim  * Note: For errors, use the ACPI_ERROR or ACPI_EXCEPTION interfaces.
217a9f12690SJung-uk Kim  * For warnings, use ACPI_WARNING.
218a9f12690SJung-uk Kim  */
219a9f12690SJung-uk Kim #define ACPI_DB_INIT                ACPI_DEBUG_LEVEL (ACPI_LV_INIT)
220a9f12690SJung-uk Kim #define ACPI_DB_DEBUG_OBJECT        ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
221a9f12690SJung-uk Kim #define ACPI_DB_INFO                ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
222572c8255SJung-uk Kim #define ACPI_DB_REPAIR              ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR)
223a9f12690SJung-uk Kim #define ACPI_DB_ALL_EXCEPTIONS      ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
224a9f12690SJung-uk Kim 
225a9f12690SJung-uk Kim /* Trace level -- also used in the global "DebugLevel" */
226a9f12690SJung-uk Kim 
227a9f12690SJung-uk Kim #define ACPI_DB_INIT_NAMES          ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
228a9f12690SJung-uk Kim #define ACPI_DB_THREADS             ACPI_DEBUG_LEVEL (ACPI_LV_THREADS)
229a9f12690SJung-uk Kim #define ACPI_DB_PARSE               ACPI_DEBUG_LEVEL (ACPI_LV_PARSE)
230a9f12690SJung-uk Kim #define ACPI_DB_DISPATCH            ACPI_DEBUG_LEVEL (ACPI_LV_DISPATCH)
231a9f12690SJung-uk Kim #define ACPI_DB_LOAD                ACPI_DEBUG_LEVEL (ACPI_LV_LOAD)
232a9f12690SJung-uk Kim #define ACPI_DB_EXEC                ACPI_DEBUG_LEVEL (ACPI_LV_EXEC)
233a9f12690SJung-uk Kim #define ACPI_DB_NAMES               ACPI_DEBUG_LEVEL (ACPI_LV_NAMES)
234a9f12690SJung-uk Kim #define ACPI_DB_OPREGION            ACPI_DEBUG_LEVEL (ACPI_LV_OPREGION)
235a9f12690SJung-uk Kim #define ACPI_DB_BFIELD              ACPI_DEBUG_LEVEL (ACPI_LV_BFIELD)
236a9f12690SJung-uk Kim #define ACPI_DB_TABLES              ACPI_DEBUG_LEVEL (ACPI_LV_TABLES)
237a9f12690SJung-uk Kim #define ACPI_DB_FUNCTIONS           ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS)
238a9f12690SJung-uk Kim #define ACPI_DB_OPTIMIZATIONS       ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS)
239a9f12690SJung-uk Kim #define ACPI_DB_VALUES              ACPI_DEBUG_LEVEL (ACPI_LV_VALUES)
240a9f12690SJung-uk Kim #define ACPI_DB_OBJECTS             ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS)
241a9f12690SJung-uk Kim #define ACPI_DB_ALLOCATIONS         ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS)
242a9f12690SJung-uk Kim #define ACPI_DB_RESOURCES           ACPI_DEBUG_LEVEL (ACPI_LV_RESOURCES)
243a9f12690SJung-uk Kim #define ACPI_DB_IO                  ACPI_DEBUG_LEVEL (ACPI_LV_IO)
244a9f12690SJung-uk Kim #define ACPI_DB_INTERRUPTS          ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS)
245a9f12690SJung-uk Kim #define ACPI_DB_USER_REQUESTS       ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS)
246a9f12690SJung-uk Kim #define ACPI_DB_PACKAGE             ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE)
247a9f12690SJung-uk Kim #define ACPI_DB_MUTEX               ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX)
248a9f12690SJung-uk Kim #define ACPI_DB_EVENTS              ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS)
249a9f12690SJung-uk Kim 
250a9f12690SJung-uk Kim #define ACPI_DB_ALL                 ACPI_DEBUG_LEVEL (ACPI_LV_ALL)
251a9f12690SJung-uk Kim 
252a9f12690SJung-uk Kim /* Defaults for DebugLevel, debug and normal */
253a9f12690SJung-uk Kim 
254572c8255SJung-uk Kim #define ACPI_DEBUG_DEFAULT          (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR)
255572c8255SJung-uk Kim #define ACPI_NORMAL_DEFAULT         (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR)
256a9f12690SJung-uk Kim #define ACPI_DEBUG_ALL              (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
257a9f12690SJung-uk Kim 
258a9f12690SJung-uk Kim 
259a9f12690SJung-uk Kim #if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
260a9f12690SJung-uk Kim /*
261a9f12690SJung-uk Kim  * Module name is included in both debug and non-debug versions primarily for
262a9f12690SJung-uk Kim  * error messages. The __FILE__ macro is not very useful for this, because it
263a9f12690SJung-uk Kim  * often includes the entire pathname to the module
264a9f12690SJung-uk Kim  */
265a9f12690SJung-uk Kim #define ACPI_MODULE_NAME(Name)          static const char ACPI_UNUSED_VAR _AcpiModuleName[] = Name;
266a9f12690SJung-uk Kim #else
267a9f12690SJung-uk Kim #define ACPI_MODULE_NAME(Name)
268a9f12690SJung-uk Kim #endif
269a9f12690SJung-uk Kim 
270a9f12690SJung-uk Kim /*
271a9f12690SJung-uk Kim  * Ascii error messages can be configured out
272a9f12690SJung-uk Kim  */
273a9f12690SJung-uk Kim #ifndef ACPI_NO_ERROR_MESSAGES
274a9f12690SJung-uk Kim #define AE_INFO                         _AcpiModuleName, __LINE__
275a9f12690SJung-uk Kim 
276a9f12690SJung-uk Kim /*
277a9f12690SJung-uk Kim  * Error reporting. Callers module and line number are inserted by AE_INFO,
278a9f12690SJung-uk Kim  * the plist contains a set of parens to allow variable-length lists.
279a9f12690SJung-uk Kim  * These macros are used for both the debug and non-debug versions of the code.
280a9f12690SJung-uk Kim  */
281a9f12690SJung-uk Kim #define ACPI_INFO(plist)                AcpiInfo plist
282a9f12690SJung-uk Kim #define ACPI_WARNING(plist)             AcpiWarning plist
283a9f12690SJung-uk Kim #define ACPI_EXCEPTION(plist)           AcpiException plist
284a9f12690SJung-uk Kim #define ACPI_ERROR(plist)               AcpiError plist
285ca3cf4faSJung-uk Kim #define ACPI_DEBUG_OBJECT(obj,l,i)      AcpiExDoDebugObject(obj,l,i)
286a9f12690SJung-uk Kim 
287a9f12690SJung-uk Kim #else
288a9f12690SJung-uk Kim 
289a9f12690SJung-uk Kim /* No error messages */
290a9f12690SJung-uk Kim 
291a9f12690SJung-uk Kim #define ACPI_INFO(plist)
292a9f12690SJung-uk Kim #define ACPI_WARNING(plist)
293a9f12690SJung-uk Kim #define ACPI_EXCEPTION(plist)
294a9f12690SJung-uk Kim #define ACPI_ERROR(plist)
295ca3cf4faSJung-uk Kim #define ACPI_DEBUG_OBJECT(obj,l,i)
296a9f12690SJung-uk Kim 
297a9f12690SJung-uk Kim #endif /* ACPI_NO_ERROR_MESSAGES */
298a9f12690SJung-uk Kim 
299a9f12690SJung-uk Kim 
300a9f12690SJung-uk Kim /*
301a9f12690SJung-uk Kim  * Debug macros that are conditionally compiled
302a9f12690SJung-uk Kim  */
303a9f12690SJung-uk Kim #ifdef ACPI_DEBUG_OUTPUT
304a9f12690SJung-uk Kim 
305a9f12690SJung-uk Kim /*
306a9f12690SJung-uk Kim  * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
307a9f12690SJung-uk Kim  * define it now. This is the case where there the compiler does not support
308a9f12690SJung-uk Kim  * a __FUNCTION__ macro or equivalent.
309a9f12690SJung-uk Kim  */
310a9f12690SJung-uk Kim #ifndef ACPI_GET_FUNCTION_NAME
311a9f12690SJung-uk Kim #define ACPI_GET_FUNCTION_NAME          _AcpiFunctionName
312a9f12690SJung-uk Kim 
313a9f12690SJung-uk Kim /*
314a9f12690SJung-uk Kim  * The Name parameter should be the procedure name as a quoted string.
315a9f12690SJung-uk Kim  * The function name is also used by the function exit macros below.
316a9f12690SJung-uk Kim  * Note: (const char) is used to be compatible with the debug interfaces
317a9f12690SJung-uk Kim  * and macros such as __FUNCTION__.
318a9f12690SJung-uk Kim  */
319a9f12690SJung-uk Kim #define ACPI_FUNCTION_NAME(Name)        static const char _AcpiFunctionName[] = #Name;
320a9f12690SJung-uk Kim 
321a9f12690SJung-uk Kim #else
322a9f12690SJung-uk Kim /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
323a9f12690SJung-uk Kim 
324a9f12690SJung-uk Kim #define ACPI_FUNCTION_NAME(Name)
325a9f12690SJung-uk Kim #endif /* ACPI_GET_FUNCTION_NAME */
326a9f12690SJung-uk Kim 
327a9f12690SJung-uk Kim /*
328a9f12690SJung-uk Kim  * Common parameters used for debug output functions:
329a9f12690SJung-uk Kim  * line number, function name, module(file) name, component ID
330a9f12690SJung-uk Kim  */
331a9f12690SJung-uk Kim #define ACPI_DEBUG_PARAMETERS           __LINE__, ACPI_GET_FUNCTION_NAME, _AcpiModuleName, _COMPONENT
332a9f12690SJung-uk Kim 
333a9f12690SJung-uk Kim /*
334a9f12690SJung-uk Kim  * Master debug print macros
335a9f12690SJung-uk Kim  * Print message if and only if:
336a9f12690SJung-uk Kim  *    1) Debug print for the current component is enabled
337a9f12690SJung-uk Kim  *    2) Debug error level or trace level for the print statement is enabled
338a9f12690SJung-uk Kim  */
339a9f12690SJung-uk Kim #define ACPI_DEBUG_PRINT(plist)         AcpiDebugPrint plist
340a9f12690SJung-uk Kim #define ACPI_DEBUG_PRINT_RAW(plist)     AcpiDebugPrintRaw plist
341a9f12690SJung-uk Kim 
342a9f12690SJung-uk Kim #else
343a9f12690SJung-uk Kim /*
344a9f12690SJung-uk Kim  * This is the non-debug case -- make everything go away,
345a9f12690SJung-uk Kim  * leaving no executable debug code!
346a9f12690SJung-uk Kim  */
347a9f12690SJung-uk Kim #define ACPI_FUNCTION_NAME(a)
348a9f12690SJung-uk Kim #define ACPI_DEBUG_PRINT(pl)
349a9f12690SJung-uk Kim #define ACPI_DEBUG_PRINT_RAW(pl)
350a9f12690SJung-uk Kim 
351a9f12690SJung-uk Kim #endif /* ACPI_DEBUG_OUTPUT */
352a9f12690SJung-uk Kim 
353a9f12690SJung-uk Kim 
354a9f12690SJung-uk Kim #endif /* __ACOUTPUT_H__ */
355