[parisc-linux] parisc64 kernel and ret1 (gr29) setup

Richard Hirst rhirst@linuxcare.com
Sun, 11 Feb 2001 23:03:30 +0000


On Sun, Feb 11, 2001 at 11:09:32PM +1100, Alan Modra wrote:
> On Wed, 7 Feb 2001, Richard Hirst wrote:
> 
> > On Tue, Jan 23, 2001 at 01:45:45PM +0000, Richard Hirst wrote:
> > > Presumably r29 needs initialising on every call from entry.S and syscall.S
> > > to C code, but I'm not over confident about that, so I thought I'd let
> > > others see my diff so far.  Comments?
> > 
> > So, I committed that diff, and have been looking at what happens
> > w.r.t. stack frame setup on interrupts.  All we seem to do is to
> > set sp to the top of task_struct (if in a user context), or move
> > sp up by a struct pt_regs if in kernel space.  In both cases,
> > those values are rounded up (TASK_SZ_ALGN and PT_SZ_ALIGN), so
> > there would probably be some space below sp, but should get_stack
> > be explicity allocating a stack frame really?
> 
> This is a bit interesting.  A called procedure can write into certain
> parts of the caller's stack frame, so we should certainly be allocating
> space for these areas.

We now allocate 64 bytes for 32 bit kernels and 128 bytes for 64 bit
kernels.  In fact, (as jsm pointed out to me) the align macro in
arch/parisc/tools/offset.c allowed for a stack frame in its rounding
up already.  It used to always allow only 64 bytes, but I've changed that
to allow 64 or 128 bytes as required.

Richard