linux/arch/arc
Jose Abreu 10d443431d ARC: io.h: Implement reads{x}()/writes{x}()
Some ARC CPU's do not support unaligned loads/stores. Currently, generic
implementation of reads{b/w/l}()/writes{b/w/l}() is being used with ARC.
This can lead to misfunction of some drivers as generic functions do a
plain dereference of a pointer that can be unaligned.

Let's use {get/put}_unaligned() helpers instead of plain dereference of
pointer in order to fix. The helpers allow to get and store data from an
unaligned address whilst preserving the CPU internal alignment.
According to [1], the use of these helpers are costly in terms of
performance so we added an initial check for a buffer already aligned so
that the usage of the helpers can be avoided, when possible.

[1] Documentation/unaligned-memory-access.txt

Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David Laight <David.Laight@ACULAB.COM>
Tested-by: Vitor Soares <soares@synopsys.com>
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2018-11-30 11:26:29 -08:00
..
boot ARC: [plat-hsdk] Enable DW APB GPIO support 2018-11-12 10:38:27 -08:00
configs ARC: change defconfig defaults to ARCv2 2018-11-30 10:54:01 -08:00
include ARC: io.h: Implement reads{x}()/writes{x}() 2018-11-30 11:26:29 -08:00
kernel ARCv2: boot log unaligned access in use 2018-11-12 10:38:27 -08:00
lib
mm ARC: mm: fix uninitialised signal code in do_page_fault 2018-11-12 10:38:27 -08:00
oprofile
plat-axs10x
plat-eznps arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c 2018-07-30 11:48:49 -07:00
plat-hsdk ARCv2: [plat-hsdk]: Save accl reg pair by default 2018-07-19 10:36:45 -07:00
plat-sim
plat-tb10x
Kbuild
Kconfig ARC: change defconfig defaults to ARCv2 2018-11-30 10:54:01 -08:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile ARC: change defconfig defaults to ARCv2 2018-11-30 10:54:01 -08:00