Subject: Re: lwp_emuldata
To: Matt Thomas <matt@3am-software.com>
From: Emmanuel Dreyfus <manu@netbsd.org>
List: tech-kern
Date: 12/17/2003 13:34:36
Matt Thomas <matt@3am-software.com> wrote:

> > - call e_newlwp just before returning from newlwp 
> Wouldn't e_lwp_fork be a better name since it corresponds to
> cpu_lwp_fork?

Let's go for cpu_lwp_fork()
 
> > - call e_lwp_exit at the very beginning of lwp_exit (after the DPRINTF)
> There should also be a call to e_lwp_exit with the emulation before exec
> commits to execing a new program.  (assume you run the OSX sh and then
> exec a NetBSD program, shouldn't the OSX emul data be removed?)

Maybe this could be handled from e_proc_exit? In e_proc_exit we would
call e_lwp_exit(proc_representative_lwp(p) to cleanup lwp_emuldata for
the last lwp.

And we can also say it is the responsability of e_proc_exec to cleanup
lwp_emuldata if this is nescessary when execing from the same emulation.

There is only one problem with this approach: if one day we have an
emulation that do not need emuldata but only lwp_emuldata, we will force
it to use proc hooks.
 
-- 
Emmanuel Dreyfus
Il y a 10 sortes de personnes dans le monde: ceux qui comprennent 
le binaire et ceux qui ne le comprennent pas.
manu@netbsd.org