Re: [PATCH v3 18/20] bsd-user: Automatically generate syscall_nr.h

2023-04-13 Thread Richard Henderson
On 4/12/23 16:21, Warner Losh wrote: On Wed, Apr 12, 2023 at 4:10 AM Richard Henderson > wrote: On 4/11/23 19:09, Warner Losh wrote: > +++ b/bsd-user/syscallhdr.sh > @@ -0,0 +1,7 @@ > +#!/bin/sh > + > +in="$1" > +out="$2"

Re: [PATCH v3 18/20] bsd-user: Automatically generate syscall_nr.h

2023-04-12 Thread Warner Losh
On Wed, Apr 12, 2023 at 4:10 AM Richard Henderson < richard.hender...@linaro.org> wrote: > 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

Re: [PATCH v3 18/20] bsd-user: Automatically generate syscall_nr.h

2023-04-12 Thread Richard Henderson
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

[PATCH v3 18/20] bsd-user: Automatically generate syscall_nr.h

2023-04-11 Thread Warner Losh
Automatically generate syscall_nr.h from /usr/include/sys/syscall.h since we can only run on a system that matches... This should reduce the churn in the future. Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.h | 2 +- bsd-user/meson.build | 4 bsd-user/syscallhdr.sh