freebsd-dev/stand/arm/uboot
Ian Lepore 12b92a343c Save and restore r9 register in arm ubldr. In old gcc 4.2, r9 was a callee-
saved register, but in arm EABI it may be either callee-saved or dedicated
to some special purpose (such as a TLS pointer).  It appears clang does not
treat it as a callee-saved register (instead using it as another work
register, similar to r12).

Another important side effect of these changes is that saving an extra
register in the push/pop statements keeps the stack aligned to an 8-byte
boundary during the self_reloc() call, as it always should have been.

As stated in the PR...

Essentially the important caller-saved registers are pushed (r0, r1, r9, lr)
before the relocation call, and popped after.  Then r8/r9 are saved as usual
for the syscall trampoline, and lr is stored in r8 (now free) as a
callee-saved value before calling into `main`.

The call to `main` can no longer be a tail call because we must restore r9
especially after main returns (although since we have used r8 to hold lr we
must also restore this).

PR:		224008
2017-12-10 21:51:27 +00:00
..
conf.c
help.uboot
ldscript.arm
Makefile Move some more common stuff up to Makefile.inc. In particular, the no 2017-11-20 22:42:17 +00:00
start.S Save and restore r9 register in arm ubldr. In old gcc 4.2, r9 was a callee- 2017-12-10 21:51:27 +00:00
version