[U-Boot] powerpc/lib: fix unsafe register handling in wait_ticks

Tom Rini trini at ti.com
Mon Apr 8 18:27:22 CEST 2013


On Sun, Jan 27, 2013 at 07:03:44AM -0000, =?utf-8?b?TWF0cyBLw6Rycm1hbiA8TWF0cy5LYXJybWFuQHRyaXRlY2guc2U+?= wrote:

> 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: Mats Karrman <mats.karrman at tritech.se>
> Cc: Wolfgang Denk <wd at denx.de>
> Acked-by: Joakim Tjernlund <joakim.tjernlund at transmode.se>
> Tested-by: Stefan Roese <sr at denx.de>

This does not cleanly apply to u-boot/master, can you please resend
based on top of tree?  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130408/109da4e3/attachment.pgp>


More information about the U-Boot mailing list