Subject: Re: emuldata addition
To: Jaromír Dolecek <dolecek@ibis.cz>
From: Chris G. Demetriou <cgd@sibyte.com>
List: tech-kern
Date: 10/29/2000 11:58:33
dolecek@ibis.cz (Jaromír Dolecek) writes:
> I've implemented one of obvious ways to achieve that. struct emul
> has got a new function pointer to emuldata alloc function - if non-NULL,
> it's called in fork1() or sys_exec() to allocate emuldata. struct proc
> has got one more field, void *p_emuldata, which can hold emulation-specific
> data and is freed in exit1().
if emulations want data, how long before they want to put pointers to
additional data structures, etc., in their private data, that need to
be freed or un-referenced upon exit or exec, and copied or referenced
upon fork?
(speaking of which, you almost certainly need to take action to free
or otherwise dealloc emul data on exec.)
if you're going to do this, I think you've probably gotta do it right:
entry from exec to alloc, entries from exec and exit to free, entry
from fork to copy.
It might be nice if there were a generic mechanism to stuff hooks in
at each of these points, too, but i'm not sure it's necessary or worth
it at this point.
chris