On 4/11/23 19:09, Warner Losh wrote:
> +++ b/bsd-user/syscallhdr.sh
> @@ -0,0 +1,7 @@
> +#!/bin/sh
> +
> +in="$1"
> +out="$2"
> +bsd="$3"
> +
> +awk -v bsd="$3" '{sub("SYS_", "TARGET_" bsd "_NR_", $0); print;}' < $in > $out
If the host/guest syscall numbers always match, there's no point in using
TARGET_freebsd_NR_foo at all -- just use the original SYS_foo symbol from <sys/syscall.h>.
long term, this is likely correct. Short term, though, changing to SYS_foo would cause quite a bit
of churn that I'm looking to avoid. bsd-user has two branches, and the newest branch has problems
with threads we've not been able to completely track down, so we can't switch to using it just yet.
So we have to still add new system calls to the old code base, which is made harder as the number
of differences proliferate.
This is the first step, though, towards that goal: not updating the system call tables as much, and
generating more code where possible to reduce the load we have on hand-coded stuff.
Warner