Subject: Re: emulation initialization
To: Emmanuel Dreyfus <manu@netbsd.org>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 12/22/2002 20:39:46
Emmanuel Dreyfus wrote:
> > I think the mach_cold thing is sufficient for Mach emulation.
> 
> Why is the e_init field in struct emul undesirable? It costs 4 bytes per
> compiled-in emulation, and it looks much cleaner.

Plus code to go actually go throught the list of emulations
(I assume using execsw[]).  Plus e_fini pointer.

I don't see general need need for emulation 'init' function. Exactly
one emulation can take advantage of it, and even the one runs
perfectly fine the current way.

Note that even empty pools consume some kernel memory. I think it's
better to allocate the emulation resources on demand. Since you
have single entry point (mach_e_proc_exec()) and always get there
in process context, nothing can sneak behind your back, it's safe.
Until execve(2) would run without BigLock, at least :)

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.org/
-=- 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.''     -=-