diff options
Diffstat (limited to 'include/acpi/acmacros.h')
| -rw-r--r-- | include/acpi/acmacros.h | 145 |
1 files changed, 76 insertions, 69 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 09be937d2c39..702cc4e57f5f 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
| @@ -44,7 +44,6 @@ | |||
| 44 | #ifndef __ACMACROS_H__ | 44 | #ifndef __ACMACROS_H__ |
| 45 | #define __ACMACROS_H__ | 45 | #define __ACMACROS_H__ |
| 46 | 46 | ||
| 47 | |||
| 48 | /* | 47 | /* |
| 49 | * Data manipulation macros | 48 | * Data manipulation macros |
| 50 | */ | 49 | */ |
| @@ -57,7 +56,6 @@ | |||
| 57 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) | 56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) |
| 58 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) | 57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) |
| 59 | 58 | ||
| 60 | |||
| 61 | #if ACPI_MACHINE_WIDTH == 16 | 59 | #if ACPI_MACHINE_WIDTH == 16 |
| 62 | 60 | ||
| 63 | /* | 61 | /* |
| @@ -168,7 +166,7 @@ | |||
| 168 | 166 | ||
| 169 | /* 32-bit source, 16/32/64 destination */ | 167 | /* 32-bit source, 16/32/64 destination */ |
| 170 | 168 | ||
| 171 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 169 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
| 172 | 170 | ||
| 173 | #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\ | 171 | #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\ |
| 174 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\ | 172 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\ |
| @@ -183,9 +181,9 @@ | |||
| 183 | 181 | ||
| 184 | /* 64-bit source, 16/32/64 destination */ | 182 | /* 64-bit source, 16/32/64 destination */ |
| 185 | 183 | ||
| 186 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 184 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
| 187 | 185 | ||
| 188 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | 186 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ |
| 189 | 187 | ||
| 190 | #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\ | 188 | #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[7];\ |
| 191 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\ | 189 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[6];\ |
| @@ -219,14 +217,14 @@ | |||
| 219 | 217 | ||
| 220 | /* 32-bit source, 16/32/64 destination */ | 218 | /* 32-bit source, 16/32/64 destination */ |
| 221 | 219 | ||
| 222 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 220 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
| 223 | #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) | 221 | #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) |
| 224 | #define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) | 222 | #define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) |
| 225 | 223 | ||
| 226 | /* 64-bit source, 16/32/64 destination */ | 224 | /* 64-bit source, 16/32/64 destination */ |
| 227 | 225 | ||
| 228 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 226 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
| 229 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | 227 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ |
| 230 | #define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) | 228 | #define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s) |
| 231 | 229 | ||
| 232 | #else | 230 | #else |
| @@ -238,14 +236,14 @@ | |||
| 238 | 236 | ||
| 239 | /* 32-bit source, 16/32/64 destination */ | 237 | /* 32-bit source, 16/32/64 destination */ |
| 240 | 238 | ||
| 241 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 239 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
| 242 | #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) | 240 | #define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s) |
| 243 | #define ACPI_MOVE_32_TO_64(d,s) *(u64 *)(void *)(d) = *(u32 *)(void *)(s) | 241 | #define ACPI_MOVE_32_TO_64(d,s) *(u64 *)(void *)(d) = *(u32 *)(void *)(s) |
| 244 | 242 | ||
| 245 | /* 64-bit source, 16/32/64 destination */ | 243 | /* 64-bit source, 16/32/64 destination */ |
| 246 | 244 | ||
| 247 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 245 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
| 248 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | 246 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ |
| 249 | #define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) | 247 | #define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) |
| 250 | #endif | 248 | #endif |
| 251 | 249 | ||
| @@ -266,7 +264,7 @@ | |||
| 266 | 264 | ||
| 267 | /* 32-bit source, 16/32/64 destination */ | 265 | /* 32-bit source, 16/32/64 destination */ |
| 268 | 266 | ||
| 269 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 267 | #define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
| 270 | 268 | ||
| 271 | #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ | 269 | #define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ |
| 272 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ | 270 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ |
| @@ -277,8 +275,8 @@ | |||
| 277 | 275 | ||
| 278 | /* 64-bit source, 16/32/64 destination */ | 276 | /* 64-bit source, 16/32/64 destination */ |
| 279 | 277 | ||
| 280 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ | 278 | #define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ |
| 281 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ | 279 | #define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ |
| 282 | #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ | 280 | #define ACPI_MOVE_64_TO_64(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[0];\ |
| 283 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ | 281 | (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[1];\ |
| 284 | (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ | 282 | (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[2];\ |
| @@ -305,7 +303,6 @@ | |||
| 305 | #error unknown ACPI_MACHINE_WIDTH | 303 | #error unknown ACPI_MACHINE_WIDTH |
| 306 | #endif | 304 | #endif |
| 307 | 305 | ||
| 308 | |||
| 309 | /* | 306 | /* |
| 310 | * Fast power-of-two math macros for non-optimized compilers | 307 | * Fast power-of-two math macros for non-optimized compilers |
| 311 | */ | 308 | */ |
| @@ -329,7 +326,6 @@ | |||
| 329 | #define ACPI_MUL_16(a) _ACPI_MUL(a,4) | 326 | #define ACPI_MUL_16(a) _ACPI_MUL(a,4) |
| 330 | #define ACPI_MOD_16(a) _ACPI_MOD(a,16) | 327 | #define ACPI_MOD_16(a) _ACPI_MOD(a,16) |
| 331 | 328 | ||
| 332 | |||
| 333 | /* | 329 | /* |
| 334 | * Rounding macros (Power of two boundaries only) | 330 | * Rounding macros (Power of two boundaries only) |
| 335 | */ | 331 | */ |
| @@ -344,7 +340,6 @@ | |||
| 344 | #define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) | 340 | #define ACPI_ROUND_UP_to_64_bITS(a) ACPI_ROUND_UP(a,8) |
| 345 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) | 341 | #define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a,ALIGNED_ADDRESS_BOUNDARY) |
| 346 | 342 | ||
| 347 | |||
| 348 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) | 343 | #define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7) |
| 349 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) | 344 | #define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a)) |
| 350 | 345 | ||
| @@ -365,7 +360,6 @@ | |||
| 365 | 360 | ||
| 366 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) | 361 | #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) |
| 367 | 362 | ||
| 368 | |||
| 369 | /* Bitfields within ACPI registers */ | 363 | /* Bitfields within ACPI registers */ |
| 370 | 364 | ||
| 371 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) | 365 | #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) |
| @@ -381,7 +375,6 @@ | |||
| 381 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) | 375 | #define ACPI_GET_DESCRIPTOR_TYPE(d) (((union acpi_descriptor *)(void *)(d))->descriptor_id) |
| 382 | #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) | 376 | #define ACPI_SET_DESCRIPTOR_TYPE(d,t) (((union acpi_descriptor *)(void *)(d))->descriptor_id = t) |
| 383 | 377 | ||
| 384 | |||
| 385 | /* Macro to test the object type */ | 378 | /* Macro to test the object type */ |
| 386 | 379 | ||
| 387 | #define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type) | 380 | #define ACPI_GET_OBJECT_TYPE(d) (((union acpi_operand_object *)(void *)(d))->common.type) |
| @@ -430,28 +423,28 @@ | |||
| 430 | #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) | 423 | #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) |
| 431 | #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) | 424 | #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) |
| 432 | 425 | ||
| 433 | |||
| 434 | /* | 426 | /* |
| 435 | * Reporting macros that are never compiled out | 427 | * Reporting macros that are never compiled out |
| 436 | */ | 428 | */ |
| 437 | #define ACPI_PARAM_LIST(pl) pl | 429 | #define ACPI_PARAM_LIST(pl) pl |
| 438 | 430 | ||
| 439 | /* | 431 | /* |
| 440 | * Error reporting. These versions add callers module and line#. Since | 432 | * Error reporting. These versions add callers module and line#. |
| 441 | * _THIS_MODULE gets compiled out when ACPI_DEBUG_OUTPUT isn't defined, only | 433 | * |
| 442 | * use it in debug mode. | 434 | * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT |
| 435 | * isn't defined, only use it in debug mode. | ||
| 443 | */ | 436 | */ |
| 444 | #ifdef ACPI_DEBUG_OUTPUT | 437 | #ifdef ACPI_DEBUG_OUTPUT |
| 445 | 438 | ||
| 446 | #define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_THIS_MODULE,__LINE__,_COMPONENT); \ | 439 | #define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \ |
| 447 | acpi_os_printf ACPI_PARAM_LIST(fp);} | 440 | acpi_os_printf ACPI_PARAM_LIST(fp);} |
| 448 | #define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_THIS_MODULE,__LINE__,_COMPONENT); \ | 441 | #define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \ |
| 449 | acpi_os_printf ACPI_PARAM_LIST(fp);} | 442 | acpi_os_printf ACPI_PARAM_LIST(fp);} |
| 450 | #define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_THIS_MODULE,__LINE__,_COMPONENT); \ | 443 | #define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \ |
| 451 | acpi_os_printf ACPI_PARAM_LIST(fp);} | 444 | acpi_os_printf ACPI_PARAM_LIST(fp);} |
| 452 | #define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_THIS_MODULE,__LINE__,_COMPONENT, s, e); | 445 | #define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e); |
| 453 | 446 | ||
| 454 | #define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_THIS_MODULE,__LINE__,_COMPONENT, s, n, p, e); | 447 | #define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e); |
| 455 | 448 | ||
| 456 | #else | 449 | #else |
| 457 | 450 | ||
| @@ -480,36 +473,58 @@ | |||
| 480 | * Debug macros that are conditionally compiled | 473 | * Debug macros that are conditionally compiled |
| 481 | */ | 474 | */ |
| 482 | #ifdef ACPI_DEBUG_OUTPUT | 475 | #ifdef ACPI_DEBUG_OUTPUT |
| 476 | #define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; | ||
| 483 | 477 | ||
| 484 | #define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_THIS_MODULE = name; | 478 | /* |
| 479 | * Common parameters used for debug output functions: | ||
| 480 | * line number, function name, module(file) name, component ID | ||
| 481 | */ | ||
| 482 | #define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | ||
| 485 | 483 | ||
| 486 | /* | 484 | /* |
| 487 | * Function entry tracing. | 485 | * Function entry tracing |
| 488 | * The first parameter should be the procedure name as a quoted string. This is declared | 486 | */ |
| 489 | * as a local string ("_proc_name) so that it can be also used by the function exit macros below. | 487 | |
| 488 | /* | ||
| 489 | * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header, | ||
| 490 | * define it now. This is the case where there the compiler does not support | ||
| 491 | * a __FUNCTION__ macro or equivalent. We save the function name on the | ||
| 492 | * local stack. | ||
| 493 | */ | ||
| 494 | #ifndef ACPI_GET_FUNCTION_NAME | ||
| 495 | #define ACPI_GET_FUNCTION_NAME _acpi_function_name | ||
| 496 | /* | ||
| 497 | * The Name parameter should be the procedure name as a quoted string. | ||
| 498 | * This is declared as a local string ("my_function_name") so that it can | ||
| 499 | * be also used by the function exit macros below. | ||
| 500 | * Note: (const char) is used to be compatible with the debug interfaces | ||
| 501 | * and macros such as __FUNCTION__. | ||
| 490 | */ | 502 | */ |
| 491 | #define ACPI_FUNCTION_NAME(a) struct acpi_debug_print_info _debug_info; \ | 503 | #define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = name; |
| 492 | _debug_info.component_id = _COMPONENT; \ | 504 | |
| 493 | _debug_info.proc_name = a; \ | 505 | #else |
| 494 | _debug_info.module_name = _THIS_MODULE; | 506 | /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ |
| 495 | 507 | ||
| 496 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ | 508 | #define ACPI_FUNCTION_NAME(name) |
| 497 | acpi_ut_trace(__LINE__,&_debug_info) | 509 | #endif |
| 498 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ | 510 | |
| 499 | acpi_ut_trace_ptr(__LINE__,&_debug_info,(void *)b) | 511 | #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ |
| 500 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ | 512 | acpi_ut_trace(ACPI_DEBUG_PARAMETERS) |
| 501 | acpi_ut_trace_u32(__LINE__,&_debug_info,(u32)b) | 513 | #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ |
| 502 | #define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ | 514 | acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) |
| 503 | acpi_ut_trace_str(__LINE__,&_debug_info,(char *)b) | 515 | #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ |
| 504 | 516 | acpi_ut_trace_u32(ACPI_DEBUG_PARAMETERS,(u32)b) | |
| 505 | #define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() | 517 | #define ACPI_FUNCTION_TRACE_STR(a,b) ACPI_FUNCTION_NAME(a) \ |
| 518 | acpi_ut_trace_str(ACPI_DEBUG_PARAMETERS,(char *)b) | ||
| 519 | |||
| 520 | #define ACPI_FUNCTION_ENTRY() acpi_ut_track_stack_ptr() | ||
| 506 | 521 | ||
| 507 | /* | 522 | /* |
| 508 | * Function exit tracing. | 523 | * Function exit tracing. |
| 509 | * WARNING: These macros include a return statement. This is usually considered | 524 | * WARNING: These macros include a return statement. This is usually considered |
| 510 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. | 525 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. |
| 511 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros | 526 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros |
| 512 | * so that "_proc_name" is defined. | 527 | * so that "_acpi_function_name" is defined. |
| 513 | */ | 528 | */ |
| 514 | #ifdef ACPI_USE_DO_WHILE_0 | 529 | #ifdef ACPI_USE_DO_WHILE_0 |
| 515 | #define ACPI_DO_WHILE0(a) do a while(0) | 530 | #define ACPI_DO_WHILE0(a) do a while(0) |
| @@ -517,10 +532,10 @@ | |||
| 517 | #define ACPI_DO_WHILE0(a) a | 532 | #define ACPI_DO_WHILE0(a) a |
| 518 | #endif | 533 | #endif |
| 519 | 534 | ||
| 520 | #define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(__LINE__,&_debug_info);return;}) | 535 | #define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;}) |
| 521 | #define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(__LINE__,&_debug_info,(s));return((s));}) | 536 | #define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));}) |
| 522 | #define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(__LINE__,&_debug_info,(acpi_integer)(s));return((s));}) | 537 | #define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));}) |
| 523 | #define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(__LINE__,&_debug_info,(u8 *)(s));return((s));}) | 538 | #define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));}) |
| 524 | 539 | ||
| 525 | /* Conditional execution */ | 540 | /* Conditional execution */ |
| 526 | 541 | ||
| @@ -531,12 +546,10 @@ | |||
| 531 | #define ACPI_DEBUG_ONLY_MEMBERS(a) a; | 546 | #define ACPI_DEBUG_ONLY_MEMBERS(a) a; |
| 532 | #define _VERBOSE_STRUCTURES | 547 | #define _VERBOSE_STRUCTURES |
| 533 | 548 | ||
| 534 | |||
| 535 | /* Stack and buffer dumping */ | 549 | /* Stack and buffer dumping */ |
| 536 | 550 | ||
| 537 | #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) | 551 | #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a),0) |
| 538 | #define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_THIS_MODULE,__LINE__) | 552 | #define ACPI_DUMP_OPERANDS(a,b,c,d,e) acpi_ex_dump_operands(a,b,c,d,e,_acpi_module_name,__LINE__) |
| 539 | |||
| 540 | 553 | ||
| 541 | #define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) | 554 | #define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) |
| 542 | #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) | 555 | #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) |
| @@ -544,7 +557,6 @@ | |||
| 544 | #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) | 557 | #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) |
| 545 | #define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) | 558 | #define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) |
| 546 | 559 | ||
| 547 | |||
| 548 | /* | 560 | /* |
| 549 | * Generate INT3 on ACPI_ERROR (Debug only!) | 561 | * Generate INT3 on ACPI_ERROR (Debug only!) |
| 550 | */ | 562 | */ |
| @@ -565,14 +577,13 @@ | |||
| 565 | #define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) | 577 | #define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) |
| 566 | #define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) | 578 | #define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) |
| 567 | 579 | ||
| 568 | |||
| 569 | #else | 580 | #else |
| 570 | /* | 581 | /* |
| 571 | * This is the non-debug case -- make everything go away, | 582 | * This is the non-debug case -- make everything go away, |
| 572 | * leaving no executable debug code! | 583 | * leaving no executable debug code! |
| 573 | */ | 584 | */ |
| 574 | #define ACPI_MODULE_NAME(name) | 585 | #define ACPI_MODULE_NAME(name) |
| 575 | #define _THIS_MODULE "" | 586 | #define _acpi_module_name "" |
| 576 | 587 | ||
| 577 | #define ACPI_DEBUG_EXEC(a) | 588 | #define ACPI_DEBUG_EXEC(a) |
| 578 | #define ACPI_NORMAL_EXEC(a) a; | 589 | #define ACPI_NORMAL_EXEC(a) a; |
| @@ -616,7 +627,6 @@ | |||
| 616 | #define ACPI_DEBUGGER_EXEC(a) | 627 | #define ACPI_DEBUGGER_EXEC(a) |
| 617 | #endif | 628 | #endif |
| 618 | 629 | ||
| 619 | |||
| 620 | /* | 630 | /* |
| 621 | * For 16-bit code, we want to shrink some things even though | 631 | * For 16-bit code, we want to shrink some things even though |
| 622 | * we are using ACPI_DEBUG_OUTPUT to get the debug output | 632 | * we are using ACPI_DEBUG_OUTPUT to get the debug output |
| @@ -627,7 +637,6 @@ | |||
| 627 | #define ACPI_DEBUG_ONLY_MEMBERS(a) | 637 | #define ACPI_DEBUG_ONLY_MEMBERS(a) |
| 628 | #endif | 638 | #endif |
| 629 | 639 | ||
| 630 | |||
| 631 | #ifdef ACPI_DEBUG_OUTPUT | 640 | #ifdef ACPI_DEBUG_OUTPUT |
| 632 | /* | 641 | /* |
| 633 | * 1) Set name to blanks | 642 | * 1) Set name to blanks |
| @@ -640,7 +649,6 @@ | |||
| 640 | #define ACPI_ADD_OBJECT_NAME(a,b) | 649 | #define ACPI_ADD_OBJECT_NAME(a,b) |
| 641 | #endif | 650 | #endif |
| 642 | 651 | ||
| 643 | |||
| 644 | /* | 652 | /* |
| 645 | * Memory allocation tracking (DEBUG ONLY) | 653 | * Memory allocation tracking (DEBUG ONLY) |
| 646 | */ | 654 | */ |
| @@ -648,21 +656,20 @@ | |||
| 648 | 656 | ||
| 649 | /* Memory allocation */ | 657 | /* Memory allocation */ |
| 650 | 658 | ||
| 651 | #define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) | 659 | #define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) |
| 652 | #define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) | 660 | #define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) |
| 653 | #define ACPI_MEM_FREE(a) acpi_os_free(a) | 661 | #define ACPI_MEM_FREE(a) acpi_os_free(a) |
| 654 | #define ACPI_MEM_TRACKING(a) | 662 | #define ACPI_MEM_TRACKING(a) |
| 655 | 663 | ||
| 656 | |||
| 657 | #else | 664 | #else |
| 658 | 665 | ||
| 659 | /* Memory allocation */ | 666 | /* Memory allocation */ |
| 660 | 667 | ||
| 661 | #define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_THIS_MODULE,__LINE__) | 668 | #define ACPI_MEM_ALLOCATE(a) acpi_ut_allocate_and_track((acpi_size)(a),_COMPONENT,_acpi_module_name,__LINE__) |
| 662 | #define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_THIS_MODULE,__LINE__) | 669 | #define ACPI_MEM_CALLOCATE(a) acpi_ut_callocate_and_track((acpi_size)(a), _COMPONENT,_acpi_module_name,__LINE__) |
| 663 | #define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_THIS_MODULE,__LINE__) | 670 | #define ACPI_MEM_FREE(a) acpi_ut_free_and_track(a,_COMPONENT,_acpi_module_name,__LINE__) |
| 664 | #define ACPI_MEM_TRACKING(a) a | 671 | #define ACPI_MEM_TRACKING(a) a |
| 665 | 672 | ||
| 666 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ | 673 | #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ |
| 667 | 674 | ||
| 668 | #endif /* ACMACROS_H */ | 675 | #endif /* ACMACROS_H */ |
