diff options
Diffstat (limited to 'include/acpi/acmacros.h')
-rw-r--r-- | include/acpi/acmacros.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 60ceed4c81bf..b7547aba91b9 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h | |||
@@ -56,6 +56,10 @@ | |||
56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) | 56 | #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) |
57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) | 57 | #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) |
58 | 58 | ||
59 | /* Size calculation */ | ||
60 | |||
61 | #define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) | ||
62 | |||
59 | #if ACPI_MACHINE_WIDTH == 16 | 63 | #if ACPI_MACHINE_WIDTH == 16 |
60 | 64 | ||
61 | /* | 65 | /* |
@@ -143,7 +147,7 @@ | |||
143 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | 147 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED |
144 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b))) | 148 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b))) |
145 | #else | 149 | #else |
146 | #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char,(a)), ACPI_CAST_PTR (char,(b)), 4)) | 150 | #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char,(a)), ACPI_CAST_PTR (char,(b)), ACPI_NAME_SIZE)) |
147 | #endif | 151 | #endif |
148 | 152 | ||
149 | /* | 153 | /* |
@@ -522,12 +526,12 @@ | |||
522 | #define ACPI_GET_FUNCTION_NAME _acpi_function_name | 526 | #define ACPI_GET_FUNCTION_NAME _acpi_function_name |
523 | /* | 527 | /* |
524 | * The Name parameter should be the procedure name as a quoted string. | 528 | * The Name parameter should be the procedure name as a quoted string. |
525 | * This is declared as a local string ("my_function_name") so that it can | 529 | * This is declared as a local string ("MyFunctionName") so that it can |
526 | * be also used by the function exit macros below. | 530 | * be also used by the function exit macros below. |
527 | * Note: (const char) is used to be compatible with the debug interfaces | 531 | * Note: (const char) is used to be compatible with the debug interfaces |
528 | * and macros such as __FUNCTION__. | 532 | * and macros such as __FUNCTION__. |
529 | */ | 533 | */ |
530 | #define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = name; | 534 | #define ACPI_FUNCTION_NAME(name) const char *_acpi_function_name = #name; |
531 | 535 | ||
532 | #else | 536 | #else |
533 | /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ | 537 | /* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */ |
@@ -551,7 +555,7 @@ | |||
551 | * WARNING: These macros include a return statement. This is usually considered | 555 | * WARNING: These macros include a return statement. This is usually considered |
552 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. | 556 | * bad form, but having a separate exit macro is very ugly and difficult to maintain. |
553 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros | 557 | * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros |
554 | * so that "_acpi_function_name" is defined. | 558 | * so that "_AcpiFunctionName" is defined. |
555 | * | 559 | * |
556 | * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining | 560 | * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining |
557 | * about these constructs. | 561 | * about these constructs. |