Subject: Re: Emulations as LKMs
To: Bill Studenmund <wrstuden@zembu.com>
From: Matthew Orgass <darkstar@pgh.net>
List: tech-kern
Date: 11/07/2000 10:46:42
On Mon, 6 Nov 2000, Bill Studenmund wrote:
> On Mon, 6 Nov 2000, Jarommr Dolecek wrote:
> > - add an easy way to check for type of process emulation;
> >   current practice of
> > 
> > #ifdef COMPAT_FOO_OS
> >   if (0
> > #ifdef EXEC_AOUT
> >   || p->emul == &emul_FOO_OS_aout)
> > #endif
> > #ifdef EXEC_ELF32
> >   || p->emul == &emul_FOO_OS_elf32)
> > #endif
> >   ) { do_stuff; }
> > #endif /* COMPAT_FOO_OS */
> > 
> >   .. should die and become something like:
> > #if defined(COMPAT_LINUX) || defined(LKM)
> >   if (emul_is_equal(p->emul, EMUL_LINUX) {
> > 	do_stuff;
> >   }
> > #endif
> 
> That should be fine.

  No, that is not fine.  This limits you to emulations the kernel already
knows about and keeps emulation code spread accross the kernel.  The right
thing to do is to separate the syscall and signal code for each emulation
and just call the correct function for the current emulation.

Matthew Orgass
darkstar@pgh.net