diff options
author | Brian Behlendorf <[email protected]> | 2018-07-11 13:10:40 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2018-07-11 13:10:40 -0700 |
commit | 33a19e0fd9b22364d295351ea1bda57b80e39e85 (patch) | |
tree | 1a0bf9708376d1a00e64dd5f8e23eb3bbcb739b9 /include/spl | |
parent | 2dca37d8dc13e6faf92c5a095d49dffd480c5b2d (diff) |
Fix kernel unaligned access on sparc64
Update the SA_COPY_DATA macro to check if architecture supports
efficient unaligned memory accesses at compile time. Otherwise
fallback to using the sa_copy_data() function.
The kernel provided CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is
used to determine availability in kernel space. In user space
the x86_64, x86, powerpc, and sometimes arm architectures will
define the HAVE_EFFICIENT_UNALIGNED_ACCESS macro.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #7642
Closes #7684
Diffstat (limited to 'include/spl')
-rw-r--r-- | include/spl/sys/isa_defs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/spl/sys/isa_defs.h b/include/spl/sys/isa_defs.h index 089ae0f85..1eb400277 100644 --- a/include/spl/sys/isa_defs.h +++ b/include/spl/sys/isa_defs.h @@ -210,6 +210,14 @@ #include <sys/byteorder.h> +/* + * CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS will be defined by the Linux + * kernel for architectures which support efficient unaligned access. + */ +#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) +#define HAVE_EFFICIENT_UNALIGNED_ACCESS +#endif + #if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN) #define _LITTLE_ENDIAN __LITTLE_ENDIAN #endif |