OSDN Git Service

ARM: proc-arm94*.S: fix setup function
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 4 Apr 2015 22:22:07 +0000 (23:22 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 10 Apr 2015 09:52:41 +0000 (10:52 +0100)
commit6c5c2a01fcfdb70f2e95e30e96ccf53b88e81023
tree43270eb85618290754b284806a66ff1bbb6d0223
parentf6ac49ba29499387e12e864a22e6d4bf46dafe9b
ARM: proc-arm94*.S: fix setup function

Both ARM946 and ARM940 setup functions were corrupting r1 and r2,
which is not permissible - these are used to carry the machine ID
and boot data into the kernel, and must be preserved.

The code responsible for this was the same in both files: they were
using the registers to generate a protection region register value.

Fix this by turning this process into a macro, and using that macro
in both these files with an alternative register allocation.  r0,
r3 and r7 can be used for temporary values here.

Reported-by: Alex Dumitrache <broscutamaker@gmail.com>
Tested-by: Georg Hofstetter <g3gg0.de@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/proc-arm940.S
arch/arm/mm/proc-arm946.S
arch/arm/mm/proc-macros.S