Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Apr 2023 16:40:36 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 559b94a12257 - main - syscall.master: Fix comments
Message-ID:  <CANCZdfor6Ak-ygTPWRDx5bEehS3YtvdvJNiMxR0kyUQEvRsgxw@mail.gmail.com>
In-Reply-To: <ZEK7wu4xNEFoGG0%2B@spindle.one-eyed-alien.net>
References:  <202304202219.33KMJSY0042283@gitrepo.freebsd.org> <ZEK7wu4xNEFoGG0%2B@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000002a846005f9e059b7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Apr 21, 2023 at 10:37=E2=80=AFAM 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=3D559b94a12257807115bf84264936f0d=
e2ac3884e
> >
> > 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 th=
e
> >     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 lin=
es
> 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

--0000000000002a846005f9e059b7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Apr 21, 2023 at 10:37=E2=80=
=AFAM Brooks Davis &lt;<a href=3D"mailto:brooks@freebsd.org">brooks@freebsd=
.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex">On Thu, Apr 20, 2023 at 10:19:28PM +0000, Warner Losh wrote:<br>
&gt; The branch main has been updated by imp:<br>
&gt; <br>
&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D559b94a12257=
807115bf84264936f0de2ac3884e" rel=3D"noreferrer" target=3D"_blank">https://=
cgit.FreeBSD.org/src/commit/?id=3D559b94a12257807115bf84264936f0de2ac3884e<=
/a><br>
&gt; <br>
&gt; commit 559b94a12257807115bf84264936f0de2ac3884e<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2023-04-20 22:16:21 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; CommitDate: 2023-04-20 22:18:02 +0000<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0syscall.master: Fix comments<br>
&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0Have more accruate comments. While #if, #else, etc =
are copied to the<br>
&gt;=C2=A0 =C2=A0 =C2=A0header files, lines that don&#39;t start with # are=
 not.=C2=A0 And #include files<br>
&gt;=C2=A0 =C2=A0 =C2=A0are only output to sysinc (which winds up at the fr=
ont of init_sysent.c<br>
&gt;=C2=A0 =C2=A0 =C2=A0which seems a bit odd). This is all radically undoc=
umented, and likely<br>
&gt;=C2=A0 =C2=A0 =C2=A0has drifted somewhat from 4.4BSD and what other sys=
tems do (they&#39;ve<br>
&gt;=C2=A0 =C2=A0 =C2=A0drifted too, fwiw).<br>
<br>
We probably want to tighten what we do a fair bit with regard to &#39;#&#39=
;<br>
lines and perhaps make syscalls.master&#39;s format more explicit about<br>
what&#39;s being copied where.=C2=A0 The historic behavior of blindly emitt=
ing lines<br>
beginning with &#39;#&#39; was there to support manual specification of thi=
ngs<br>
like padding of arguments to achieve 64-bit alignment on non-i386, 32-bit<b=
r>
architectures.=C2=A0 I think we should likely remove the support entirely p=
ost 14<br>
branch (I&#39;d kept it after the compat32 generation code because I was<br=
>
worried about breaking downstream consumers with custom syscalls, but by<br=
>
now they have had time to migrate.)<br></blockquote><div><br></div><div>Agr=
eed. The # process is broken now for #ifdef, etc based one what&#39;s copie=
d where.</div><div>I&#39;ve started shoveling the code from makesyscalls.lu=
a into a series of *.lua files with</div><div>classes for each item rather =
than having a huge ball of code that&#39;s a hopeless twisty</div><div>maze=
 that&#39;s hard to extend. The goal is to expand the remit of successor to=
 generate</div><div>tables for truss, and a bunch of things for qemu bsd-us=
er to reduce the tedious and</div><div>error-prone hand coding. This may al=
so support cheri-on-freebsd, but I&#39;m going to</div><div>need someone on=
 the CHERI team to work closely with me on this. Since it&#39;s all</div><d=
iv>generated, the special needs of cheri can be accommodated more easily an=
d</div><div>automatically I believe. It would also allow the cheri bsd-user=
 to update past 5.x (as</div><div>well as FreeBSD&#39;s to move on from 3.1=
). It might also allow some non-threaded</div><div>non-specialised FooBSD o=
n BarBSD programs to work with tweaks to the generataor</div><div>(though N=
etBSD&#39;s and OpenBSD&#39;s syscall.master contains a lot less metadata t=
han</div><div>FreeBSD, so that would need to be addressed before this is a =
non-starter).</div><div><br></div><div>I&#39;d also like to write syscall.m=
aster.9.</div><div><br></div><div>I&#39;ve written maybe 30-40% of the new =
thing based either on cut and paste code, or</div><div>with a rewrite to si=
mplify. If you are interested, you can get in touch...</div><div><br></div>=
<div>Warner</div></div></div>

--0000000000002a846005f9e059b7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfor6Ak-ygTPWRDx5bEehS3YtvdvJNiMxR0kyUQEvRsgxw>