]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: 7449/1: use generic strnlen_user and strncpy_from_user functions
authorWill Deacon <will.deacon@arm.com>
Fri, 6 Jul 2012 14:45:39 +0000 (15:45 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 9 Jul 2012 16:41:11 +0000 (17:41 +0100)
commit8c56cc8be5b38e3684eba96dc9b3f7ca7e495755
treeeccb882c8c5f1cc81fc226c769fc9ec99a45145b
parent4295b898f5a5c7e62ae68e7a4ecc4b414622ffe6
ARM: 7449/1: use generic strnlen_user and strncpy_from_user functions

This patch implements the word-at-a-time interface for ARM using the
same algorithm as x86. We use the fls macro from ARMv5 onwards, where
we have a clz instruction available which saves us a mov instruction
when targetting Thumb-2. For older CPUs, we use the magic 0x0ff0001
constant. Big-endian configurations make use of the implementation from
asm-generic.

With this implemented, we can replace our byte-at-a-time strnlen_user
and strncpy_from_user functions with the optimised generic versions.

Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/Kconfig
arch/arm/include/asm/uaccess.h
arch/arm/include/asm/word-at-a-time.h [new file with mode: 0644]
arch/arm/kernel/armksyms.c
arch/arm/lib/Makefile
arch/arm/lib/strncpy_from_user.S [deleted file]
arch/arm/lib/strnlen_user.S [deleted file]