From: Bob Moore Date: Wed, 31 Oct 2012 02:27:40 +0000 (+0000) Subject: ACPICA: Add ACPI_MOVE_NAME macro to optimize 4-byte ACPI_NAME copies X-Git-Tag: upstream/snapshot3+hdmi~6139^2~14^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff60027174cf94bab6d4f45ab5c5da1de63b7d1b;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 1fa6ba1..d1fb674 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -453,10 +453,14 @@ typedef u64 acpi_integer; #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) +/* Optimizations for 4-character (32-bit) acpi_name manipulation */ + #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) +#define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src))) #else #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) +#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) #endif /*******************************************************************************