Re: git: 559b94a12257 - main - syscall.master: Fix comments

From: Warner Losh <imp_at_bsdimp.com>
Date: Fri, 21 Apr 2023 22:40:36 UTC
On Fri, Apr 21, 2023 at 10:37 AM Brooks Davis <brooks@freebsd.org> wrote:

> On Thu, Apr 20, 2023 at 10:19:28PM +0000, Warner Losh wrote:
> > The branch main has been updated by imp:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=559b94a12257807115bf84264936f0de2ac3884e
> >
> > commit 559b94a12257807115bf84264936f0de2ac3884e
> > Author:     Warner Losh <imp@FreeBSD.org>
> > AuthorDate: 2023-04-20 22:16:21 +0000
> > Commit:     Warner Losh <imp@FreeBSD.org>
> > CommitDate: 2023-04-20 22:18:02 +0000
> >
> >     syscall.master: Fix comments
> >
> >     Have more accruate comments. While #if, #else, etc are copied to the
> >     header files, lines that don't start with # are not.  And #include
> files
> >     are only output to sysinc (which winds up at the front of
> init_sysent.c
> >     which seems a bit odd). This is all radically undocumented, and
> likely
> >     has drifted somewhat from 4.4BSD and what other systems do (they've
> >     drifted too, fwiw).
>
> We probably want to tighten what we do a fair bit with regard to '#'
> lines and perhaps make syscalls.master's format more explicit about
> what's being copied where.  The historic behavior of blindly emitting lines
> beginning with '#' was there to support manual specification of things
> like padding of arguments to achieve 64-bit alignment on non-i386, 32-bit
> architectures.  I think we should likely remove the support entirely post
> 14
> branch (I'd kept it after the compat32 generation code because I was
> worried about breaking downstream consumers with custom syscalls, but by
> now they have had time to migrate.)
>

Agreed. The # process is broken now for #ifdef, etc based one what's copied
where.
I've started shoveling the code from makesyscalls.lua into a series of
*.lua files with
classes for each item rather than having a huge ball of code that's a
hopeless twisty
maze that's hard to extend. The goal is to expand the remit of successor to
generate
tables for truss, and a bunch of things for qemu bsd-user to reduce the
tedious and
error-prone hand coding. This may also support cheri-on-freebsd, but I'm
going to
need someone on the CHERI team to work closely with me on this. Since it's
all
generated, the special needs of cheri can be accommodated more easily and
automatically I believe. It would also allow the cheri bsd-user to update
past 5.x (as
well as FreeBSD's to move on from 3.1). It might also allow some
non-threaded
non-specialised FooBSD on BarBSD programs to work with tweaks to the
generataor
(though NetBSD's and OpenBSD's syscall.master contains a lot less metadata
than
FreeBSD, so that would need to be addressed before this is a non-starter).

I'd also like to write syscall.master.9.

I've written maybe 30-40% of the new thing based either on cut and paste
code, or
with a rewrite to simplify. If you are interested, you can get in touch...

Warner