Subject: Re: Adding a size parameter to stackgap_init()
To: None <tech-kern@netbsd.org>
From: Wolfgang Solfrank <ws@tools.de>
List: tech-kern
Date: 03/17/2002 23:16:24
Hi,

> >How could we implement stackgap differently? The only idea that comes to
> >me is to use the bottom of the stack (I mean where sp point to). But
> >there must be a reason why it is not done that way. What is the
> >drawback?
> 
> That is what I meant. I don't know what the drawback is.

The problem with this approach is that you don't know what is below the
sp
(ignoring for now that there are stacks growing up; sorry couldn't
resist ;-O).

sp might point to just some place where you stored the parameters for
the
system call.  There are even some architectures (which we support) that
don't
have a real sp, but (for programs written in a language that depends on
a stack)
simulate one by using an ordinary register.

IMHO it would be a serious drawback to limit the layout of memory to the
way it is defined in ELF-land.  It would have seriously hindered the
devlopment
of things like (p)threads, alloca, unexec, threaded code etc. (probably
even
shared libraries, would you have restricted the layout before their
advent)
in the past and may do so for some future ideas.

Ciao,
Wolfgang
-- 
ws@TooLs.DE     Wolfgang Solfrank, TooLs GmbH 	+49-228-985800