diff options
author | Bob Moore <robert.moore@intel.com> | 2012-10-30 22:27:40 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-14 18:31:28 -0500 |
commit | ff60027174cf94bab6d4f45ab5c5da1de63b7d1b (patch) | |
tree | 22bfe2ea1113c0f4f5510c78ccf21d5960b92dbf /include/acpi | |
parent | d8da9151bb7e2d18624fdd8dbb066419186f0ec1 (diff) |
ACPICA: Add ACPI_MOVE_NAME macro to optimize 4-byte ACPI_NAME copies
Resolves to a 32-bit move for the normal case, strncpy on machines
that do not support misaligned transfers.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/actypes.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 1fa6ba123071..d1fb674fd393 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
@@ -453,10 +453,14 @@ typedef u64 acpi_integer; | |||
453 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) | 453 | #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) |
454 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) | 454 | #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) |
455 | 455 | ||
456 | /* Optimizations for 4-character (32-bit) acpi_name manipulation */ | ||
457 | |||
456 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED | 458 | #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED |
457 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) | 459 | #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) |
460 | #define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src))) | ||
458 | #else | 461 | #else |
459 | #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) | 462 | #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) |
463 | #define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) | ||
460 | #endif | 464 | #endif |
461 | 465 | ||
462 | /******************************************************************************* | 466 | /******************************************************************************* |