Subject: Re: Split of syscall code (please comment)
To: =?X-UNKNOWN?Q?Jarom=EDr_Dolecek?= <>
From: Matthew Orgass <>
List: tech-kern
Date: 11/29/2000 02:52:46
On Tue, 28 Nov 2000, Jarom=EDr Dolecek wrote:
> Matthew Orgass wrote:
> >   I don't think copying would be all that bad in this situation.  While=
> > would make sense for the BSD systems to share, I don't see the gain in
> > trying to force Linux emulation to share the same code.  It is not a la=
> > or frequently updated section of code and there are a number of
> > differences.
> The differences are not quite that big. Majority of code is shared.
> On the other hand, if completely split, the code would be a bit more
> readable.

  Maybe about half is shared with Linux, but the shared parts are
scattered.  An emul specific version would only be about 100 lines of

> Is the code in question really updated so seldomly ?

  What would you change?  Other than a lock for SMP, it looks like the
only changes that have been made in the past five years have been
emulation specific or dealing with the fact that it is not emulation

> How would inlines help here ?
> Like you'd suggest to put the code in header file and pull in via
> inline ? That would not work, I need to put pointer of the function
> to struct emul.

  You would have a non-inline foo_syscall that just calls the inline
function.  This at least makes it clear what is going on.  It also removes
the need to redirect through p->emul since each emulation already knows
what it is (pass the needed data as additional arguments).  Furthermore,
this entirely kicks emulation specific code out of trap.c.

Matthew Orgass