kernel: Move arches with efficient unaligned access.
PATCH 2/8 kernel: Move arches with efficient unaligned access.
cris, m68k, mn10300, powerpc, s390, and x86 have efficient unaligned access. Change their asm includes.
Signed-off-by Harvey Harrison <[email protected]>
--- include/asm-cris/unaligned.h | 8 +-- include/asm-m68k/unaligned.h | 9 +--- include/asm-mn10300/unaligned.h | 126 +-------------------------------------- include/asm-powerpc/unaligned.h | 9 +--- include/asm-s390/unaligned.h | 9 +--- include/asm-x86/unaligned.h | 30 +--------- 6 files changed, 8 insertions(+), 183 deletions(-)
include/asm-cris/unaligned.h +1 -7
@@ -3,14 +3,8 @@/* * CRIS can do unaligned accesses itself. -* -* The strange macros are there to make sure these can't -* be misused in a way that makes them not work on other -* architectures where unaligned accesses aren't as simple. */ -#define get_unaligned (ptr) (*(ptr)) - -#define put_unaligned (val, ptr) ((void)( *(ptr) = (val) )) +#include <linux/unaligned/access_ok.h> #endif
include/asm-m68k/unaligned.h +1 -8
@@ -3,14 +3,7 @@/* * The m68k can do unaligned accesses itself. -* -* The strange macros are there to make sure these can't -* be misused in a way that makes them not work on other -* architectures where unaligned accesses aren't as simple. */ - -#define get_unaligned (ptr) (*(ptr)) - -#define put_unaligned (val, ptr) ((void)( *(ptr) = (val) )) +#include <linux/unaligned/access_ok.h> #endif
include/asm-mn10300/unaligned.h +3 -123
132 lines not on this page · raw message
include/asm-powerpc/unaligned.h +1 -8
@@ -5,15 +5,8 @@/* * The PowerPC can do unaligned accesses itself in big endian mode. -* -* The strange macros are there to make sure these can't -* be misused in a way that makes them not work on other -* architectures where unaligned accesses aren't as simple. */ - -#define get_unaligned (ptr) (*(ptr)) - -#define put_unaligned (val, ptr) ((void)( *(ptr) = (val) )) +#include <linux/unaligned/access_ok.h> #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_UNALIGNED_H */
include/asm-s390/unaligned.h +1 -8
@@ -11,14 +11,7 @@/* * The S390 can do unaligned accesses itself. -* -* The strange macros are there to make sure these can't -* be misused in a way that makes them not work on other -* architectures where unaligned accesses aren't as simple. */ - -#define get_unaligned (ptr) (*(ptr)) - -#define put_unaligned (val, ptr) ((void)( *(ptr) = (val) )) +#include <linux/unaligned/access_ok.h> #endif
include/asm-x86/unaligned.h +1 -29
@@ -3,35 +3,7 @@/* * The x86 can do unaligned accesses itself. -* -* The strange macros are there to make sure these can't -* be misused in a way that makes them not work on other -* architectures where unaligned accesses aren't as simple. */ - -/** -* get_unaligned - get value from possibly mis-aligned location -* @ptr: pointer to value -* -* This macro should be used for accessing values larger in size than -* single bytes at locations that are expected to be improperly aligned, -* e.g. retrieving a u16 value from a location not u16-aligned. -* -* Note that unaligned accesses can be very expensive on some architectures. -*/ -#define get_unaligned (ptr) (*(ptr)) - -/** -* put_unaligned - put value to a possibly mis-aligned location -* @val: value to place -* @ptr: pointer to location -* -* This macro should be used for placing values larger in size than -* single bytes at locations that are expected to be improperly aligned, -* e.g. writing a u16 value to a location not u16-aligned. -* -* Note that unaligned accesses can be very expensive on some architectures. -*/ -#define put_unaligned (val, ptr) ((void)( *(ptr) = (val) )) +#include <linux/unaligned/access_ok.h> #endif /* _ASM_X86_UNALIGNED_H */
Signature · 1 line
1.5.5.144.g3e42