]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ARM: cache-v7: shift CLIDR to extract appropriate field before masking
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 3 Apr 2015 10:15:53 +0000 (11:15 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 3 Apr 2015 10:56:49 +0000 (11:56 +0100)
commite46cf43f4dd1df7a8d4487d298c1198d46b54bc7
treebf87c6e1347b0512643fc9b4863a6fa5cdf43740
parent869770bd3e49f203ba4831c065d4bbabbeb85674
ARM: cache-v7: shift CLIDR to extract appropriate field before masking

Rather than have code which masks and then shifts, such as:

mrc     p15, 1, r0, c0, c0, 1
ALT_SMP(ands r3, r0, #7 << 21)
ALT_UP( ands r3, r0, #7 << 27)
ALT_SMP(mov r3, r3, lsr #20)
ALT_UP( mov r3, r3, lsr #26)

re-arrange this as a shift and then mask.  The masking is the same for
each field which we want to extract, so this allows the mask to be
shared amongst code paths:

mrc     p15, 1, r0, c0, c0, 1
ALT_SMP(mov r3, r0, lsr #20)
ALT_UP( mov r3, r0, lsr #26)
ands r3, r3, #7 << 1

Use this method for the LoUIS, LoUU and LoC fields.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/cache-v7.S