Skip to content
Snippets Groups Projects
Commit fac150e8 authored by Mats Kärrman's avatar Mats Kärrman Committed by Tom Rini
Browse files

powerpc/lib: fix unsafe register handling in wait_ticks


If watchdog is enabled, the arch/powerpc/lib/ticks.S::wait_ticks() function
calls the function specified by the WATCHDOG_RESET macro.
The wait_ticks function depends on the registers r0, r6 and r7 being
preserved however that is not guaranteed, e.g. if the reset function is a
C function this will probably overwrite r0 and cause an endless loop.

The following patch changes to using r14+r15 instead of r6+r7 (to resemble
what would have been generated by a C compiler) and saves all necessary
registers on the stack.

The patch has been tested on a custom MPC5125 based machine using the 512x
powerpc architecture.

Signed-off-by: default avatarMats Karrman <mats.karrman@tritech.se>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: default avatarJoakim Tjernlund <joakim.tjernlund@transmode.se>
Tested-by: default avatarStefan Roese <sr@denx.de>
parent 645b271a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment