Subject: Re: Adding a size parameter to stackgap_init()
To: Christos Zoulas <christos@zoulas.com>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 03/17/2002 10:08:52
Christos Zoulas wrote:
> I don't see why you need to store that region in userspace. You have
> an irix syscall that passes you the argument in userspace, right?

The stackgap alloc function is used to allocate piece of userspace
memory where results of native syscalls are temporarily stored
before they are converted to compat ones, copied to space
pointed out by compat syscall and syscall  is returned.
AFAIK copyout() doesn't work with kernel adresses as the target
(IIRC it panics, which is right).

BTW, the stackgap_init() size parameter doesn't make too much sense.
The maximum can't be changed at proc runtime and using that as indication
of maximum stackgap thread usage would be a bit of PITA to get the value
right in many cases.
Also, what is the purpose of the 'struct proc' argument? I realize
the functions aren't LWP safe (i.e. different clone(2)d processes
would all share single stackgap since they share VM space), do you
plan any further work on it?

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/Ports/i386/ps2.html
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-