Port-powerpc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: r13 in the kernel



On Sep 23, 2012, at 7:28 AM, Frank Wille wrote:

> Hi,
> 
> while debugging lock_stubs.S I realized that r13 is always assumed to
> contain the thread-id.
> 
> Is it really safe to do so? IIRC the V.4-ABI defines r13 as small data base
> register, but when small data is not used it should be a normal
> non-volatile register, like r14 - r31.
> The kernel is compiled with -msdata=none.

Yes.  From gcc rs6000.h:

On System V implementations, r13 is fixed and not available for use.

> What makes you sure that gcc's code generator wouldn't use r13 for storing
> non-volatile data during a function?


See above.


Home | Main Index | Thread Index | Old Index