]> git.karo-electronics.de Git - karo-tx-linux.git/commit
arm: optimized current_pt_regs()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 2 Aug 2012 07:49:43 +0000 (11:49 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 8 Sep 2012 06:48:05 +0000 (02:48 -0400)
commit257c75725e0e4b229730bfe61d3c69b14b754f7e
tree3a9937317cd4366553fa99a1e41cff9638c2909f
parentc4c29b2a764a07c0b1895692488ae7fea392f8b4
arm: optimized current_pt_regs()

... no need to read current_thread_info()->task only to
feed it to task_thread_page() immediately afterwards.
Moreover, not using current_thread_info() at all ends
up with better assembler - we need a location very close
to the top of kernel stack page and it's actually better
to do or with 0x1fff, followed be subtracting a small
constant than and with ~0x1fff, followed by adding a large
one.  Both & and | would be a couple of insns (mvn lsr/mvn lsl
for |, a pair of bic for &), but the following addition
would cost a pair of add while the subtraction ends up
as a single sub.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/arm/include/asm/ptrace.h