[U-Boot] [RFC] powerpc/lib: unsafe register handling in wait_ticks
Joakim Tjernlund
joakim.tjernlund at transmode.se
Fri Jan 25 09:40:34 CET 2013
Wolfgang Denk <wd at denx.de> wrote on 2013/01/24 20:27:26:
>
> Dear Joakim Tjernlund,
>
> In message <OF52C94A3D.C3BD2E6F-ONC1257AFD.005BAFE0-C1257AFD.
> 006736C5 at transmode.se> you wrote:
> >
> > This adds some extra churn to the code that my patch didn't do.
> > On the other hand your patch makes the function look more
> > like how gcc would have done so I am fine with that.
> > However, I am not sure r14 is a good fit, I cannot remember if there
is
> > some
> > special purpose for r14. Hopefully somebody on the list knows.
>
> This is documented in the README:
>
> | For PowerPC, the following registers have specific use:
> | R1: stack pointer
> | R2: reserved for system use
> | R3-R4: parameter passing and return values
> | R5-R10: parameter passing
> | R13: small data area pointer
> | R30: GOT pointer
> | R31: frame pointer
> |
> | (U-Boot also uses R12 as internal GOT pointer. r12
> | is a volatile register so r12 needs to be reset when
> | going back and forth between asm and C)
> |
> | ==> U-Boot will use R2 to hold a pointer to the global data
> |
Right, then I think the patch is good:
Acked-by: Joakim Tjernlund <joakim.tjernlund at transmode.se>
More information about the U-Boot
mailing list