Port-sparc64 archive

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

Re: Stack bias



On Tue, Aug 11, 2009 at 01:21:22PM -0400, der Mouse wrote:
> 
> Okay, here is part of the confusion.  To me, a leaf routine is one that
> does not call any others; depending on factors such as the complexity
> of the routine and the smartness of the compiler, this may or may not
> get compiled to code using save and restore.
> 
> I was actually talking about routines that _do_ save on entry and
> restore on exit, but which have no desire to refer to %sp.  But, based
> on what you say here, this is not safe because the kernel may want to
> spill user windows onto the stack, and will assume %o6/%sp indicates
> where to put them.  Have I finally got myself straightened out?

'save' is a subtract instruction that reads from the old window
and writes to the new. It is always(?) used to subtract from %sp
and thus writes to the new %o6.

For sparc(64) a leaf routine is specifically one that doesn't
do save/restore.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index