0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __ACOUTPUT_H__
0011 #define __ACOUTPUT_H__
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #define ACPI_UTILITIES 0x00000001
0022 #define ACPI_HARDWARE 0x00000002
0023 #define ACPI_EVENTS 0x00000004
0024 #define ACPI_TABLES 0x00000008
0025 #define ACPI_NAMESPACE 0x00000010
0026 #define ACPI_PARSER 0x00000020
0027 #define ACPI_DISPATCHER 0x00000040
0028 #define ACPI_EXECUTER 0x00000080
0029 #define ACPI_RESOURCES 0x00000100
0030 #define ACPI_CA_DEBUGGER 0x00000200
0031 #define ACPI_OS_SERVICES 0x00000400
0032 #define ACPI_CA_DISASSEMBLER 0x00000800
0033
0034
0035
0036 #define ACPI_COMPILER 0x00001000
0037 #define ACPI_TOOLS 0x00002000
0038 #define ACPI_EXAMPLE 0x00004000
0039 #define ACPI_DRIVER 0x00008000
0040 #define DT_COMPILER 0x00010000
0041 #define ASL_PREPROCESSOR 0x00020000
0042
0043 #define ACPI_ALL_COMPONENTS 0x0001FFFF
0044 #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
0045
0046
0047
0048 #define ACPI_ALL_DRIVERS 0xFFFF0000
0049
0050
0051
0052
0053 #define ACPI_LV_INIT 0x00000001
0054 #define ACPI_LV_DEBUG_OBJECT 0x00000002
0055 #define ACPI_LV_INFO 0x00000004
0056 #define ACPI_LV_REPAIR 0x00000008
0057 #define ACPI_LV_TRACE_POINT 0x00000010
0058 #define ACPI_LV_ALL_EXCEPTIONS 0x0000001F
0059
0060
0061
0062 #define ACPI_LV_INIT_NAMES 0x00000020
0063 #define ACPI_LV_PARSE 0x00000040
0064 #define ACPI_LV_LOAD 0x00000080
0065 #define ACPI_LV_DISPATCH 0x00000100
0066 #define ACPI_LV_EXEC 0x00000200
0067 #define ACPI_LV_NAMES 0x00000400
0068 #define ACPI_LV_OPREGION 0x00000800
0069 #define ACPI_LV_BFIELD 0x00001000
0070 #define ACPI_LV_TABLES 0x00002000
0071 #define ACPI_LV_VALUES 0x00004000
0072 #define ACPI_LV_OBJECTS 0x00008000
0073 #define ACPI_LV_RESOURCES 0x00010000
0074 #define ACPI_LV_USER_REQUESTS 0x00020000
0075 #define ACPI_LV_PACKAGE 0x00040000
0076 #define ACPI_LV_EVALUATION 0x00080000
0077 #define ACPI_LV_VERBOSITY1 0x000FFF40 | ACPI_LV_ALL_EXCEPTIONS
0078
0079
0080
0081 #define ACPI_LV_ALLOCATIONS 0x00100000
0082 #define ACPI_LV_FUNCTIONS 0x00200000
0083 #define ACPI_LV_OPTIMIZATIONS 0x00400000
0084 #define ACPI_LV_PARSE_TREES 0x00800000
0085 #define ACPI_LV_VERBOSITY2 0x00F00000 | ACPI_LV_VERBOSITY1
0086 #define ACPI_LV_ALL ACPI_LV_VERBOSITY2
0087
0088
0089
0090 #define ACPI_LV_MUTEX 0x01000000
0091 #define ACPI_LV_THREADS 0x02000000
0092 #define ACPI_LV_IO 0x04000000
0093 #define ACPI_LV_INTERRUPTS 0x08000000
0094 #define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2
0095
0096
0097
0098 #define ACPI_LV_AML_DISASSEMBLE 0x10000000
0099 #define ACPI_LV_VERBOSE_INFO 0x20000000
0100 #define ACPI_LV_FULL_TABLES 0x40000000
0101 #define ACPI_LV_EVENTS 0x80000000
0102 #define ACPI_LV_VERBOSE 0xF0000000
0103
0104
0105
0106
0107 #define ACPI_DEBUG_LEVEL(dl) (u32) dl,ACPI_DEBUG_PARAMETERS
0108
0109
0110
0111
0112
0113
0114
0115 #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT)
0116 #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
0117 #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
0118 #define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR)
0119 #define ACPI_DB_TRACE_POINT ACPI_DEBUG_LEVEL (ACPI_LV_TRACE_POINT)
0120 #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
0121
0122
0123
0124 #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
0125 #define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS)
0126 #define ACPI_DB_PARSE ACPI_DEBUG_LEVEL (ACPI_LV_PARSE)
0127 #define ACPI_DB_DISPATCH ACPI_DEBUG_LEVEL (ACPI_LV_DISPATCH)
0128 #define ACPI_DB_LOAD ACPI_DEBUG_LEVEL (ACPI_LV_LOAD)
0129 #define ACPI_DB_EXEC ACPI_DEBUG_LEVEL (ACPI_LV_EXEC)
0130 #define ACPI_DB_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_NAMES)
0131 #define ACPI_DB_OPREGION ACPI_DEBUG_LEVEL (ACPI_LV_OPREGION)
0132 #define ACPI_DB_BFIELD ACPI_DEBUG_LEVEL (ACPI_LV_BFIELD)
0133 #define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES)
0134 #define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS)
0135 #define ACPI_DB_OPTIMIZATIONS ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS)
0136 #define ACPI_DB_PARSE_TREES ACPI_DEBUG_LEVEL (ACPI_LV_PARSE_TREES)
0137 #define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES)
0138 #define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS)
0139 #define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS)
0140 #define ACPI_DB_RESOURCES ACPI_DEBUG_LEVEL (ACPI_LV_RESOURCES)
0141 #define ACPI_DB_IO ACPI_DEBUG_LEVEL (ACPI_LV_IO)
0142 #define ACPI_DB_INTERRUPTS ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS)
0143 #define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS)
0144 #define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE)
0145 #define ACPI_DB_EVALUATION ACPI_DEBUG_LEVEL (ACPI_LV_EVALUATION)
0146 #define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX)
0147 #define ACPI_DB_EVENTS ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS)
0148
0149 #define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL)
0150
0151
0152
0153 #ifndef ACPI_DEBUG_DEFAULT
0154 #define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_EVALUATION | ACPI_LV_REPAIR)
0155 #endif
0156
0157 #define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR)
0158 #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
0159
0160
0161
0162
0163 #define ACPI_TRACE_ENABLED ((u32) 4)
0164 #define ACPI_TRACE_ONESHOT ((u32) 2)
0165 #define ACPI_TRACE_OPCODE ((u32) 1)
0166
0167
0168
0169 #define ACPI_TRACE_LEVEL_ALL ACPI_LV_ALL
0170 #define ACPI_TRACE_LAYER_ALL 0x000001FF
0171 #define ACPI_TRACE_LEVEL_DEFAULT ACPI_LV_TRACE_POINT
0172 #define ACPI_TRACE_LAYER_DEFAULT ACPI_EXECUTER
0173
0174 #if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
0175
0176
0177
0178
0179
0180
0181 #define ACPI_MODULE_NAME(name) static const char ACPI_UNUSED_VAR _acpi_module_name[] = name;
0182 #else
0183
0184
0185
0186
0187 #define ACPI_MODULE_NAME(name)
0188 #define _acpi_module_name ""
0189 #endif
0190
0191
0192
0193
0194 #ifndef ACPI_NO_ERROR_MESSAGES
0195 #define AE_INFO _acpi_module_name, __LINE__
0196
0197
0198
0199
0200
0201
0202 #define ACPI_INFO(plist) acpi_info plist
0203 #define ACPI_WARNING(plist) acpi_warning plist
0204 #define ACPI_EXCEPTION(plist) acpi_exception plist
0205 #define ACPI_ERROR(plist) acpi_error plist
0206 #define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist
0207 #define ACPI_BIOS_EXCEPTION(plist) acpi_bios_exception plist
0208 #define ACPI_BIOS_ERROR(plist) acpi_bios_error plist
0209 #define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i)
0210
0211 #else
0212
0213
0214
0215 #define ACPI_INFO(plist)
0216 #define ACPI_WARNING(plist)
0217 #define ACPI_EXCEPTION(plist)
0218 #define ACPI_ERROR(plist)
0219 #define ACPI_BIOS_WARNING(plist)
0220 #define ACPI_BIOS_EXCEPTION(plist)
0221 #define ACPI_BIOS_ERROR(plist)
0222 #define ACPI_DEBUG_OBJECT(obj,l,i)
0223
0224 #endif
0225
0226
0227
0228
0229 #ifdef ACPI_DEBUG_OUTPUT
0230
0231
0232
0233
0234
0235
0236 #ifndef ACPI_GET_FUNCTION_NAME
0237 #define ACPI_GET_FUNCTION_NAME _acpi_function_name
0238
0239
0240
0241
0242
0243
0244
0245 #define ACPI_FUNCTION_NAME(name) static const char _acpi_function_name[] = #name;
0246
0247 #else
0248
0249
0250 #define ACPI_FUNCTION_NAME(name)
0251 #endif
0252
0253
0254
0255
0256
0257 #define ACPI_DEBUG_PARAMETERS \
0258 __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
0259
0260
0261
0262 #define ACPI_IS_DEBUG_ENABLED(level, component) \
0263 ((level & acpi_dbg_level) && (component & acpi_dbg_layer))
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280 #ifdef ACPI_USE_DO_WHILE_0
0281 #define ACPI_DO_WHILE0(a) do a while(0)
0282 #else
0283 #define ACPI_DO_WHILE0(a) a
0284 #endif
0285
0286
0287
0288 #ifndef COMPILER_VA_MACRO
0289
0290 #define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist
0291 #define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist
0292
0293 #else
0294
0295
0296
0297 #define ACPI_DO_DEBUG_PRINT(function, level, line, filename, modulename, component, ...) \
0298 ACPI_DO_WHILE0 ({ \
0299 if (ACPI_IS_DEBUG_ENABLED (level, component)) \
0300 { \
0301 function (level, line, filename, modulename, component, __VA_ARGS__); \
0302 } \
0303 })
0304
0305 #define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \
0306 ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \
0307 filename, modulename, component, __VA_ARGS__)
0308
0309 #define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \
0310 ACPI_DO_DEBUG_PRINT (acpi_debug_print_raw, level, line, \
0311 filename, modulename, component, __VA_ARGS__)
0312
0313 #define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist
0314 #define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist
0315
0316 #endif
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327 #define ACPI_TRACE_ENTRY(name, function, type, param) \
0328 ACPI_FUNCTION_NAME (name) \
0329 function (ACPI_DEBUG_PARAMETERS, (type) (param))
0330
0331
0332
0333 #define ACPI_FUNCTION_TRACE(name) \
0334 ACPI_FUNCTION_NAME(name) \
0335 acpi_ut_trace (ACPI_DEBUG_PARAMETERS)
0336
0337 #define ACPI_FUNCTION_TRACE_PTR(name, pointer) \
0338 ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, void *, pointer)
0339
0340 #define ACPI_FUNCTION_TRACE_U32(name, value) \
0341 ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, u32, value)
0342
0343 #define ACPI_FUNCTION_TRACE_STR(name, string) \
0344 ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, const char *, string)
0345
0346 #define ACPI_FUNCTION_ENTRY() \
0347 acpi_ut_track_stack_ptr()
0348
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370 #ifndef ACPI_SIMPLE_RETURN_MACROS
0371
0372 #define ACPI_TRACE_EXIT(function, type, param) \
0373 ACPI_DO_WHILE0 ({ \
0374 register type _param = (type) (param); \
0375 function (ACPI_DEBUG_PARAMETERS, _param); \
0376 return (_param); \
0377 })
0378
0379 #else
0380
0381 #define ACPI_TRACE_EXIT(function, type, param) \
0382 ACPI_DO_WHILE0 ({ \
0383 function (ACPI_DEBUG_PARAMETERS, (type) (param)); \
0384 return (param); \
0385 })
0386
0387 #endif
0388
0389
0390
0391 #define return_VOID \
0392 ACPI_DO_WHILE0 ({ \
0393 acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \
0394 return; \
0395 })
0396
0397 #define return_ACPI_STATUS(status) \
0398 ACPI_TRACE_EXIT (acpi_ut_status_exit, acpi_status, status)
0399
0400 #define return_PTR(pointer) \
0401 ACPI_TRACE_EXIT (acpi_ut_ptr_exit, void *, pointer)
0402
0403 #define return_STR(string) \
0404 ACPI_TRACE_EXIT (acpi_ut_str_exit, const char *, string)
0405
0406 #define return_VALUE(value) \
0407 ACPI_TRACE_EXIT (acpi_ut_value_exit, u64, value)
0408
0409 #define return_UINT32(value) \
0410 ACPI_TRACE_EXIT (acpi_ut_value_exit, u32, value)
0411
0412 #define return_UINT8(value) \
0413 ACPI_TRACE_EXIT (acpi_ut_value_exit, u8, value)
0414
0415
0416
0417 #define ACPI_DEBUG_EXEC(a) a
0418 #define ACPI_DEBUG_ONLY_MEMBERS(a) a
0419 #define _VERBOSE_STRUCTURES
0420
0421
0422
0423 #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0)
0424 #define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c)
0425 #define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b)
0426 #define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d)
0427 #define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
0428
0429 #define ACPI_TRACE_POINT(a, b, c, d) acpi_trace_point (a, b, c, d)
0430
0431 #else
0432
0433
0434
0435
0436 #define ACPI_DEBUG_PRINT(pl)
0437 #define ACPI_DEBUG_PRINT_RAW(pl)
0438 #define ACPI_DEBUG_EXEC(a)
0439 #define ACPI_DEBUG_ONLY_MEMBERS(a)
0440 #define ACPI_FUNCTION_NAME(a)
0441 #define ACPI_FUNCTION_TRACE(a)
0442 #define ACPI_FUNCTION_TRACE_PTR(a, b)
0443 #define ACPI_FUNCTION_TRACE_U32(a, b)
0444 #define ACPI_FUNCTION_TRACE_STR(a, b)
0445 #define ACPI_FUNCTION_ENTRY()
0446 #define ACPI_DUMP_STACK_ENTRY(a)
0447 #define ACPI_DUMP_OPERANDS(a, b, c)
0448 #define ACPI_DUMP_ENTRY(a, b)
0449 #define ACPI_DUMP_PATHNAME(a, b, c, d)
0450 #define ACPI_DUMP_BUFFER(a, b)
0451 #define ACPI_IS_DEBUG_ENABLED(level, component) 0
0452 #define ACPI_TRACE_POINT(a, b, c, d)
0453
0454
0455
0456 #define return_VOID return
0457 #define return_ACPI_STATUS(s) return(s)
0458 #define return_PTR(s) return(s)
0459 #define return_STR(s) return(s)
0460 #define return_VALUE(s) return(s)
0461 #define return_UINT8(s) return(s)
0462 #define return_UINT32(s) return(s)
0463
0464 #endif
0465
0466 #endif