acoutput.h revision 245582
167754Smsmith/****************************************************************************** 267754Smsmith * 367754Smsmith * Name: acoutput.h -- debug output 467754Smsmith * 567754Smsmith *****************************************************************************/ 667754Smsmith 7217365Sjkim/* 8245582Sjkim * Copyright (C) 2000 - 2013, Intel Corp. 970243Smsmith * All rights reserved. 1067754Smsmith * 11217365Sjkim * Redistribution and use in source and binary forms, with or without 12217365Sjkim * modification, are permitted provided that the following conditions 13217365Sjkim * are met: 14217365Sjkim * 1. Redistributions of source code must retain the above copyright 15217365Sjkim * notice, this list of conditions, and the following disclaimer, 16217365Sjkim * without modification. 17217365Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18217365Sjkim * substantially similar to the "NO WARRANTY" disclaimer below 19217365Sjkim * ("Disclaimer") and any redistribution must be conditioned upon 20217365Sjkim * including a substantially similar Disclaimer requirement for further 21217365Sjkim * binary redistribution. 22217365Sjkim * 3. Neither the names of the above-listed copyright holders nor the names 23217365Sjkim * of any contributors may be used to endorse or promote products derived 24217365Sjkim * from this software without specific prior written permission. 2567754Smsmith * 26217365Sjkim * Alternatively, this software may be distributed under the terms of the 27217365Sjkim * GNU General Public License ("GPL") version 2 as published by the Free 28217365Sjkim * Software Foundation. 2967754Smsmith * 30217365Sjkim * NO WARRANTY 31217365Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32217365Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33217365Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34217365Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35217365Sjkim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36217365Sjkim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37217365Sjkim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38217365Sjkim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39217365Sjkim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40217365Sjkim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41217365Sjkim * POSSIBILITY OF SUCH DAMAGES. 42217365Sjkim */ 4367754Smsmith 4467754Smsmith#ifndef __ACOUTPUT_H__ 4567754Smsmith#define __ACOUTPUT_H__ 4667754Smsmith 4767754Smsmith/* 48193267Sjkim * Debug levels and component IDs. These are used to control the 49193267Sjkim * granularity of the output of the ACPI_DEBUG_PRINT macro -- on a 50193267Sjkim * per-component basis and a per-exception-type basis. 5167754Smsmith */ 5267754Smsmith 5382367Smsmith/* Component IDs are used in the global "DebugLayer" */ 5467754Smsmith 5577424Smsmith#define ACPI_UTILITIES 0x00000001 5677424Smsmith#define ACPI_HARDWARE 0x00000002 5777424Smsmith#define ACPI_EVENTS 0x00000004 5877424Smsmith#define ACPI_TABLES 0x00000008 5977424Smsmith#define ACPI_NAMESPACE 0x00000010 6077424Smsmith#define ACPI_PARSER 0x00000020 6177424Smsmith#define ACPI_DISPATCHER 0x00000040 6277424Smsmith#define ACPI_EXECUTER 0x00000080 6377424Smsmith#define ACPI_RESOURCES 0x00000100 64102550Siwasaki#define ACPI_CA_DEBUGGER 0x00000200 6578986Smsmith#define ACPI_OS_SERVICES 0x00000400 66102550Siwasaki#define ACPI_CA_DISASSEMBLER 0x00000800 6767754Smsmith 6891116Smsmith/* Component IDs for ACPI tools and utilities */ 6967754Smsmith 7091116Smsmith#define ACPI_COMPILER 0x00001000 7191116Smsmith#define ACPI_TOOLS 0x00002000 72193267Sjkim#define ACPI_EXAMPLE 0x00004000 73193267Sjkim#define ACPI_DRIVER 0x00008000 74209746Sjkim#define DT_COMPILER 0x00010000 75233250Sjkim#define ASL_PREPROCESSOR 0x00020000 7667754Smsmith 77209746Sjkim#define ACPI_ALL_COMPONENTS 0x0001FFFF 78102550Siwasaki#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) 79102550Siwasaki 8091116Smsmith/* Component IDs reserved for ACPI drivers */ 8177424Smsmith 8291116Smsmith#define ACPI_ALL_DRIVERS 0xFFFF0000 8391116Smsmith 84114237Snjl 8582367Smsmith/* 86193267Sjkim * Raw debug output levels, do not use these in the ACPI_DEBUG_PRINT macros 8782367Smsmith */ 88193267Sjkim#define ACPI_LV_INIT 0x00000001 89193267Sjkim#define ACPI_LV_DEBUG_OBJECT 0x00000002 90193267Sjkim#define ACPI_LV_INFO 0x00000004 91200553Sjkim#define ACPI_LV_REPAIR 0x00000008 92200553Sjkim#define ACPI_LV_ALL_EXCEPTIONS 0x0000000F 9382367Smsmith 9483174Smsmith/* Trace verbosity level 1 [Standard Trace Level] */ 9582367Smsmith 96114237Snjl#define ACPI_LV_INIT_NAMES 0x00000020 9783174Smsmith#define ACPI_LV_PARSE 0x00000040 9883174Smsmith#define ACPI_LV_LOAD 0x00000080 9983174Smsmith#define ACPI_LV_DISPATCH 0x00000100 10083174Smsmith#define ACPI_LV_EXEC 0x00000200 10183174Smsmith#define ACPI_LV_NAMES 0x00000400 10283174Smsmith#define ACPI_LV_OPREGION 0x00000800 10383174Smsmith#define ACPI_LV_BFIELD 0x00001000 10483174Smsmith#define ACPI_LV_TABLES 0x00002000 10583174Smsmith#define ACPI_LV_VALUES 0x00004000 10683174Smsmith#define ACPI_LV_OBJECTS 0x00008000 10783174Smsmith#define ACPI_LV_RESOURCES 0x00010000 10883174Smsmith#define ACPI_LV_USER_REQUESTS 0x00020000 10983174Smsmith#define ACPI_LV_PACKAGE 0x00040000 110114237Snjl#define ACPI_LV_VERBOSITY1 0x0007FF40 | ACPI_LV_ALL_EXCEPTIONS 11183174Smsmith 11283174Smsmith/* Trace verbosity level 2 [Function tracing and memory allocation] */ 11383174Smsmith 11482367Smsmith#define ACPI_LV_ALLOCATIONS 0x00100000 11583174Smsmith#define ACPI_LV_FUNCTIONS 0x00200000 116102550Siwasaki#define ACPI_LV_OPTIMIZATIONS 0x00400000 117102550Siwasaki#define ACPI_LV_VERBOSITY2 0x00700000 | ACPI_LV_VERBOSITY1 11883174Smsmith#define ACPI_LV_ALL ACPI_LV_VERBOSITY2 11982367Smsmith 12083174Smsmith/* Trace verbosity level 3 [Threading, I/O, and Interrupts] */ 12182367Smsmith 12283174Smsmith#define ACPI_LV_MUTEX 0x01000000 12383174Smsmith#define ACPI_LV_THREADS 0x02000000 12483174Smsmith#define ACPI_LV_IO 0x04000000 12583174Smsmith#define ACPI_LV_INTERRUPTS 0x08000000 12683174Smsmith#define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2 12783174Smsmith 12899679Siwasaki/* Exceptionally verbose output -- also used in the global "DebugLevel" */ 12999679Siwasaki 13099679Siwasaki#define ACPI_LV_AML_DISASSEMBLE 0x10000000 13199679Siwasaki#define ACPI_LV_VERBOSE_INFO 0x20000000 13299679Siwasaki#define ACPI_LV_FULL_TABLES 0x40000000 13399679Siwasaki#define ACPI_LV_EVENTS 0x80000000 13499679Siwasaki#define ACPI_LV_VERBOSE 0xF0000000 13599679Siwasaki 13699679Siwasaki 13782367Smsmith/* 13882367Smsmith * Debug level macros that are used in the DEBUG_PRINT macros 13982367Smsmith */ 140151937Sjkim#define ACPI_DEBUG_LEVEL(dl) (UINT32) dl,ACPI_DEBUG_PARAMETERS 14182367Smsmith 142193267Sjkim/* 143193267Sjkim * Exception level -- used in the global "DebugLevel" 144193267Sjkim * 145193267Sjkim * Note: For errors, use the ACPI_ERROR or ACPI_EXCEPTION interfaces. 146193267Sjkim * For warnings, use ACPI_WARNING. 147193267Sjkim */ 148114237Snjl#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) 14982367Smsmith#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) 150114237Snjl#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) 151200553Sjkim#define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR) 15282367Smsmith#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) 15367754Smsmith 15467754Smsmith/* Trace level -- also used in the global "DebugLevel" */ 15567754Smsmith 156114237Snjl#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) 15782367Smsmith#define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS) 15882367Smsmith#define ACPI_DB_PARSE ACPI_DEBUG_LEVEL (ACPI_LV_PARSE) 15982367Smsmith#define ACPI_DB_DISPATCH ACPI_DEBUG_LEVEL (ACPI_LV_DISPATCH) 16082367Smsmith#define ACPI_DB_LOAD ACPI_DEBUG_LEVEL (ACPI_LV_LOAD) 16182367Smsmith#define ACPI_DB_EXEC ACPI_DEBUG_LEVEL (ACPI_LV_EXEC) 16282367Smsmith#define ACPI_DB_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_NAMES) 16382367Smsmith#define ACPI_DB_OPREGION ACPI_DEBUG_LEVEL (ACPI_LV_OPREGION) 16482367Smsmith#define ACPI_DB_BFIELD ACPI_DEBUG_LEVEL (ACPI_LV_BFIELD) 16582367Smsmith#define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES) 16682367Smsmith#define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS) 167102550Siwasaki#define ACPI_DB_OPTIMIZATIONS ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS) 16882367Smsmith#define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES) 16982367Smsmith#define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS) 17082367Smsmith#define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS) 17182367Smsmith#define ACPI_DB_RESOURCES ACPI_DEBUG_LEVEL (ACPI_LV_RESOURCES) 17282367Smsmith#define ACPI_DB_IO ACPI_DEBUG_LEVEL (ACPI_LV_IO) 17382367Smsmith#define ACPI_DB_INTERRUPTS ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS) 17482367Smsmith#define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS) 17582367Smsmith#define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE) 17682367Smsmith#define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX) 177193267Sjkim#define ACPI_DB_EVENTS ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS) 17867754Smsmith 17999679Siwasaki#define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL) 18067754Smsmith 18167754Smsmith/* Defaults for DebugLevel, debug and normal */ 18267754Smsmith 183200553Sjkim#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) 184200553Sjkim#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR) 185114237Snjl#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) 18667754Smsmith 18767754Smsmith 188193267Sjkim#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES) 189193267Sjkim/* 190218590Sjkim * The module name is used primarily for error and debug messages. 191218590Sjkim * The __FILE__ macro is not very useful for this, because it 192218590Sjkim * usually includes the entire pathname to the module making the 193218590Sjkim * debug output difficult to read. 194193267Sjkim */ 195193267Sjkim#define ACPI_MODULE_NAME(Name) static const char ACPI_UNUSED_VAR _AcpiModuleName[] = Name; 196193267Sjkim#else 197218590Sjkim/* 198218590Sjkim * For the no-debug and no-error-msg cases, we must at least define 199218590Sjkim * a null module name. 200218590Sjkim */ 201193267Sjkim#define ACPI_MODULE_NAME(Name) 202218590Sjkim#define _AcpiModuleName "" 203193267Sjkim#endif 204193267Sjkim 205193267Sjkim/* 206193267Sjkim * Ascii error messages can be configured out 207193267Sjkim */ 208193267Sjkim#ifndef ACPI_NO_ERROR_MESSAGES 209193267Sjkim#define AE_INFO _AcpiModuleName, __LINE__ 210193267Sjkim 211193267Sjkim/* 212193267Sjkim * Error reporting. Callers module and line number are inserted by AE_INFO, 213193267Sjkim * the plist contains a set of parens to allow variable-length lists. 214193267Sjkim * These macros are used for both the debug and non-debug versions of the code. 215193267Sjkim */ 216193267Sjkim#define ACPI_INFO(plist) AcpiInfo plist 217193267Sjkim#define ACPI_WARNING(plist) AcpiWarning plist 218193267Sjkim#define ACPI_EXCEPTION(plist) AcpiException plist 219193267Sjkim#define ACPI_ERROR(plist) AcpiError plist 220238381Sjkim#define ACPI_BIOS_WARNING(plist) AcpiBiosWarning plist 221238381Sjkim#define ACPI_BIOS_ERROR(plist) AcpiBiosError plist 222204773Sjkim#define ACPI_DEBUG_OBJECT(obj,l,i) AcpiExDoDebugObject(obj,l,i) 223193267Sjkim 224193267Sjkim#else 225193267Sjkim 226193267Sjkim/* No error messages */ 227193267Sjkim 228193267Sjkim#define ACPI_INFO(plist) 229193267Sjkim#define ACPI_WARNING(plist) 230193267Sjkim#define ACPI_EXCEPTION(plist) 231193267Sjkim#define ACPI_ERROR(plist) 232238381Sjkim#define ACPI_BIOS_WARNING(plist) 233238381Sjkim#define ACPI_BIOS_ERROR(plist) 234204773Sjkim#define ACPI_DEBUG_OBJECT(obj,l,i) 235193267Sjkim 236193267Sjkim#endif /* ACPI_NO_ERROR_MESSAGES */ 237193267Sjkim 238193267Sjkim 239193267Sjkim/* 240193267Sjkim * Debug macros that are conditionally compiled 241193267Sjkim */ 242193267Sjkim#ifdef ACPI_DEBUG_OUTPUT 243193267Sjkim 244193267Sjkim/* 245193267Sjkim * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header, 246193267Sjkim * define it now. This is the case where there the compiler does not support 247193267Sjkim * a __FUNCTION__ macro or equivalent. 248193267Sjkim */ 249193267Sjkim#ifndef ACPI_GET_FUNCTION_NAME 250193267Sjkim#define ACPI_GET_FUNCTION_NAME _AcpiFunctionName 251193267Sjkim 252193267Sjkim/* 253193267Sjkim * The Name parameter should be the procedure name as a quoted string. 254193267Sjkim * The function name is also used by the function exit macros below. 255193267Sjkim * Note: (const char) is used to be compatible with the debug interfaces 256193267Sjkim * and macros such as __FUNCTION__. 257193267Sjkim */ 258193267Sjkim#define ACPI_FUNCTION_NAME(Name) static const char _AcpiFunctionName[] = #Name; 259193267Sjkim 260193267Sjkim#else 261193267Sjkim/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ 262193267Sjkim 263193267Sjkim#define ACPI_FUNCTION_NAME(Name) 264193267Sjkim#endif /* ACPI_GET_FUNCTION_NAME */ 265193267Sjkim 266193267Sjkim/* 267193267Sjkim * Common parameters used for debug output functions: 268193267Sjkim * line number, function name, module(file) name, component ID 269193267Sjkim */ 270245582Sjkim#define ACPI_DEBUG_PARAMETERS \ 271245582Sjkim __LINE__, ACPI_GET_FUNCTION_NAME, _AcpiModuleName, _COMPONENT 272193267Sjkim 273245582Sjkim/* Check if debug output is currently dynamically enabled */ 274245582Sjkim 275245582Sjkim#define ACPI_IS_DEBUG_ENABLED(Level, Component) \ 276245582Sjkim ((Level & AcpiDbgLevel) && (Component & AcpiDbgLayer)) 277245582Sjkim 278193267Sjkim/* 279193267Sjkim * Master debug print macros 280193267Sjkim * Print message if and only if: 281193267Sjkim * 1) Debug print for the current component is enabled 282193267Sjkim * 2) Debug error level or trace level for the print statement is enabled 283245582Sjkim * 284245582Sjkim * November 2012: Moved the runtime check for whether to actually emit the 285245582Sjkim * debug message outside of the print function itself. This improves overall 286245582Sjkim * performance at a relatively small code cost. Implementation involves the 287245582Sjkim * use of variadic macros supported by C99. 288245582Sjkim * 289245582Sjkim * Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from 290245582Sjkim * complaining about these constructs. On other compilers the do...while 291245582Sjkim * adds some extra code, so this feature is optional. 292193267Sjkim */ 293245582Sjkim#ifdef ACPI_USE_DO_WHILE_0 294245582Sjkim#define ACPI_DO_WHILE0(a) do a while(0) 295245582Sjkim#else 296245582Sjkim#define ACPI_DO_WHILE0(a) a 297245582Sjkim#endif 298193267Sjkim 299245582Sjkim/* DEBUG_PRINT functions */ 300245582Sjkim 301245582Sjkim#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist 302245582Sjkim#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist 303245582Sjkim 304245582Sjkim/* Helper macros for DEBUG_PRINT */ 305245582Sjkim 306245582Sjkim#define ACPI_DO_DEBUG_PRINT(Function, Level, Line, Filename, Modulename, Component, ...) \ 307245582Sjkim ACPI_DO_WHILE0 ({ \ 308245582Sjkim if (ACPI_IS_DEBUG_ENABLED (Level, Component)) \ 309245582Sjkim { \ 310245582Sjkim Function (Level, Line, Filename, Modulename, Component, __VA_ARGS__); \ 311245582Sjkim } \ 312245582Sjkim }) 313245582Sjkim 314245582Sjkim#define ACPI_ACTUAL_DEBUG(Level, Line, Filename, Modulename, Component, ...) \ 315245582Sjkim ACPI_DO_DEBUG_PRINT (AcpiDebugPrint, Level, Line, \ 316245582Sjkim Filename, Modulename, Component, __VA_ARGS__) 317245582Sjkim 318245582Sjkim#define ACPI_ACTUAL_DEBUG_RAW(Level, Line, Filename, Modulename, Component, ...) \ 319245582Sjkim ACPI_DO_DEBUG_PRINT (AcpiDebugPrintRaw, Level, Line, \ 320245582Sjkim Filename, Modulename, Component, __VA_ARGS__) 321245582Sjkim 322245582Sjkim 323193267Sjkim/* 324245582Sjkim * Function entry tracing 325245582Sjkim * 326245582Sjkim * The name of the function is emitted as a local variable that is 327245582Sjkim * intended to be used by both the entry trace and the exit trace. 328245582Sjkim */ 329245582Sjkim 330245582Sjkim/* Helper macro */ 331245582Sjkim 332245582Sjkim#define ACPI_TRACE_ENTRY(Name, Function, Cast, Param) \ 333245582Sjkim ACPI_FUNCTION_NAME (Name) \ 334245582Sjkim Function (ACPI_DEBUG_PARAMETERS, Cast (Param)) 335245582Sjkim 336245582Sjkim/* The actual entry trace macros */ 337245582Sjkim 338245582Sjkim#define ACPI_FUNCTION_TRACE(Name) \ 339245582Sjkim ACPI_FUNCTION_NAME(Name) \ 340245582Sjkim AcpiUtTrace (ACPI_DEBUG_PARAMETERS) 341245582Sjkim 342245582Sjkim#define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \ 343245582Sjkim ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, (void *), Pointer) 344245582Sjkim 345245582Sjkim#define ACPI_FUNCTION_TRACE_U32(Name, Value) \ 346245582Sjkim ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, (UINT32), Value) 347245582Sjkim 348245582Sjkim#define ACPI_FUNCTION_TRACE_STR(Name, String) \ 349245582Sjkim ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, (char *), String) 350245582Sjkim 351245582Sjkim#define ACPI_FUNCTION_ENTRY() \ 352245582Sjkim AcpiUtTrackStackPtr() 353245582Sjkim 354245582Sjkim 355245582Sjkim/* 356245582Sjkim * Function exit tracing 357245582Sjkim * 358245582Sjkim * These macros include a return statement. This is usually considered 359245582Sjkim * bad form, but having a separate exit macro before the actual return 360245582Sjkim * is very ugly and difficult to maintain. 361245582Sjkim * 362245582Sjkim * One of the FUNCTION_TRACE macros above must be used in conjunction 363245582Sjkim * with these macros so that "_AcpiFunctionName" is defined. 364245582Sjkim */ 365245582Sjkim 366245582Sjkim/* Exit trace helper macro */ 367245582Sjkim 368245582Sjkim#define ACPI_TRACE_EXIT(Function, Cast, Param) \ 369245582Sjkim ACPI_DO_WHILE0 ({ \ 370245582Sjkim Function (ACPI_DEBUG_PARAMETERS, Cast (Param)); \ 371245582Sjkim return ((Param)); \ 372245582Sjkim }) 373245582Sjkim 374245582Sjkim/* The actual exit macros */ 375245582Sjkim 376245582Sjkim#define return_VOID \ 377245582Sjkim ACPI_DO_WHILE0 ({ \ 378245582Sjkim AcpiUtExit (ACPI_DEBUG_PARAMETERS); \ 379245582Sjkim return; \ 380245582Sjkim }) 381245582Sjkim 382245582Sjkim#define return_ACPI_STATUS(Status) \ 383245582Sjkim ACPI_TRACE_EXIT (AcpiUtStatusExit, (ACPI_STATUS), Status) 384245582Sjkim 385245582Sjkim#define return_PTR(Pointer) \ 386245582Sjkim ACPI_TRACE_EXIT (AcpiUtPtrExit, (UINT8 *), Pointer) 387245582Sjkim 388245582Sjkim#define return_VALUE(Value) \ 389245582Sjkim ACPI_TRACE_EXIT (AcpiUtValueExit, (UINT64), Value) 390245582Sjkim 391245582Sjkim 392245582Sjkim/* Conditional execution */ 393245582Sjkim 394245582Sjkim#define ACPI_DEBUG_EXEC(a) a 395245582Sjkim#define ACPI_DEBUG_ONLY_MEMBERS(a) a; 396245582Sjkim#define _VERBOSE_STRUCTURES 397245582Sjkim 398245582Sjkim 399245582Sjkim/* Various object display routines for debug */ 400245582Sjkim 401245582Sjkim#define ACPI_DUMP_STACK_ENTRY(a) AcpiExDumpOperand((a), 0) 402245582Sjkim#define ACPI_DUMP_OPERANDS(a, b ,c) AcpiExDumpOperands(a, b, c) 403245582Sjkim#define ACPI_DUMP_ENTRY(a, b) AcpiNsDumpEntry (a, b) 404245582Sjkim#define ACPI_DUMP_PATHNAME(a, b, c, d) AcpiNsDumpPathname(a, b, c, d) 405245582Sjkim#define ACPI_DUMP_BUFFER(a, b) AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) 406245582Sjkim 407245582Sjkim#else /* ACPI_DEBUG_OUTPUT */ 408245582Sjkim/* 409193267Sjkim * This is the non-debug case -- make everything go away, 410193267Sjkim * leaving no executable debug code! 411193267Sjkim */ 412193267Sjkim#define ACPI_FUNCTION_NAME(a) 413193267Sjkim#define ACPI_DEBUG_PRINT(pl) 414193267Sjkim#define ACPI_DEBUG_PRINT_RAW(pl) 415245582Sjkim#define ACPI_DEBUG_EXEC(a) 416245582Sjkim#define ACPI_DEBUG_ONLY_MEMBERS(a) 417245582Sjkim#define ACPI_FUNCTION_TRACE(a) 418245582Sjkim#define ACPI_FUNCTION_TRACE_PTR(a, b) 419245582Sjkim#define ACPI_FUNCTION_TRACE_U32(a, b) 420245582Sjkim#define ACPI_FUNCTION_TRACE_STR(a, b) 421245582Sjkim#define ACPI_FUNCTION_EXIT 422245582Sjkim#define ACPI_FUNCTION_STATUS_EXIT(s) 423245582Sjkim#define ACPI_FUNCTION_VALUE_EXIT(s) 424245582Sjkim#define ACPI_FUNCTION_ENTRY() 425245582Sjkim#define ACPI_DUMP_STACK_ENTRY(a) 426245582Sjkim#define ACPI_DUMP_OPERANDS(a, b, c) 427245582Sjkim#define ACPI_DUMP_ENTRY(a, b) 428245582Sjkim#define ACPI_DUMP_TABLES(a, b) 429245582Sjkim#define ACPI_DUMP_PATHNAME(a, b, c, d) 430245582Sjkim#define ACPI_DUMP_BUFFER(a, b) 431245582Sjkim#define ACPI_DEBUG_PRINT(pl) 432245582Sjkim#define ACPI_DEBUG_PRINT_RAW(pl) 433245582Sjkim#define ACPI_IS_DEBUG_ENABLED(Level, Component) 0 434193267Sjkim 435245582Sjkim/* Return macros must have a return statement at the minimum */ 436245582Sjkim 437245582Sjkim#define return_VOID return 438245582Sjkim#define return_ACPI_STATUS(s) return(s) 439245582Sjkim#define return_VALUE(s) return(s) 440245582Sjkim#define return_PTR(s) return(s) 441245582Sjkim 442193267Sjkim#endif /* ACPI_DEBUG_OUTPUT */ 443193267Sjkim 444193267Sjkim 44567754Smsmith#endif /* __ACOUTPUT_H__ */ 446