]> www.infradead.org Git - users/jedix/linux-maple.git/commit
New implementation for IO memcpy and IO memset
authorJulian Vetter <jvetter@kalrayinc.com>
Mon, 28 Oct 2024 13:42:24 +0000 (14:42 +0100)
committerArnd Bergmann <arnd@arndb.de>
Mon, 28 Oct 2024 21:44:29 +0000 (21:44 +0000)
commitb660d0a2acb9053d627befbb259a397d26aa9582
tree7315421775e6fe8c4ed5c3d7a06cd97c06f4989b
parentd4d3125a3452a54acca69050be67b87ee2900e77
New implementation for IO memcpy and IO memset

The IO memcpy and IO memset functions in asm-generic/io.h simply call
memcpy and memset. This can lead to alignment problems or faults on
architectures that do not define their own version and fall back to
these defaults.
This patch introduces new implementations for IO memcpy and IO memset,
that use read{l,q} accessor functions, align accesses to machine word
size, and resort to byte accesses when the target memory is not aligned.
For new architectures and existing ones that were using the old
fallbacks these functions are save to use, because IO memory constraints
are taken into account. Moreover, architectures with similar
implementations can now use these new versions, not needing to implement
their own.

Reviewed-by: Yann Sionneau <ysionneau@kalrayinc.com>
Signed-off-by: Julian Vetter <jvetter@kalrayinc.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
include/asm-generic/io.h
lib/Makefile
lib/iomem_copy.c [new file with mode: 0644]