Subject: Re: emuldata addition
To: Jaromír Dolecek <firstname.lastname@example.org>
From: Chris G. Demetriou <email@example.com>
Date: 10/29/2000 11:58:33
firstname.lastname@example.org (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
(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.