Subject: Re: Emulation extension
To: None <tech-kern@NetBSD.ORG>
From: Christos Zoulas <firstname.lastname@example.org>
Date: 03/05/1997 20:54:39
by netbsd1.cygnus.com with SMTP; 8 Sep 1996 00:00:50 -0000
Date: Sat, 7 Sep 1996 20:00:08 -0400 (EDT)
From: "Charles M. Hannum" <email@example.com>
To: thorpej@NetBSD.ORG, christos@NetBSD.ORG, mrg@NetBSD.ORG,
Subject: emulations, syscalls, etc.
While talking with dorquej (Jason B-)) about COMPAT_M68K4K, a few
things occured to me:
* We should migrate much of the syscall code (copying in arguments,
calling the functions, etc.) into emulation_machdep.c files, and
simply have a pointer to the function in struct emul. This would
eliminate a number of #ifdefs, and would probably even make the code
faster. Ideally, this would remove e_errno, e_nosys, e_nsysent,
e_sysent, and e_syscallnames from struct emul.
* e_sigcode and e_esigcode should not be in struct emul; they should
be handled by the emulation-specific setregs function. Possibly
e_copyargs could also be combined. None of these pointers should even
be in struct emul; they should be in the exec package.
* The SO_BROADCAST hack for COMPAT_SUNOS could easily be migrated into
the compat/sunos code. It does not need to be in uipc_socket.c.
* With just a little work, all the other emulation-specific #ifdefs
(other than initializing the switch tables) could just go away.
* At this point, you have e_name and e_sendsig left in struct emul.
e_sendsig could just go in struct proc, and struct emul could go away
Not only would this be an architectural win, but it would make
building emulation LKMs trivial.
So, does someone want to do this? Please?