u-boot/arch/powerpc/lib
Mats Kärrman fac150e83f 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: Mats Karrman <mats.karrman@tritech.se>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Tested-by: Stefan Roese <sr@denx.de>
2013-04-10 10:31:02 -04:00
..
Makefile ppc: Enable generic board support 2013-03-15 16:14:00 -04:00
_ashldi3.S powerpc: Minimal private libgcc to build on Debian 2011-12-07 23:04:32 +01:00
_ashrdi3.S powerpc: Minimal private libgcc to build on Debian 2011-12-07 23:04:32 +01:00
_lshrdi3.S powerpc: Minimal private libgcc to build on Debian 2011-12-07 23:04:32 +01:00
bat_rw.c arch/powerpc/lib/bat_rw.c: Fix GCC 4.6 build warning 2011-11-07 22:16:55 +01:00
board.c Introduce generic post-relocation board_r.c 2013-03-15 16:13:59 -04:00
bootm.c Clean up libfdt.h includes 2013-02-08 22:32:38 -05:00
cache.c Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
extable.c arch/powerpc/lib/extable.c: sparse fix 2012-11-04 11:00:35 -07:00
ide.c split mpc8xx hooks from cmd_ide.c 2012-10-17 07:59:08 -07:00
ide.h split mpc8xx hooks from cmd_ide.c 2012-10-17 07:59:08 -07:00
interrupts.c Timer: Remove reset_timer() for non-Nios2 arches 2011-07-26 14:53:30 +02:00
kgdb.c powerpc: fix register usage in some inline assembly code 2010-12-17 21:18:08 +01:00
memcpy_mpc5200.c MPC512x: workaround data corruption for unaligned local bus accesses 2010-06-29 14:41:37 +02:00
ppccache.S Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
ppcstring.S Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
reloc.S Move arch/ppc to arch/powerpc 2010-04-21 23:42:38 +02:00
spl.c SPL: Port SPL framework to powerpc 2012-12-05 17:30:22 +01:00
ticks.S powerpc/lib: fix unsafe register handling in wait_ticks 2013-04-10 10:31:02 -04:00
time.c powerpc: fix register usage in some inline assembly code 2010-12-17 21:18:08 +01:00