CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: riastradh Date: Sun Aug 18 18:42:57 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_16.c Log Message: netbsd32_compat_16.c: Fix whitespace. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/compat/netbsd32/netbsd32_compat_16.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_compat_16.c diff -u src/sys/compat/netbsd32/netbsd32_compat_16.c:1.5 src/sys/compat/netbsd32/netbsd32_compat_16.c:1.6 --- src/sys/compat/netbsd32/netbsd32_compat_16.c:1.5 Wed May 1 11:32:29 2024 +++ src/sys/compat/netbsd32/netbsd32_compat_16.c Sun Aug 18 18:42:57 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_16.c,v 1.5 2024/05/01 11:32:29 mlelstv Exp $ */ +/* $NetBSD: netbsd32_compat_16.c,v 1.6 2024/08/18 18:42:57 riastradh Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.5 2024/05/01 11:32:29 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.6 2024/08/18 18:42:57 riastradh Exp $"); #include #include @@ -60,7 +60,8 @@ compat_netbsd32_16_init(void) { int error; - error = syscall_establish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls); + error = syscall_establish(&emul_netbsd32, + netbsd32_kern_sig_16_syscalls); if (error) return error; @@ -87,32 +88,34 @@ compat_netbsd32_16_fini(void) proc_t *p; int error; - error = syscall_disestablish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls); -if (error) -return error; -/* - * Ensure sendsig_sigcontext() is not being used. - * module_lock prevents the flag being set on any - * further processes while we are here. See - * sigaction1() for the opposing half. - */ -mutex_enter(&proc_lock); -PROCLIST_FOREACH(p, &allproc) { -if ((p->p_lflag & PL_SIGCOMPAT) != 0) { -break; -} -} -mutex_exit(&proc_lock); -if (p != NULL) { -syscall_establish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls); -return EBUSY; -} + error = syscall_disestablish(&emul_netbsd32, + netbsd32_kern_sig_16_syscalls); + if (error) + return error; + /* + * Ensure sendsig_sigcontext() is not being used. + * module_lock prevents the flag being set on any + * further processes while we are here. See + * sigaction1() for the opposing half. + */ + mutex_enter(&proc_lock); + PROCLIST_FOREACH(p, &allproc) { + if ((p->p_lflag & PL_SIGCOMPAT) != 0) { + break; + } + } + mutex_exit(&proc_lock); + if (p != NULL) { + syscall_establish(&emul_netbsd32, + netbsd32_kern_sig_16_syscalls); + return EBUSY; + } rw_enter(&exec_lock, RW_WRITER); exec_sigcode_free(&emul_netbsd); emul_netbsd32.e_sigcode = NULL; - emul_netbsd32.e_esigcode = NULL; - emul_netbsd32.e_sigobject = NULL; + emul_netbsd32.e_esigcode = NULL; + emul_netbsd32.e_sigobject = NULL; rw_exit(&exec_lock); netbsd32_machdep_md_16_fini(); return 0;
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: riastradh Date: Sun Aug 18 18:42:57 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_16.c Log Message: netbsd32_compat_16.c: Fix whitespace. No functional change intended. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/compat/netbsd32/netbsd32_compat_16.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: martin Date: Sat May 11 10:22:17 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: PR 58235: add support for SIOCGIFDATA and SIOCZIFDATA ioctls. To generate a diff of this commit: cvs rdiff -u -r1.120 -r1.121 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.79 -r1.80 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.120 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.121 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.120 Wed Dec 22 00:21:32 2021 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Sat May 11 10:22:17 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.120 2021/12/22 00:21:32 roy Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.121 2024/05/11 10:22:17 martin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.120 2021/12/22 00:21:32 roy Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.121 2024/05/11 10:22:17 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -151,6 +151,20 @@ netbsd32_to_oifreq(struct netbsd32_oifre } static inline void +netbsd32_to_ifdatareq(struct netbsd32_ifdatareq *s32p, struct ifdatareq *p, u_long cmd) +{ + + memcpy(p, s32p, sizeof *s32p); + switch (cmd) { + case SIOCGIFDATA: + case SIOCZIFDATA: + netbsd32_to_timespec(&s32p->ifdr_data.ifi_lastchange, + &p->ifdr_data.ifi_lastchange); + break; + } +} + +static inline void netbsd32_to_if_addrprefreq(const struct netbsd32_if_addrprefreq *ifap32, struct if_addrprefreq *ifap, u_long cmd) { @@ -693,6 +707,20 @@ netbsd32_from_oifreq(struct oifreq *p, } static inline void +netbsd32_from_ifdatareq(const struct ifdatareq *p, struct netbsd32_ifdatareq *p32, u_long cmd) +{ + + memcpy(p32, p, sizeof *p32); + switch (cmd) { + case SIOCGIFDATA: + case SIOCZIFDATA: + netbsd32_from_timespec(&p->ifdr_data.ifi_lastchange, + &p32->ifdr_data.ifi_lastchange); + break; + } +} + +static inline void netbsd32_from_if_addrprefreq(const struct if_addrprefreq *ifap, struct netbsd32_if_addrprefreq *ifap32, u_long cmd) { @@ -1537,6 +1565,10 @@ netbsd32_ioctl(struct lwp *l, case SIOCSIFADDRPREF32: IOCTL_STRUCT_CONV_TO(SIOCSIFADDRPREF, if_addrprefreq); + case SIOCGIFDATA32: + IOCTL_STRUCT_CONV_TO(SIOCGIFDATA, ifdatareq); + case SIOCZIFDATA32: + IOCTL_STRUCT_CONV_TO(SIOCZIFDATA, ifdatareq); case OSIOCGIFFLAGS32: IOCTL_STRUCT_CONV_TO(OSIOCGIFFLAGS, oifreq); Index: src/sys/compat/netbsd32/netbsd32_ioctl.h diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.79 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.80 --- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.79 Wed Dec 22 00:21:32 2021 +++ src/sys/compat/netbsd32/netbsd32_ioctl.h Sat May 11 10:22:17 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.h,v 1.79 2021/12/22 00:21:32 roy Exp $ */ +/* $NetBSD: netbsd32_ioctl.h,v 1.80 2024/05/11 10:22:17 martin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -316,6 +316,35 @@ struct netbsd32_if_clonereq { netbsd32_charp ifcr_buffer; }; +struct netbsd32_if_data { + u_char ifi_type; + u_char ifi_addrlen; + u_char ifi_hdrlen; + u_char __pack_dummy; + int ifi_link_state; + uint64_t ifi_mtu; + uint64_t ifi_metric; + uint64_t ifi_baudrate; + uint64_t ifi_ipackets; + uint64_t ifi_ierrors; + uint64_t ifi_opackets; + uint64_t ifi_oerrors; + uint64_t ifi_collisions; + uint64_t ifi_ibytes; + uint64_t ifi_obytes; + uint64_t ifi_imcasts; + uint64_t ifi_omcasts; + uint64_t ifi_iqdrops; + uint64_t ifi_noproto; + struct netbsd32_timespec ifi_lastchange; +} __packed; + +struct netbsd32_ifdatareq { + char ifdr_name[IFNAMSIZ]; /* if name, e.g. "en0" */ + struct netbsd32_if_data ifdr_data; +}; + + /* from */ #define SIOCGADDRROM32 _IOW('i', 240, struct netbsd32_ifreq) /* get 128 bytes of ROM */ #define SIOCGCHIPID32 _IOWR('i', 241, struct netbsd32_ifreq) /* get chipid */ @@ -388,6 +417,10 @@ struct netbsd32_if_clonereq { #define SIOCGIFMTU32 _IOWR('i', 126, struct netbsd32_ifreq) /* get ifnet mtu */ #define OSIOCGIFMTU32 _IOWR('i', 126, struct netbsd32_oifreq) /* get ifnet mtu */ + +#define SIOCGIFDATA32 _IOWR('i', 133, struct netbsd32_ifdatareq) +#define SIOCZIFDATA32 _IOWR('i', 134, struct netbsd32_ifdatareq) + /* was 125 SIOCSIFASYNCMAP32 */ /* was 124 SIOCGIFASYNCMAP32 */ /* from */
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: martin Date: Sat May 11 10:22:17 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: PR 58235: add support for SIOCGIFDATA and SIOCZIFDATA ioctls. To generate a diff of this commit: cvs rdiff -u -r1.120 -r1.121 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.79 -r1.80 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mlelstv Date: Wed May 1 11:32:29 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_16.c Log Message: Enable compat sigreturn system call. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/netbsd32/netbsd32_compat_16.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mlelstv Date: Wed May 1 11:32:29 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_16.c Log Message: Enable compat sigreturn system call. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/netbsd32/netbsd32_compat_16.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_compat_16.c diff -u src/sys/compat/netbsd32/netbsd32_compat_16.c:1.4 src/sys/compat/netbsd32/netbsd32_compat_16.c:1.5 --- src/sys/compat/netbsd32/netbsd32_compat_16.c:1.4 Fri Nov 26 08:06:11 2021 +++ src/sys/compat/netbsd32/netbsd32_compat_16.c Wed May 1 11:32:29 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_16.c,v 1.4 2021/11/26 08:06:11 ryo Exp $ */ +/* $NetBSD: netbsd32_compat_16.c,v 1.5 2024/05/01 11:32:29 mlelstv Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,13 +29,14 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.4 2021/11/26 08:06:11 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_16.c,v 1.5 2024/05/01 11:32:29 mlelstv Exp $"); #include #include #include #include #include +#include #include #include #include @@ -47,40 +48,87 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com struct uvm_object *emul_netbsd32_object; -MODULE(MODULE_CLASS_EXEC, compat_netbsd32_16, "compat_netbsd32_20,compat_16"); +static const struct syscall_package netbsd32_kern_sig_16_syscalls[] = { +/* compat_16_netbs32___sigreturn14 is in MD code! */ +{ NETBSD32_SYS_compat_16_netbsd32___sigreturn14, 0, +(sy_call_t *)compat_16_netbsd32___sigreturn14 }, +{ 0, 0, NULL } +}; static int -compat_netbsd32_16_modcmd(modcmd_t cmd, void *arg) +compat_netbsd32_16_init(void) +{ + int error; + + error = syscall_establish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls); + if (error) + return error; + + rw_enter(&exec_lock, RW_WRITER); + emul_netbsd32.e_sigcode = netbsd32_sigcode; + emul_netbsd32.e_esigcode = netbsd32_esigcode; + emul_netbsd32.e_sigobject = &emul_netbsd32_object; + error = exec_sigcode_alloc(&emul_netbsd); + if (error) { + emul_netbsd32.e_sigcode = NULL; + emul_netbsd32.e_esigcode = NULL; + emul_netbsd32.e_sigobject = NULL; + } + rw_exit(&exec_lock); + if (error) + return error; + netbsd32_machdep_md_16_init(); + return 0; +} + +static int +compat_netbsd32_16_fini(void) { + proc_t *p; int error; + error = syscall_disestablish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls); +if (error) +return error; +/* + * Ensure sendsig_sigcontext() is not being used. + * module_lock prevents the flag being set on any + * further processes while we are here. See + * sigaction1() for the opposing half. + */ +mutex_enter(&proc_lock); +PROCLIST_FOREACH(p, &allproc) { +if ((p->p_lflag & PL_SIGCOMPAT) != 0) { +break; +} +} +mutex_exit(&proc_lock); +if (p != NULL) { +syscall_establish(&emul_netbsd32, netbsd32_kern_sig_16_syscalls); +return EBUSY; +} + + rw_enter(&exec_lock, RW_WRITER); + exec_sigcode_free(&emul_netbsd); + emul_netbsd32.e_sigcode = NULL; + emul_netbsd32.e_esigcode = NULL; + emul_netbsd32.e_sigobject = NULL; + rw_exit(&exec_lock); + netbsd32_machdep_md_16_fini(); + return 0; +} + +MODULE(MODULE_CLASS_EXEC, compat_netbsd32_16, "compat_netbsd32_20,compat_16"); + +static int +compat_netbsd32_16_modcmd(modcmd_t cmd, void *arg) +{ switch (cmd) { case MODULE_CMD_INIT: - rw_enter(&exec_lock, RW_WRITER); - emul_netbsd32.e_sigcode = netbsd32_sigcode; - emul_netbsd32.e_esigcode = netbsd32_esigcode; - emul_netbsd32.e_sigobject = &emul_netbsd32_object; - error = exec_sigcode_alloc(&emul_netbsd); - if (error) { - emul_netbsd32.e_sigcode = NULL; - emul_netbsd32.e_esigcode = NULL; - emul_netbsd32.e_sigobject = NULL; - } - rw_exit(&exec_lock); - if (error) - return error; - netbsd32_machdep_md_16_init(); - return 0; + return compat_netbsd32_16_init(); case MODULE_CMD_FINI: - rw_enter(&exec_lock, RW_WRITER); - exec_sigcode_free(&emul_netbsd); - emul_netbsd32.e_sigcode = NULL; - emul_netbsd32.e_esigcode = NULL; - emul_netbsd32.e_sigobject = NULL; - rw_exit(&exec_lock); - netbsd32_machdep_md_16_fini(); - return 0; + return compat_netbsd32_16_fini(); default: return ENOTTY;
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mlelstv Date: Wed May 1 07:22:43 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_sysent.c Log Message: Revert previous, the syscall needs to be enabled at runtime. The compat_16 module just enables it for the "netbsd" emulation, but nothing enables it yet for "netbsd32". To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/sys/compat/netbsd32/netbsd32_sysent.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_sysent.c diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.159 src/sys/compat/netbsd32/netbsd32_sysent.c:1.160 --- src/sys/compat/netbsd32/netbsd32_sysent.c:1.159 Tue Apr 30 17:10:22 2024 +++ src/sys/compat/netbsd32/netbsd32_sysent.c Wed May 1 07:22:43 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_sysent.c,v 1.159 2024/04/30 17:10:22 mlelstv Exp $ */ +/* $NetBSD: netbsd32_sysent.c,v 1.160 2024/05/01 07:22:43 mlelstv Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.159 2024/04/30 17:10:22 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.160 2024/05/01 07:22:43 mlelstv Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -1280,7 +1280,7 @@ struct sysent netbsd32_sysent[] = { }, /* 294 = netbsd32___sigsuspend14 */ { ns(struct compat_16_netbsd32___sigreturn14_args), - .sy_call = (sy_call_t *)compat_16_netbsd32___sigreturn14 + .sy_call = (sy_call_t *)sys_nomodule }, /* 295 = compat_16_netbsd32___sigreturn14 */ { ns(struct netbsd32___getcwd_args),
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mlelstv Date: Wed May 1 07:22:43 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_sysent.c Log Message: Revert previous, the syscall needs to be enabled at runtime. The compat_16 module just enables it for the "netbsd" emulation, but nothing enables it yet for "netbsd32". To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/sys/compat/netbsd32/netbsd32_sysent.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mlelstv Date: Tue Apr 30 17:10:22 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_sysent.c Log Message: Enable compat sigreturn system call. The previous bug in netbsd32___sigaction_sigtramp hid the problem, as it failed all but the first installation of a signal handler. To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_sysent.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_sysent.c diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.158 src/sys/compat/netbsd32/netbsd32_sysent.c:1.159 --- src/sys/compat/netbsd32/netbsd32_sysent.c:1.158 Sun Jul 30 06:53:13 2023 +++ src/sys/compat/netbsd32/netbsd32_sysent.c Tue Apr 30 17:10:22 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_sysent.c,v 1.158 2023/07/30 06:53:13 rin Exp $ */ +/* $NetBSD: netbsd32_sysent.c,v 1.159 2024/04/30 17:10:22 mlelstv Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.158 2023/07/30 06:53:13 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.159 2024/04/30 17:10:22 mlelstv Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -1280,7 +1280,7 @@ struct sysent netbsd32_sysent[] = { }, /* 294 = netbsd32___sigsuspend14 */ { ns(struct compat_16_netbsd32___sigreturn14_args), - .sy_call = (sy_call_t *)sys_nomodule + .sy_call = (sy_call_t *)compat_16_netbsd32___sigreturn14 }, /* 295 = compat_16_netbsd32___sigreturn14 */ { ns(struct netbsd32___getcwd_args),
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mlelstv Date: Tue Apr 30 17:10:22 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_sysent.c Log Message: Enable compat sigreturn system call. The previous bug in netbsd32___sigaction_sigtramp hid the problem, as it failed all but the first installation of a signal handler. To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_sysent.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mlelstv Date: Mon Apr 29 14:56:01 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: In netbsd32___sigaction_sigtramp continue to use the compat module when already locked for this process. Needs pullup to netbsd-10. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mlelstv Date: Mon Apr 29 14:56:01 UTC 2024 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: In netbsd32___sigaction_sigtramp continue to use the compat module when already locked for this process. Needs pullup to netbsd-10. To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_signal.c diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.53 src/sys/compat/netbsd32/netbsd32_signal.c:1.54 --- src/sys/compat/netbsd32/netbsd32_signal.c:1.53 Sat Nov 6 20:42:56 2021 +++ src/sys/compat/netbsd32/netbsd32_signal.c Mon Apr 29 14:56:01 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_signal.c,v 1.53 2021/11/06 20:42:56 thorpej Exp $ */ +/* $NetBSD: netbsd32_signal.c,v 1.54 2024/04/29 14:56:01 mlelstv Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.53 2021/11/06 20:42:56 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.54 2024/04/29 14:56:01 mlelstv Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -184,7 +184,7 @@ netbsd32___sigaction_sigtramp(struct lwp */ #ifdef __HAVE_STRUCT_SIGCONTEXT struct proc *p = l->l_proc; - bool sigcontext_valid = false; + bool sigcontext_valid; /* * We need to ensure the compat_netbsd32_16 module @@ -196,9 +196,7 @@ netbsd32___sigaction_sigtramp(struct lwp kernconfig_lock(); (void)module_autoload("compat_netbsd32_16", MODULE_CLASS_ANY); - if (netbsd32_sendsig_sigcontext_16_hook.hooked) { -sigcontext_valid = true; - } + sigcontext_valid = netbsd32_sendsig_sigcontext_16_hook.hooked; mutex_enter(&proc_lock); /* * Prevent unload of compat module while @@ -207,6 +205,11 @@ netbsd32___sigaction_sigtramp(struct lwp p->p_lflag |= PL_SIGCOMPAT; mutex_exit(&proc_lock); kernconfig_unlock(); + } else { + /* + * Module is already loaded and locked in memory + */ + sigcontext_valid = netbsd32_sendsig_sigcontext_16_hook.hooked; } if (!sigcontext_valid) { return EINVAL;
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mrg Date: Sat Sep 2 21:11:54 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: redo previous: use same variable type for the interator as the comparison To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/netbsd32/netbsd32_epoll.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_epoll.c diff -u src/sys/compat/netbsd32/netbsd32_epoll.c:1.4 src/sys/compat/netbsd32/netbsd32_epoll.c:1.5 --- src/sys/compat/netbsd32/netbsd32_epoll.c:1.4 Wed Aug 30 22:15:06 2023 +++ src/sys/compat/netbsd32/netbsd32_epoll.c Sat Sep 2 21:11:54 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_epoll.c,v 1.4 2023/08/30 22:15:06 mrg Exp $ */ +/* $NetBSD: netbsd32_epoll.c,v 1.5 2023/09/02 21:11:54 mrg Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.4 2023/08/30 22:15:06 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.5 2023/09/02 21:11:54 mrg Exp $"); #include #include @@ -135,7 +135,7 @@ netbsd32_epoll_pwait2(struct lwp *l, struct netbsd32_epoll_event *events32 = kmem_alloc(*retval * sizeof(*events32), KM_SLEEP); - for (unsigned i = 0; i < *retval; i++) + for (register_t i = 0; i < *retval; i++) netbsd32_from_epoll_event(&events[i], &events32[i]); error = copyout(events, SCARG_P32(uap, events),
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mrg Date: Sat Sep 2 21:11:54 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: redo previous: use same variable type for the interator as the comparison To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/compat/netbsd32/netbsd32_epoll.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mrg Date: Wed Aug 30 22:15:06 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: use unsigned for iterator, fixes -Wsigned-comapre issue in module build. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_epoll.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_epoll.c diff -u src/sys/compat/netbsd32/netbsd32_epoll.c:1.3 src/sys/compat/netbsd32/netbsd32_epoll.c:1.4 --- src/sys/compat/netbsd32/netbsd32_epoll.c:1.3 Sun Jul 30 07:56:15 2023 +++ src/sys/compat/netbsd32/netbsd32_epoll.c Wed Aug 30 22:15:06 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_epoll.c,v 1.3 2023/07/30 07:56:15 rin Exp $ */ +/* $NetBSD: netbsd32_epoll.c,v 1.4 2023/08/30 22:15:06 mrg Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.3 2023/07/30 07:56:15 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.4 2023/08/30 22:15:06 mrg Exp $"); #include #include @@ -135,7 +135,7 @@ netbsd32_epoll_pwait2(struct lwp *l, struct netbsd32_epoll_event *events32 = kmem_alloc(*retval * sizeof(*events32), KM_SLEEP); - for (int i = 0; i < *retval; i++) + for (unsigned i = 0; i < *retval; i++) netbsd32_from_epoll_event(&events[i], &events32[i]); error = copyout(events, SCARG_P32(uap, events),
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mrg Date: Wed Aug 30 22:15:06 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: use unsigned for iterator, fixes -Wsigned-comapre issue in module build. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_epoll.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 07:56:15 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: netbsd32_epoll_pwait2: Dedup slightly. NFCI. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_epoll.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_epoll.c diff -u src/sys/compat/netbsd32/netbsd32_epoll.c:1.2 src/sys/compat/netbsd32/netbsd32_epoll.c:1.3 --- src/sys/compat/netbsd32/netbsd32_epoll.c:1.2 Sun Jul 30 07:48:54 2023 +++ src/sys/compat/netbsd32/netbsd32_epoll.c Sun Jul 30 07:56:15 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_epoll.c,v 1.2 2023/07/30 07:48:54 rin Exp $ */ +/* $NetBSD: netbsd32_epoll.c,v 1.3 2023/07/30 07:56:15 rin Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.2 2023/07/30 07:48:54 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.3 2023/07/30 07:56:15 rin Exp $"); #include #include @@ -129,10 +129,8 @@ netbsd32_epoll_pwait2(struct lwp *l, error = epoll_wait_common(l, retval, SCARG(uap, epfd), events, maxevents, tsp, ssp); - if (error != 0 || *retval == 0) { - kmem_free(events, maxevents * sizeof(*events)); - return error; - } + if (error != 0 || *retval == 0) + goto out; struct netbsd32_epoll_event *events32 = kmem_alloc(*retval * sizeof(*events32), KM_SLEEP); @@ -140,12 +138,12 @@ netbsd32_epoll_pwait2(struct lwp *l, for (int i = 0; i < *retval; i++) netbsd32_from_epoll_event(&events[i], &events32[i]); - kmem_free(events, maxevents * sizeof(*events)); - error = copyout(events, SCARG_P32(uap, events), *retval * sizeof(*events32)); kmem_free(events32, *retval * sizeof(*events32)); + out: + kmem_free(events, maxevents * sizeof(*events)); return error; }
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 07:56:15 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: netbsd32_epoll_pwait2: Dedup slightly. NFCI. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_epoll.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 07:48:54 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: netbsd32_epoll_pwait2: Early return if no event arrived; Do not attempt to allocate 0-byte buffer by kmem_alloc(9). To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_epoll.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_epoll.c diff -u src/sys/compat/netbsd32/netbsd32_epoll.c:1.1 src/sys/compat/netbsd32/netbsd32_epoll.c:1.2 --- src/sys/compat/netbsd32/netbsd32_epoll.c:1.1 Sun Jul 30 06:52:20 2023 +++ src/sys/compat/netbsd32/netbsd32_epoll.c Sun Jul 30 07:48:54 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_epoll.c,v 1.1 2023/07/30 06:52:20 rin Exp $ */ +/* $NetBSD: netbsd32_epoll.c,v 1.2 2023/07/30 07:48:54 rin Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.1 2023/07/30 06:52:20 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_epoll.c,v 1.2 2023/07/30 07:48:54 rin Exp $"); #include #include @@ -129,7 +129,7 @@ netbsd32_epoll_pwait2(struct lwp *l, error = epoll_wait_common(l, retval, SCARG(uap, epfd), events, maxevents, tsp, ssp); - if (error != 0) { + if (error != 0 || *retval == 0) { kmem_free(events, maxevents * sizeof(*events)); return error; }
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 07:48:54 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: netbsd32_epoll_pwait2: Early return if no event arrived; Do not attempt to allocate 0-byte buffer by kmem_alloc(9). To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_epoll.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 06:53:13 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: COMPAT_NETBSD32: Regen for syscalls.master,v 1.144 To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.38 -r1.39 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.51 -r1.52 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.159 src/sys/compat/netbsd32/netbsd32_syscall.h:1.160 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.159 Sun Jul 30 05:31:30 2023 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Sun Jul 30 06:53:13 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.159 2023/07/30 05:31:30 rin Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.160 2023/07/30 06:53:13 rin Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp + * created from NetBSD: syscalls.master,v 1.144 2023/07/30 06:52:20 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -1344,6 +1344,15 @@ /* syscall: "netbsd32___kevent100" ret: "int" args: "int" "const netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */ #define NETBSD32_SYS_netbsd32___kevent100 501 +/* syscall: "netbsd32_epoll_create1" ret: "int" args: "int" */ +#define NETBSD32_SYS_netbsd32_epoll_create1 502 + +/* syscall: "netbsd32_epoll_ctl" ret: "int" args: "int" "int" "int" "netbsd32_epoll_eventp_t" */ +#define NETBSD32_SYS_netbsd32_epoll_ctl 503 + +/* syscall: "netbsd32_epoll_pwait2" ret: "int" args: "int" "netbsd32_epoll_eventp_t" "int" "netbsd32_timespecp_t" "netbsd32_sigsetp_t" */ +#define NETBSD32_SYS_netbsd32_epoll_pwait2 504 + #define NETBSD32_SYS_MAXSYSCALL 505 #define NETBSD32_SYS_NSYSENT 512 #endif /* _NETBSD32_SYS_SYSCALL_H_ */ Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.158 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.159 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.158 Sun Jul 30 05:31:30 2023 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Sun Jul 30 06:53:13 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.158 2023/07/30 05:31:30 rin Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.159 2023/07/30 06:53:13 rin Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp + * created from NetBSD: syscalls.master,v 1.144 2023/07/30 06:52:20 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -2805,6 +2805,28 @@ struct netbsd32___kevent100_args { }; check_syscall_args(netbsd32___kevent100) +struct netbsd32_epoll_create1_args { + syscallarg(int) flags; +}; +check_syscall_args(netbsd32_epoll_create1) + +struct netbsd32_epoll_ctl_args { + syscallarg(int) epfd; + syscallarg(int) op; + syscallarg(int) fd; + syscallarg(netbsd32_epoll_eventp_t) event; +}; +check_syscall_args(netbsd32_epoll_ctl) + +struct netbsd32_epoll_pwait2_args { + syscallarg(int) epfd; + syscallarg(netbsd32_epoll_eventp_t) events; + syscallarg(int) maxevents; + syscallarg(netbsd32_timespecp_t) timeout; + syscallarg(netbsd32_sigsetp_t) sigmask; +}; +check_syscall_args(netbsd32_epoll_pwait2) + /* * System call prototypes. */ @@ -3679,4 +3701,10 @@ int netbsd32_memfd_create(struct lwp *, int netbsd32___kevent100(struct lwp *, const struct netbsd32___kevent100_args *, register_t *); +int netbsd32_epoll_create1(struct lwp *, const struct netbsd32_epoll_create1_args *, register_t *); + +int netbsd32_epoll_ctl(struct lwp *, const struct netbsd32_epoll_ctl_args *, register_t *); + +int netbsd32_epoll_pwait2(struct lwp *, const struct netbsd32_epoll_pwait2_args *, register_t *); + #endif /* _NETBSD32_SYS_SYSCALLARGS_H_ */ Index: src/sys/compat/netbsd32/netbsd32_syscalls.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.158 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.159 --- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.158 Sun Jul 30 05:31:30 2023 +++ src/sys/compat/netbsd32/netbsd32_syscalls.c Sun Jul 30 06:53:13 2023 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.158 2023/07/30 05:31:30 rin Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.159 2023/07/30 06:
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 06:53:13 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: COMPAT_NETBSD32: Regen for syscalls.master,v 1.144 To generate a diff of this commit: cvs rdiff -u -r1.159 -r1.160 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.38 -r1.39 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.51 -r1.52 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 06:52:21 UTC 2023 Modified Files: src/sys/compat/netbsd32: files.netbsd32 netbsd32.h netbsd32_conv.h syscalls.master Added Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: COMPAT_NETBSD32: Add support for epoll(2). To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/compat/netbsd32/files.netbsd32 cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/netbsd32_conv.h cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_epoll.c cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 06:52:21 UTC 2023 Modified Files: src/sys/compat/netbsd32: files.netbsd32 netbsd32.h netbsd32_conv.h syscalls.master Added Files: src/sys/compat/netbsd32: netbsd32_epoll.c Log Message: COMPAT_NETBSD32: Add support for epoll(2). To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/compat/netbsd32/files.netbsd32 cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/netbsd32_conv.h cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_epoll.c cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/files.netbsd32 diff -u src/sys/compat/netbsd32/files.netbsd32:1.54 src/sys/compat/netbsd32/files.netbsd32:1.55 --- src/sys/compat/netbsd32/files.netbsd32:1.54 Mon Dec 19 23:19:51 2022 +++ src/sys/compat/netbsd32/files.netbsd32 Sun Jul 30 06:52:20 2023 @@ -1,4 +1,4 @@ -# $NetBSD: files.netbsd32,v 1.54 2022/12/19 23:19:51 pgoyette Exp $ +# $NetBSD: files.netbsd32,v 1.55 2023/07/30 06:52:20 rin Exp $ # # config file description for machine-independent netbsd32 compat code. # included by ports that need it. @@ -16,6 +16,7 @@ file compat/netbsd32/netbsd32_exec_elf32 file compat/netbsd32/netbsd32_exec_aout.c compat_netbsd32 & exec_aout file compat/netbsd32/netbsd32_netbsd.c compat_netbsd32 #file compat/netbsd32/netbsd32_drm.c compat_netbsd32 & drmkms +file compat/netbsd32/netbsd32_epoll.c compat_netbsd32 file compat/netbsd32/netbsd32_event.c compat_netbsd32 file compat/netbsd32/netbsd32_execve.c compat_netbsd32 file compat/netbsd32/netbsd32_fd.c compat_netbsd32 Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.142 src/sys/compat/netbsd32/netbsd32.h:1.143 --- src/sys/compat/netbsd32/netbsd32.h:1.142 Sat Jul 29 12:38:25 2023 +++ src/sys/compat/netbsd32/netbsd32.h Sun Jul 30 06:52:20 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.142 2023/07/29 12:38:25 rin Exp $ */ +/* $NetBSD: netbsd32.h,v 1.143 2023/07/30 06:52:20 rin Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green @@ -208,6 +208,15 @@ typedef netbsd32_int64 netbsd32_off_t; typedef netbsd32_uint64 netbsd32_ino_t; typedef netbsd32_int64 netbsd32_blkcnt_t; +/* from */ +typedef netbsd32_uint64 netbsd32_epoll_data_t; + +typedef netbsd32_pointer_t netbsd32_epoll_eventp_t; +struct netbsd32_epoll_event { + uint32_t events; + netbsd32_epoll_data_t data; +}; + /* from */ typedef netbsd32_pointer_t netbsd32_posix_spawn_file_actionsp; typedef netbsd32_pointer_t netbsd32_posix_spawnattrp; Index: src/sys/compat/netbsd32/netbsd32_conv.h diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.47 src/sys/compat/netbsd32/netbsd32_conv.h:1.48 --- src/sys/compat/netbsd32/netbsd32_conv.h:1.47 Sat Jul 29 12:38:25 2023 +++ src/sys/compat/netbsd32/netbsd32_conv.h Sun Jul 30 06:52:20 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_conv.h,v 1.47 2023/07/29 12:38:25 rin Exp $ */ +/* $NetBSD: netbsd32_conv.h,v 1.48 2023/07/30 06:52:20 rin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -956,4 +957,24 @@ netbsd32_from_mq_attr(const struct mq_at a32->mq_curmsgs = attr->mq_curmsgs; } +static __inline void +netbsd32_to_epoll_event(const struct netbsd32_epoll_event *ee32, +struct epoll_event *ee) +{ + + memset(ee, 0, sizeof(*ee)); + ee->events = ee32->events; + ee->data = ee32->data; +} + +static __inline void +netbsd32_from_epoll_event(const struct epoll_event *ee, +struct netbsd32_epoll_event *ee32) +{ + + memset(ee32, 0, sizeof(*ee32)); + ee32->events = ee->events; + ee32->data = ee->data; +} + #endif /* _COMPAT_NETBSD32_NETBSD32_CONV_H_ */ Index: src/sys/compat/netbsd32/syscalls.master diff -u src/sys/compat/netbsd32/syscalls.master:1.143 src/sys/compat/netbsd32/syscalls.master:1.144 --- src/sys/compat/netbsd32/syscalls.master:1.143 Sun Jul 30 05:30:45 2023 +++ src/sys/compat/netbsd32/syscalls.master Sun Jul 30 06:52:20 2023 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp $ + $NetBSD: syscalls.master,v 1.144 2023/07/30 06:52:20 rin Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -1222,6 +1222,10 @@ netbsd32_keventp_t eventlist, \ netbsd32_size_t nevents, \ const netbsd32_timespecp_t timeout); } -502 UNIMPL epoll_create1 -503 UNIMPL epoll_ctl -504 UNIMPL epoll_pwait2 +502 STD { int|netbsd32||epoll_create1(int flags); } +503 STD { int|netbsd32||epoll_ctl(int epfd, int op, int fd, \ + netbsd32_epoll_eventp_t event); } +504 STD { int|netbsd32||epoll_pwait2(int epfd, \ + netbsd32_epoll_eventp_t events, int maxevents, \ +
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 05:31:30 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: COMPANT_NETBSD32: Regen for syscalls.master,v 1.143 To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.37 -r1.38 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.50 -r1.51 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.158 src/sys/compat/netbsd32/netbsd32_syscall.h:1.159 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.158 Sat Jul 29 12:39:20 2023 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Sun Jul 30 05:31:30 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.158 2023/07/29 12:39:20 rin Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.159 2023/07/30 05:31:30 rin Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp + * created from NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -1338,6 +1338,9 @@ /* syscall: "netbsd32_lpathconf" ret: "long" args: "const netbsd32_charp" "int" */ #define NETBSD32_SYS_netbsd32_lpathconf 499 +/* syscall: "netbsd32_memfd_create" ret: "int" args: "const netbsd32_charp" "unsigned int" */ +#define NETBSD32_SYS_netbsd32_memfd_create 500 + /* syscall: "netbsd32___kevent100" ret: "int" args: "int" "const netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */ #define NETBSD32_SYS_netbsd32___kevent100 501 Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.157 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.158 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.157 Sat Jul 29 12:39:20 2023 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Sun Jul 30 05:31:30 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.157 2023/07/29 12:39:20 rin Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.158 2023/07/30 05:31:30 rin Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp + * created from NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -2789,6 +2789,12 @@ struct netbsd32_lpathconf_args { }; check_syscall_args(netbsd32_lpathconf) +struct netbsd32_memfd_create_args { + syscallarg(const netbsd32_charp) name; + syscallarg(unsigned int) flags; +}; +check_syscall_args(netbsd32_memfd_create) + struct netbsd32___kevent100_args { syscallarg(int) fd; syscallarg(const netbsd32_keventp_t) changelist; @@ -3669,6 +3675,8 @@ int netbsd32___acl_aclcheck_fd(struct lw int netbsd32_lpathconf(struct lwp *, const struct netbsd32_lpathconf_args *, register_t *); +int netbsd32_memfd_create(struct lwp *, const struct netbsd32_memfd_create_args *, register_t *); + int netbsd32___kevent100(struct lwp *, const struct netbsd32___kevent100_args *, register_t *); #endif /* _NETBSD32_SYS_SYSCALLARGS_H_ */ Index: src/sys/compat/netbsd32/netbsd32_syscalls.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.157 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.158 --- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.157 Sat Jul 29 12:39:20 2023 +++ src/sys/compat/netbsd32/netbsd32_syscalls.c Sun Jul 30 05:31:30 2023 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.157 2023/07/29 12:39:20 rin Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.158 2023/07/30 05:31:30 rin Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp + * created from NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.157 2023/07/29 12:39:20 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.158 2023/07/30 05:31:30 rin Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -538,7 +538,7 @@ const char *const netbsd32_syscallnames[ /* 497 */ "netbsd32___acl_aclcheck_file", /* 498 */ "netbsd32___acl_aclcheck_fd", /* 499 */ "netbsd32_lpathconf", - /* 500 */ "#500 (unimplemented memfd_c
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 05:31:30 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: COMPANT_NETBSD32: Regen for syscalls.master,v 1.143 To generate a diff of this commit: cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.37 -r1.38 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.50 -r1.51 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 05:30:45 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c syscalls.master Log Message: COMPAT_NETBSD32: Add support for memfd_create(2). To generate a diff of this commit: cvs rdiff -u -r1.234 -r1.235 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.234 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.235 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.234 Sun Jul 30 05:10:47 2023 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Sun Jul 30 05:30:45 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.235 2023/07/30 05:30:45 rin Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.235 2023/07/30 05:30:45 rin Exp $"); /* * below are all the standard NetBSD system calls, in the 32bit @@ -2648,6 +2648,21 @@ netbsd32_eventfd(struct lwp *l, return sys_eventfd(l, &ua, retval); } +int +netbsd32_memfd_create(struct lwp *l, +const struct netbsd32_memfd_create_args *uap, register_t *retval) +{ + /* { + syscallarg(const netbsd32_charp) name; + syscallarg(unsigned int) flags; + } */ + struct sys_memfd_create_args ua; + + NETBSD32TOP_UAP(name, const char); + NETBSD32TO64_UAP(flags); + return sys_memfd_create(l, &ua, retval); +} + /* * MI indirect system call support. * Only used if the MD netbsd32_syscall.c doesn't intercept the calls. Index: src/sys/compat/netbsd32/syscalls.master diff -u src/sys/compat/netbsd32/syscalls.master:1.142 src/sys/compat/netbsd32/syscalls.master:1.143 --- src/sys/compat/netbsd32/syscalls.master:1.142 Sat Jul 29 12:38:25 2023 +++ src/sys/compat/netbsd32/syscalls.master Sun Jul 30 05:30:45 2023 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp $ + $NetBSD: syscalls.master,v 1.143 2023/07/30 05:30:45 rin Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -1214,7 +1214,8 @@ acl_type_t type, netbsd32_aclp_t aclp); } 499 STD { long|netbsd32||lpathconf(const netbsd32_charp path, \ int name); } -500 UNIMPL memfd_create +500 STD { int|netbsd32||memfd_create( \ + const netbsd32_charp name, unsigned int flags); } 501 STD { int|netbsd32|100|kevent(int fd, \ const netbsd32_keventp_t changelist, \ netbsd32_size_t nchanges, \
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 05:30:45 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c syscalls.master Log Message: COMPAT_NETBSD32: Add support for memfd_create(2). To generate a diff of this commit: cvs rdiff -u -r1.234 -r1.235 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 05:10:48 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c Log Message: netbsd32_netbsd: Sort headers. No binary changes. To generate a diff of this commit: cvs rdiff -u -r1.233 -r1.234 src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sun Jul 30 05:10:48 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c Log Message: netbsd32_netbsd: Sort headers. No binary changes. To generate a diff of this commit: cvs rdiff -u -r1.233 -r1.234 src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.233 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.234 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.233 Mon Sep 20 01:07:45 2021 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Sun Jul 30 05:10:47 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.233 2021/09/20 01:07:45 thorpej Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.233 2021/09/20 01:07:45 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.234 2023/07/30 05:10:47 rin Exp $"); /* * below are all the standard NetBSD system calls, in the 32bit @@ -57,45 +57,44 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_net #endif #include -#include +#include +#include +#include +#include +#include #include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include #include -#include -#include +#include #include #include +#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include #include #include -#include -#include -#include -#include - #include #include +#include #include #include #include -#include #include
Re: CVS commit: src/sys/compat/netbsd32
Oops, thanks for quick fix, and it seems that I need a cup of coffee... Thanks, rin On 2023/07/29 22:57, Paul Goyette wrote: Module Name:src Committed By: pgoyette Date: Sat Jul 29 13:57:28 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_80.c netbsd32_compat_90.c Log Message: Don't skip compat_netbsd32_90 in the dependency chain. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/compat/netbsd32/netbsd32_compat_80.c cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_90.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: pgoyette Date: Sat Jul 29 13:57:28 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_80.c netbsd32_compat_90.c Log Message: Don't skip compat_netbsd32_90 in the dependency chain. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/compat/netbsd32/netbsd32_compat_80.c cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_90.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_compat_80.c diff -u src/sys/compat/netbsd32/netbsd32_compat_80.c:1.7 src/sys/compat/netbsd32/netbsd32_compat_80.c:1.8 --- src/sys/compat/netbsd32/netbsd32_compat_80.c:1.7 Sat Jul 29 13:40:51 2023 +++ src/sys/compat/netbsd32/netbsd32_compat_80.c Sat Jul 29 13:57:28 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_80.c,v 1.7 2023/07/29 13:40:51 rin Exp $ */ +/* $NetBSD: netbsd32_compat_80.c,v 1.8 2023/07/29 13:57:28 pgoyette Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.7 2023/07/29 13:40:51 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.8 2023/07/29 13:57:28 pgoyette Exp $"); #include #include @@ -175,7 +175,7 @@ netbsd32_80_modctl(struct lwp *lwp, cons return error; } -MODULE(MODULE_CLASS_EXEC, compat_netbsd32_80, "compat_netbsd32_100,compat_80"); +MODULE(MODULE_CLASS_EXEC, compat_netbsd32_80, "compat_netbsd32_90,compat_80"); static int compat_netbsd32_80_modcmd(modcmd_t cmd, void *arg) Index: src/sys/compat/netbsd32/netbsd32_compat_90.c diff -u src/sys/compat/netbsd32/netbsd32_compat_90.c:1.1 src/sys/compat/netbsd32/netbsd32_compat_90.c:1.2 --- src/sys/compat/netbsd32/netbsd32_compat_90.c:1.1 Sun Sep 22 22:59:38 2019 +++ src/sys/compat/netbsd32/netbsd32_compat_90.c Sat Jul 29 13:57:28 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_90.c,v 1.1 2019/09/22 22:59:38 christos Exp $ */ +/* $NetBSD: netbsd32_compat_90.c,v 1.2 2023/07/29 13:57:28 pgoyette Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_90.c,v 1.1 2019/09/22 22:59:38 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_90.c,v 1.2 2023/07/29 13:57:28 pgoyette Exp $"); #include #include @@ -152,7 +152,8 @@ static struct syscall_package compat_net { 0, 0, NULL } }; -MODULE(MODULE_CLASS_EXEC, compat_netbsd32_90, "compat_netbsd32,compat_90"); +MODULE(MODULE_CLASS_EXEC, compat_netbsd32_90, "compat_netbsd32_100,compat_90"); + static int compat_netbsd32_90_modcmd(modcmd_t cmd, void *arg)
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: pgoyette Date: Sat Jul 29 13:57:28 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_80.c netbsd32_compat_90.c Log Message: Don't skip compat_netbsd32_90 in the dependency chain. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/compat/netbsd32/netbsd32_compat_80.c cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_90.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 13:40:51 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_compat_80.c Log Message: COMPAT_NETBSD32: Reorganize the previous; Make compat_netbsd32_50 recursively depended on compat_netbsd32_100, rather than directly depended on it. Thanks pgoyette@ again for useful comments! To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.6 -r1.7 src/sys/compat/netbsd32/netbsd32_compat_80.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_compat_50.c diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.55 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.56 --- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.55 Sat Jul 29 13:13:50 2023 +++ src/sys/compat/netbsd32/netbsd32_compat_50.c Sat Jul 29 13:40:51 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_50.c,v 1.55 2023/07/29 13:13:50 rin Exp $ */ +/* $NetBSD: netbsd32_compat_50.c,v 1.56 2023/07/29 13:40:51 rin Exp $ */ /*- * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.55 2023/07/29 13:13:50 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.56 2023/07/29 13:40:51 rin Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -974,8 +974,7 @@ static struct syscall_package compat_net { 0, 0, NULL } }; -MODULE(MODULE_CLASS_EXEC, compat_netbsd32_50, -"compat_netbsd32_100,compat_netbsd32_60,compat_50"); +MODULE(MODULE_CLASS_EXEC, compat_netbsd32_50, "compat_netbsd32_60,compat_50"); static int compat_netbsd32_50_modcmd(modcmd_t cmd, void *arg) Index: src/sys/compat/netbsd32/netbsd32_compat_80.c diff -u src/sys/compat/netbsd32/netbsd32_compat_80.c:1.6 src/sys/compat/netbsd32/netbsd32_compat_80.c:1.7 --- src/sys/compat/netbsd32/netbsd32_compat_80.c:1.6 Thu Dec 12 02:15:42 2019 +++ src/sys/compat/netbsd32/netbsd32_compat_80.c Sat Jul 29 13:40:51 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_80.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $ */ +/* $NetBSD: netbsd32_compat_80.c,v 1.7 2023/07/29 13:40:51 rin Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.6 2019/12/12 02:15:42 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.7 2023/07/29 13:40:51 rin Exp $"); #include #include @@ -175,7 +175,7 @@ netbsd32_80_modctl(struct lwp *lwp, cons return error; } -MODULE(MODULE_CLASS_EXEC, compat_netbsd32_80, "compat_netbsd32,compat_80"); +MODULE(MODULE_CLASS_EXEC, compat_netbsd32_80, "compat_netbsd32_100,compat_80"); static int compat_netbsd32_80_modcmd(modcmd_t cmd, void *arg)
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 13:40:51 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_compat_80.c Log Message: COMPAT_NETBSD32: Reorganize the previous; Make compat_netbsd32_50 recursively depended on compat_netbsd32_100, rather than directly depended on it. Thanks pgoyette@ again for useful comments! To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.56 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.6 -r1.7 src/sys/compat/netbsd32/netbsd32_compat_80.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/compat/netbsd32
On 2023/07/29 22:13, Rin Okuyama wrote: Module Name:src Committed By: rin Date: Sat Jul 29 13:13:50 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c Log Message: Now, netbsd32_compat_50 module requires netbsd32_compat_100. Thanks pgoyette@ for hints. Hmm, file name is netbsd32_compat_x.c but module name is compat_netbsd32_x. Diff was correct :) Thanks, rin
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 13:13:50 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c Log Message: Now, netbsd32_compat_50 module requires netbsd32_compat_100. Thanks pgoyette@ for hints. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/compat/netbsd32/netbsd32_compat_50.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_compat_50.c diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.54 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.55 --- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.54 Sat Jul 29 12:38:25 2023 +++ src/sys/compat/netbsd32/netbsd32_compat_50.c Sat Jul 29 13:13:50 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_50.c,v 1.54 2023/07/29 12:38:25 rin Exp $ */ +/* $NetBSD: netbsd32_compat_50.c,v 1.55 2023/07/29 13:13:50 rin Exp $ */ /*- * Copyright (c) 2008, 2020 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.54 2023/07/29 12:38:25 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.55 2023/07/29 13:13:50 rin Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -974,7 +974,8 @@ static struct syscall_package compat_net { 0, 0, NULL } }; -MODULE(MODULE_CLASS_EXEC, compat_netbsd32_50, "compat_netbsd32_60,compat_50"); +MODULE(MODULE_CLASS_EXEC, compat_netbsd32_50, +"compat_netbsd32_100,compat_netbsd32_60,compat_50"); static int compat_netbsd32_50_modcmd(modcmd_t cmd, void *arg)
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 13:13:50 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c Log Message: Now, netbsd32_compat_50 module requires netbsd32_compat_100. Thanks pgoyette@ for hints. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/compat/netbsd32/netbsd32_compat_50.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 12:48:15 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_100.c netbsd32_event.c netbsd32_event.h Log Message: COMPAT_NETBSD32: No need to have compat_100_netbsd32_kevent_fetch_timeout. NFCI. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_compat_100.c cvs rdiff -u -r1.13 -r1.14 src/sys/compat/netbsd32/netbsd32_event.c cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_compat_100.c diff -u src/sys/compat/netbsd32/netbsd32_compat_100.c:1.2 src/sys/compat/netbsd32/netbsd32_compat_100.c:1.3 --- src/sys/compat/netbsd32/netbsd32_compat_100.c:1.2 Sat Jul 29 12:38:25 2023 +++ src/sys/compat/netbsd32/netbsd32_compat_100.c Sat Jul 29 12:48:15 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_100.c,v 1.2 2023/07/29 12:38:25 rin Exp $ */ +/* $NetBSD: netbsd32_compat_100.c,v 1.3 2023/07/29 12:48:15 rin Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.2 2023/07/29 12:38:25 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.3 2023/07/29 12:48:15 rin Exp $"); #include #include @@ -46,22 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com #include #include -static int -compat_100_netbsd32_kevent_fetch_timeout(const void *src, void *dest, -size_t length) -{ - struct netbsd32_timespec ts32; - int error; - - KASSERT(length == sizeof(struct timespec)); - - error = copyin(src, &ts32, sizeof(ts32)); - if (error) - return error; - netbsd32_to_timespec(&ts32, (struct timespec *)dest); - return 0; -} - static void compat_100_netbsd32_to_kevent(const struct netbsd32_kevent100 *ke32, struct kevent *ke) @@ -134,7 +118,7 @@ compat_100_netbsd32___kevent50(struct lw syscallarg(netbsd32_timespecp_t) timeout; } */ struct kevent_ops netbsd32_kevent_ops = { - .keo_fetch_timeout = compat_100_netbsd32_kevent_fetch_timeout, + .keo_fetch_timeout = netbsd32_kevent_fetch_timeout, .keo_fetch_changes = compat_100_netbsd32_kevent_fetch_changes, .keo_put_events = compat_100_netbsd32_kevent_put_events, }; Index: src/sys/compat/netbsd32/netbsd32_event.c diff -u src/sys/compat/netbsd32/netbsd32_event.c:1.13 src/sys/compat/netbsd32/netbsd32_event.c:1.14 --- src/sys/compat/netbsd32/netbsd32_event.c:1.13 Sat Jul 29 12:38:25 2023 +++ src/sys/compat/netbsd32/netbsd32_event.c Sat Jul 29 12:48:15 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_event.c,v 1.13 2023/07/29 12:38:25 rin Exp $ */ +/* $NetBSD: netbsd32_event.c,v 1.14 2023/07/29 12:48:15 rin Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_event.c,v 1.13 2023/07/29 12:38:25 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_event.c,v 1.14 2023/07/29 12:48:15 rin Exp $"); #include #include @@ -46,7 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_eve #include #include -static int +int netbsd32_kevent_fetch_timeout(const void *src, void *dest, size_t length) { struct netbsd32_timespec ts32; Index: src/sys/compat/netbsd32/netbsd32_event.h diff -u src/sys/compat/netbsd32/netbsd32_event.h:1.1 src/sys/compat/netbsd32/netbsd32_event.h:1.2 --- src/sys/compat/netbsd32/netbsd32_event.h:1.1 Sat Jul 29 12:38:25 2023 +++ src/sys/compat/netbsd32/netbsd32_event.h Sat Jul 29 12:48:15 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_event.h,v 1.1 2023/07/29 12:38:25 rin Exp $ */ +/* $NetBSD: netbsd32_event.h,v 1.2 2023/07/29 12:48:15 rin Exp $ */ /* * Copyright (c) 2023 NetBSD Foundation, Inc. @@ -32,6 +32,7 @@ #include /* netbsd32_event.c */ +int netbsd32_kevent_fetch_timeout(const void *, void *, size_t); int netbsd32_kevent1(register_t *, int, const netbsd32_kevent100p_t, netbsd32_size_t, netbsd32_kevent100p_t, netbsd32_size_t, netbsd32_timespecp_t, struct kevent_ops *);
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 12:48:15 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_100.c netbsd32_event.c netbsd32_event.h Log Message: COMPAT_NETBSD32: No need to have compat_100_netbsd32_kevent_fetch_timeout. NFCI. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_compat_100.c cvs rdiff -u -r1.13 -r1.14 src/sys/compat/netbsd32/netbsd32_event.c cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 12:39:20 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: COMPAT_NETBSD32: Regen for syscalls.master,v 1.142 To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.36 -r1.37 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.157 src/sys/compat/netbsd32/netbsd32_syscall.h:1.158 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.157 Mon Sep 20 01:07:56 2021 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Sat Jul 29 12:39:20 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.157 2021/09/20 01:07:56 thorpej Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.158 2023/07/29 12:39:20 rin Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp + * created from NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -917,7 +917,7 @@ /* syscall: "kqueue" ret: "int" args: */ #define NETBSD32_SYS_kqueue 344 -/* syscall: "compat_50_netbsd32_kevent" ret: "int" args: "int" "netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_timespec50p_t" */ +/* syscall: "compat_50_netbsd32_kevent" ret: "int" args: "int" "netbsd32_kevent100p_t" "netbsd32_size_t" "netbsd32_kevent100p_t" "netbsd32_size_t" "netbsd32_timespec50p_t" */ #define NETBSD32_SYS_compat_50_netbsd32_kevent 345 /* syscall: "netbsd32__sched_setparam" ret: "int" args: "pid_t" "lwpid_t" "int" "const netbsd32_sched_paramp_t" */ @@ -1144,8 +1144,8 @@ /* syscall: "compat_60_netbsd32__lwp_park" ret: "int" args: "const netbsd32_timespecp_t" "lwpid_t" "const netbsd32_voidp" "const netbsd32_voidp" */ #define NETBSD32_SYS_compat_60_netbsd32__lwp_park 434 -/* syscall: "netbsd32___kevent50" ret: "int" args: "int" "const netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */ -#define NETBSD32_SYS_netbsd32___kevent50 435 +/* syscall: "compat_100_netbsd32___kevent50" ret: "int" args: "int" "const netbsd32_kevent100p_t" "netbsd32_size_t" "netbsd32_kevent100p_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */ +#define NETBSD32_SYS_compat_100_netbsd32___kevent50 435 /* syscall: "netbsd32___pselect50" ret: "int" args: "int" "netbsd32_fd_setp_t" "netbsd32_fd_setp_t" "netbsd32_fd_setp_t" "const netbsd32_timespecp_t" "const netbsd32_sigsetp_t" */ #define NETBSD32_SYS_netbsd32___pselect50 436 @@ -1338,6 +1338,9 @@ /* syscall: "netbsd32_lpathconf" ret: "long" args: "const netbsd32_charp" "int" */ #define NETBSD32_SYS_netbsd32_lpathconf 499 -#define NETBSD32_SYS_MAXSYSCALL 500 +/* syscall: "netbsd32___kevent100" ret: "int" args: "int" "const netbsd32_keventp_t" "netbsd32_size_t" "netbsd32_keventp_t" "netbsd32_size_t" "const netbsd32_timespecp_t" */ +#define NETBSD32_SYS_netbsd32___kevent100 501 + +#define NETBSD32_SYS_MAXSYSCALL 505 #define NETBSD32_SYS_NSYSENT 512 #endif /* _NETBSD32_SYS_SYSCALL_H_ */ Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.156 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.157 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.156 Mon Sep 20 01:07:56 2021 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Sat Jul 29 12:39:20 2023 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.156 2021/09/20 01:07:56 thorpej Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.157 2023/07/29 12:39:20 rin Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp + * created from NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -1777,9 +1777,9 @@ check_syscall_args(netbsd32_rasctl) struct compat_50_netbsd32_kevent_args { syscallarg(int) fd; - syscallarg(netbsd32_keventp_t) changelist; + syscallarg(netbsd32_kevent100p_t) changelist; syscallarg(netbsd32_size_t) nchanges; - syscallarg(netbsd32_keventp_t) eventlist; + syscallarg(netbsd32_kevent100p_t) eventlist; syscallarg(netbsd32_size_t) nevents; syscallarg(netbsd32_time
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 12:39:20 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: COMPAT_NETBSD32: Regen for syscalls.master,v 1.142 To generate a diff of this commit: cvs rdiff -u -r1.157 -r1.158 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.36 -r1.37 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 12:38:25 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_compat_100.c netbsd32_compat_50.c netbsd32_conv.h netbsd32_event.c syscalls.master Added Files: src/sys/compat/netbsd32: netbsd32_event.h Log Message: COMPAT_NETBSD32: Catch up with sys___kevent100() addition. XXX Add epoll_* and memfd_create. To generate a diff of this commit: cvs rdiff -u -r1.141 -r1.142 src/sys/compat/netbsd32/netbsd32.h \ src/sys/compat/netbsd32/syscalls.master cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_100.c cvs rdiff -u -r1.53 -r1.54 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.46 -r1.47 src/sys/compat/netbsd32/netbsd32_conv.h cvs rdiff -u -r1.12 -r1.13 src/sys/compat/netbsd32/netbsd32_event.c cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.141 src/sys/compat/netbsd32/netbsd32.h:1.142 --- src/sys/compat/netbsd32/netbsd32.h:1.141 Sun Feb 12 16:28:32 2023 +++ src/sys/compat/netbsd32/netbsd32.h Sat Jul 29 12:38:25 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.141 2023/02/12 16:28:32 andvar Exp $ */ +/* $NetBSD: netbsd32.h,v 1.142 2023/07/29 12:38:25 rin Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green @@ -1024,6 +1024,19 @@ struct netbsd32_kevent { uint32_t fflags; netbsd32_int64 data; netbsd32_pointer_t udata; + netbsd32_uint64 ext[4]; +}; + +/* from */ +typedef netbsd32_pointer_t netbsd32_kevent100p_t; + +struct netbsd32_kevent100 { + netbsd32_uintptr_t ident; + uint32_t filter; + uint32_t flags; + uint32_t fflags; + netbsd32_int64 data; + netbsd32_pointer_t udata; }; /* from */ Index: src/sys/compat/netbsd32/syscalls.master diff -u src/sys/compat/netbsd32/syscalls.master:1.141 src/sys/compat/netbsd32/syscalls.master:1.142 --- src/sys/compat/netbsd32/syscalls.master:1.141 Mon Sep 20 01:07:45 2021 +++ src/sys/compat/netbsd32/syscalls.master Sat Jul 29 12:38:25 2023 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp $ + $NetBSD: syscalls.master,v 1.142 2023/07/29 12:38:25 rin Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -783,9 +783,9 @@ 344 NOARGS { int|sys||kqueue(void); } 345 COMPAT_50 MODULAR compat_netbsd32_50 \ { int|netbsd32||kevent(int fd, \ - netbsd32_keventp_t changelist, \ + netbsd32_kevent100p_t changelist, \ netbsd32_size_t nchanges, \ - netbsd32_keventp_t eventlist, \ + netbsd32_kevent100p_t eventlist, \ netbsd32_size_t nevents, \ netbsd32_timespec50p_t timeout); } ; Scheduling system calls. @@ -1016,10 +1016,11 @@ const netbsd32_timespecp_t ts, \ lwpid_t unpark, const netbsd32_voidp hint, \ const netbsd32_voidp unparkhint); } -435 STD { int|netbsd32|50|kevent(int fd, \ - const netbsd32_keventp_t changelist, \ +435 COMPAT_100 MODULAR compat_netbsd32_100 \ + { int|netbsd32|50|kevent(int fd, \ + const netbsd32_kevent100p_t changelist, \ netbsd32_size_t nchanges, \ - netbsd32_keventp_t eventlist, \ + netbsd32_kevent100p_t eventlist, \ netbsd32_size_t nevents, \ const netbsd32_timespecp_t timeout); } 436 STD { int|netbsd32|50|pselect(int nd, \ @@ -1213,3 +1214,13 @@ acl_type_t type, netbsd32_aclp_t aclp); } 499 STD { long|netbsd32||lpathconf(const netbsd32_charp path, \ int name); } +500 UNIMPL memfd_create +501 STD { int|netbsd32|100|kevent(int fd, \ + const netbsd32_keventp_t changelist, \ + netbsd32_size_t nchanges, \ + netbsd32_keventp_t eventlist, \ + netbsd32_size_t nevents, \ + const netbsd32_timespecp_t timeout); } +502 UNIMPL epoll_create1 +503 UNIMPL epoll_ctl +504 UNIMPL epoll_pwait2 Index: src/sys/compat/netbsd32/netbsd32_compat_100.c diff -u src/sys/compat/netbsd32/netbsd32_compat_100.c:1.1 src/sys/compat/netbsd32/netbsd32_compat_100.c:1.2 --- src/sys/compat/netbsd32/netbsd32_compat_100.c:1.1 Mon Dec 19 23:19:51 2022 +++ src/sys/compat/netbsd32/netbsd32_compat_100.c Sat Jul 29 12:38:25 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_100.c,v 1.1 2022/12/19 23:19:51 pgoyette Exp $ */ +/* $NetBSD: netbsd32_compat_100.c,v 1.2 2023/07/29 12:38:25 rin Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -30,14 +30,126 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.1 2022/12/19 23:19:51 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_100.c,v 1.2 2023/07/29 12:38:25 rin Exp $"); +#include +#include +#include #include +#include +#include +#include #include #include #include #include +#incl
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Sat Jul 29 12:38:25 UTC 2023 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_compat_100.c netbsd32_compat_50.c netbsd32_conv.h netbsd32_event.c syscalls.master Added Files: src/sys/compat/netbsd32: netbsd32_event.h Log Message: COMPAT_NETBSD32: Catch up with sys___kevent100() addition. XXX Add epoll_* and memfd_create. To generate a diff of this commit: cvs rdiff -u -r1.141 -r1.142 src/sys/compat/netbsd32/netbsd32.h \ src/sys/compat/netbsd32/syscalls.master cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_compat_100.c cvs rdiff -u -r1.53 -r1.54 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.46 -r1.47 src/sys/compat/netbsd32/netbsd32_conv.h cvs rdiff -u -r1.12 -r1.13 src/sys/compat/netbsd32/netbsd32_event.c cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_event.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: reinoud Date: Sat Apr 23 17:46:23 UTC 2022 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_fs.c Log Message: Implement support for mounting UDF in compat32 Fixes PR#56801 To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.94 -r1.95 src/sys/compat/netbsd32/netbsd32_fs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: reinoud Date: Sat Apr 23 17:46:23 UTC 2022 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_fs.c Log Message: Implement support for mounting UDF in compat32 Fixes PR#56801 To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.94 -r1.95 src/sys/compat/netbsd32/netbsd32_fs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.139 src/sys/compat/netbsd32/netbsd32.h:1.140 --- src/sys/compat/netbsd32/netbsd32.h:1.139 Thu Nov 11 17:32:46 2021 +++ src/sys/compat/netbsd32/netbsd32.h Sat Apr 23 17:46:23 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.139 2021/11/11 17:32:46 martin Exp $ */ +/* $NetBSD: netbsd32.h,v 1.140 2022/04/23 17:46:23 reinoud Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green @@ -1140,6 +1140,25 @@ struct netbsd32_msdosfs_args { int gmtoff; /* v3: offset from UTC in seconds */ }; +/* from */ +struct netbsd32_udf_args { + uint32_t version; /* version of this structure */ + netbsd32_charp fspec; /* mount specifier */ + int32_t sessionnr; /* session specifier, rel of abs */ + uint32_t udfmflags; /* mount options */ + int32_t gmtoff; /* offset from UTC in seconds*/ + + uid_t anon_uid; /* mapping of anonymous files uid*/ + gid_t anon_gid; /* mapping of anonymous files gid*/ + uid_t nobody_uid; /* nobody:nobody will map to -1:-1 */ + gid_t nobody_gid; /* nobody:nobody will map to -1:-1 */ + + uint32_t sector_size; /* for mounting dumps/files */ + + /* extendable */ + uint8_t reserved[32]; +}; + /* from */ struct netbsd32_layer_args { netbsd32_charp target; /* Target of loopback */ Index: src/sys/compat/netbsd32/netbsd32_fs.c diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.94 src/sys/compat/netbsd32/netbsd32_fs.c:1.95 --- src/sys/compat/netbsd32/netbsd32_fs.c:1.94 Sat Sep 11 10:08:55 2021 +++ src/sys/compat/netbsd32/netbsd32_fs.c Sat Apr 23 17:46:23 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_fs.c,v 1.94 2021/09/11 10:08:55 riastradh Exp $ */ +/* $NetBSD: netbsd32_fs.c,v 1.95 2022/04/23 17:46:23 reinoud Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.94 2021/09/11 10:08:55 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.95 2022/04/23 17:46:23 reinoud Exp $"); #include #include @@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_fs. #include #include #include +#include #include #include @@ -790,6 +791,7 @@ netbsd32___mount50(struct lwp *l, const struct netbsd32_iso_args iso_args; struct netbsd32_nfs_args nfs_args; struct netbsd32_msdosfs_args msdosfs_args; + struct netbsd32_udf_args udf_args; struct netbsd32_tmpfs_args tmpfs_args; struct netbsd32_null_args null_args; } fs_args32; @@ -799,6 +801,7 @@ netbsd32___mount50(struct lwp *l, const struct iso_args iso_args; struct nfs_args nfs_args; struct msdosfs_args msdosfs_args; + struct udf_args udf_args; struct tmpfs_args tmpfs_args; struct null_args null_args; } fs_args; @@ -925,6 +928,40 @@ netbsd32___mount50(struct lwp *l, const data_seg = UIO_SYSSPACE; data = &fs_args.msdosfs_args; data_len = sizeof(fs_args.msdosfs_args); + } else if (strcmp(mtype, MOUNT_UDF) == 0) { + if (data_len != 0 && data_len < sizeof(fs_args32.udf_args)) + return EINVAL; + if ((flags & MNT_GETARGS) == 0) { + error = copyin(data, &fs_args32.udf_args, + sizeof(fs_args32.udf_args)); + if (error) +return error; + fs_args.udf_args.version = + fs_args32.udf_args.version; + fs_args.udf_args.fspec = + NETBSD32PTR64(fs_args32.udf_args.fspec); + fs_args.udf_args.sessionnr = + fs_args32.udf_args.sessionnr; + fs_args.udf_args.udfmflags = + fs_args32.udf_args.udfmflags; + fs_args.udf_args.gmtoff = + fs_args32.udf_args.gmtoff; + fs_args.udf_args.anon_uid = + fs_args32.udf_args.anon_uid; + fs_args.udf_args.anon_gid = + fs_args32.udf_args.anon_gid; + fs_args.udf_args.nobody_uid = + fs_args32.udf_args.nobody_uid; + fs_args.udf_args.nobody_gid = + fs_args32.udf_args.nobody_gid; + fs_args.udf_args.sector_size = + fs_args32.udf_args.sector_size; + memset(fs_args.udf_args.reserved, 0, + sizeof(fs_args.udf_args.reserved)); + } + data_seg = UIO_SYSSPACE; + data = &fs_args.udf_args; + data_len = sizeof(fs_args.udf_args); } else if (strcmp(mtype, MOUNT_NFS) == 0) { if (data_len != 0 && data_len < sizeof(fs_args32.nfs_args)) return EINVAL; @@ -1032,6 +1069,35 @@ netbsd32___mount50(struct lwp *l, const error = copyout(&fs_args32.iso_args, udata, sizeof(fs_args32.iso_arg
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: roy Date: Wed Dec 22 00:21:32 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: Handle the SIOCGNBRINFO ioctl for compat32. arp -a works with compat32 now. Credit to simonb@ for the ndp fix from which this is cribbed. To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.78 -r1.79 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.119 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.120 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.119 Wed Apr 14 16:26:23 2021 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Wed Dec 22 00:21:32 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.119 2021/04/14 16:26:23 mlelstv Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.120 2021/12/22 00:21:32 roy Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.119 2021/04/14 16:26:23 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.120 2021/12/22 00:21:32 roy Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -180,6 +180,18 @@ netbsd32_to_ifmediareq(struct netbsd32_i } static inline void +netbsd32_to_in_nbrinfo(struct netbsd32_in_nbrinfo *s32p, struct in_nbrinfo *p, +u_long cmd) +{ + + memcpy(p->ifname, s32p->ifname, sizeof p->ifname); + memcpy(&p->addr, &s32p->addr, sizeof p->addr); + p->asked = s32p->asked; + p->state = s32p->state; + p->expire = s32p->expire; +} + +static inline void netbsd32_to_in6_nbrinfo(struct netbsd32_in6_nbrinfo *s32p, struct in6_nbrinfo *p, u_long cmd) { @@ -190,7 +202,6 @@ netbsd32_to_in6_nbrinfo(struct netbsd32_ p->isrouter = s32p->isrouter; p->state = s32p->state; p->expire = s32p->expire; - } static inline void @@ -715,6 +726,18 @@ netbsd32_from_ifmediareq(struct ifmediar } static inline void +netbsd32_from_in_nbrinfo(struct in_nbrinfo *p, struct netbsd32_in_nbrinfo *s32p, +u_long cmd) +{ + + memcpy(s32p->ifname, p->ifname, sizeof s32p->ifname); + memcpy(&s32p->addr, &p->addr, sizeof s32p->addr); + s32p->asked = p->asked; + s32p->state = p->state; + s32p->expire = p->expire; +} + +static inline void netbsd32_from_in6_nbrinfo(struct in6_nbrinfo *p, struct netbsd32_in6_nbrinfo *s32p, u_long cmd) { @@ -1525,6 +1548,8 @@ netbsd32_ioctl(struct lwp *l, case SIOCGIFMEDIA32: IOCTL_STRUCT_CONV_TO(SIOCGIFMEDIA, ifmediareq); + case SIOCGNBRINFO32: + IOCTL_STRUCT_CONV_TO(SIOCGNBRINFO, in_nbrinfo); case SIOCGNBRINFO_IN632: IOCTL_STRUCT_CONV_TO(SIOCGNBRINFO_IN6, in6_nbrinfo); Index: src/sys/compat/netbsd32/netbsd32_ioctl.h diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.78 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.79 --- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.78 Wed Apr 14 16:26:23 2021 +++ src/sys/compat/netbsd32/netbsd32_ioctl.h Wed Dec 22 00:21:32 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.h,v 1.78 2021/04/14 16:26:23 mlelstv Exp $ */ +/* $NetBSD: netbsd32_ioctl.h,v 1.79 2021/12/22 00:21:32 roy Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -480,6 +480,17 @@ struct netbsd32_sioc_vif_req { /* from */ #define SIOCGETVIFCNT32 _IOWR('u', 51, struct netbsd32_sioc_vif_req)/* vif pkt cnt */ +/* from */ +struct netbsd32_in_nbrinfo { + char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */ + struct in_addr addr; /* IPv4 address of the neighbor */ + netbsd32_long asked; /* number of queries already sent for this addr */ + int state; /* reachability state */ + int expire; /* lifetime for NDP state transition */ +}; +/* from */ +#define SIOCGNBRINFO32 _IOWR('i', 249, struct netbsd32_in_nbrinfo) + /* from */ struct netbsd32_in6_nbrinfo { char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: roy Date: Wed Dec 22 00:21:32 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: Handle the SIOCGNBRINFO ioctl for compat32. arp -a works with compat32 now. Credit to simonb@ for the ndp fix from which this is cribbed. To generate a diff of this commit: cvs rdiff -u -r1.119 -r1.120 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.78 -r1.79 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: martin Date: Thu Nov 11 17:32:46 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_execve.c Log Message: Adapt to recent posix_spawn extensions. To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.43 -r1.44 src/sys/compat/netbsd32/netbsd32_execve.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.138 src/sys/compat/netbsd32/netbsd32.h:1.139 --- src/sys/compat/netbsd32/netbsd32.h:1.138 Sat Nov 6 20:42:56 2021 +++ src/sys/compat/netbsd32/netbsd32.h Thu Nov 11 17:32:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.138 2021/11/06 20:42:56 thorpej Exp $ */ +/* $NetBSD: netbsd32.h,v 1.139 2021/11/11 17:32:46 martin Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green @@ -1152,7 +1152,8 @@ struct netbsd32_null_args { }; struct netbsd32_posix_spawn_file_actions_entry { - enum { FAE32_OPEN, FAE32_DUP2, FAE32_CLOSE } fae_action; + enum { FAE32_OPEN, FAE32_DUP2, FAE32_CLOSE, + FAE32_CHDIR, FAE32_FCHDIR } fae_action; int fae_fildes; union { @@ -1164,6 +1165,9 @@ struct netbsd32_posix_spawn_file_actions struct { int newfildes; } dup2; + struct { + netbsd32_charp path; + } chdir; } fae_data; }; Index: src/sys/compat/netbsd32/netbsd32_execve.c diff -u src/sys/compat/netbsd32/netbsd32_execve.c:1.43 src/sys/compat/netbsd32/netbsd32_execve.c:1.44 --- src/sys/compat/netbsd32/netbsd32_execve.c:1.43 Tue Apr 13 05:28:16 2021 +++ src/sys/compat/netbsd32/netbsd32_execve.c Thu Nov 11 17:32:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_execve.c,v 1.43 2021/04/13 05:28:16 mrg Exp $ */ +/* $NetBSD: netbsd32_execve.c,v 1.44 2021/11/11 17:32:46 martin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.43 2021/04/13 05:28:16 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.44 2021/11/11 17:32:46 martin Exp $"); #include #include @@ -90,6 +90,26 @@ netbsd32_fexecve(struct lwp *l, const st SCARG_P32(uap, envp), netbsd32_execve_fetch_element); } +static __inline bool +netbsd32_posix_spawn_fae_path( +struct posix_spawn_file_actions_entry *fae, +struct netbsd32_posix_spawn_file_actions_entry *fae32, +char ***pathp, char **pathp32) +{ + switch (fae->fae_action) { + case FAE_OPEN: + *pathp = &fae->fae_path; + *pathp32 = NETBSD32PTR64(fae32->fae_data.open.path); + return true; + case FAE_CHDIR: + *pathp = &fae->fae_chdir_path; + *pathp32 = NETBSD32PTR64(fae32->fae_data.chdir.path); + return true; + default: + return false; + } +} + static int netbsd32_posix_spawn_fa_alloc(struct posix_spawn_file_actions **fap, const struct netbsd32_posix_spawn_file_actions *ufa, rlim_t lim) @@ -98,7 +118,7 @@ netbsd32_posix_spawn_fa_alloc(struct pos struct netbsd32_posix_spawn_file_actions fa32; struct netbsd32_posix_spawn_file_actions_entry *fae32 = NULL, *f32 = NULL; struct posix_spawn_file_actions_entry *fae; - char *pbuf = NULL; + char *pbuf = NULL, **pathp = NULL, *pathp32 = NULL; int error; size_t fal, fal32, slen, i = 0; @@ -135,26 +155,24 @@ netbsd32_posix_spawn_fa_alloc(struct pos if (fae->fae_action == FAE_DUP2) fae->fae_data.dup2.newfildes = f32->fae_data.dup2.newfildes; - if (fae->fae_action != FAE_OPEN) + if (!netbsd32_posix_spawn_fae_path(fae, f32, &pathp, &pathp32) + || pathp == NULL || pathp32 == NULL) continue; - error = copyinstr(NETBSD32PTR64(f32->fae_path), pbuf, - MAXPATHLEN, &slen); + error = copyinstr(pathp32, pbuf, MAXPATHLEN, &slen); if (error) goto out; - fae->fae_path = kmem_alloc(slen, KM_SLEEP); - memcpy(fae->fae_path, pbuf, slen); + *pathp = kmem_alloc(slen, KM_SLEEP); + memcpy(*pathp, pbuf, slen); fae->fae_oflag = f32->fae_oflag; fae->fae_mode = f32->fae_mode; } PNBUF_PUT(pbuf); - if (fae32) - kmem_free(fae32, fal32); + kmem_free(fae32, fal32); *fap = fa; return 0; out: - if (fae32) - kmem_free(fae32, fal32); + kmem_free(fae32, fal32); if (pbuf) PNBUF_PUT(pbuf); posix_spawn_fa_free(fa, i);
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: martin Date: Thu Nov 11 17:32:46 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_execve.c Log Message: Adapt to recent posix_spawn extensions. To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.43 -r1.44 src/sys/compat/netbsd32/netbsd32_execve.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: thorpej Date: Mon Sep 20 01:07:57 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: Regen for eventfd(2). To generate a diff of this commit: cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.35 -r1.36 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.154 -r1.155 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.48 -r1.49 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.156 src/sys/compat/netbsd32/netbsd32_syscall.h:1.157 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.156 Mon Sep 20 01:01:04 2021 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Mon Sep 20 01:07:56 2021 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.156 2021/09/20 01:01:04 thorpej Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.157 2021/09/20 01:07:56 thorpej Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.140 2021/09/20 01:00:55 thorpej Exp + * created from NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -728,6 +728,9 @@ /* syscall: "compat_50_netbsd32_mq_timedreceive" ret: "netbsd32_ssize_t" args: "mqd_t" "netbsd32_charp" "netbsd32_size_t" "netbsd32_uintp" "const netbsd32_timespec50p_t" */ #define NETBSD32_SYS_compat_50_netbsd32_mq_timedreceive 266 +/* syscall: "netbsd32_eventfd" ret: "int" args: "unsigned int" "int" */ +#define NETBSD32_SYS_netbsd32_eventfd 267 + /* syscall: "netbsd32___posix_rename" ret: "int" args: "netbsd32_charp" "netbsd32_charp" */ #define NETBSD32_SYS_netbsd32___posix_rename 270 Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.155 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.156 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.155 Mon Sep 20 01:01:04 2021 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Mon Sep 20 01:07:56 2021 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.155 2021/09/20 01:01:04 thorpej Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.156 2021/09/20 01:07:56 thorpej Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.140 2021/09/20 01:00:55 thorpej Exp + * created from NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -1431,6 +1431,12 @@ struct compat_50_netbsd32_mq_timedreceiv }; check_syscall_args(compat_50_netbsd32_mq_timedreceive) +struct netbsd32_eventfd_args { + syscallarg(unsigned int) val; + syscallarg(int) flags; +}; +check_syscall_args(netbsd32_eventfd) + struct netbsd32___posix_rename_args { syscallarg(netbsd32_charp) from; syscallarg(netbsd32_charp) to; @@ -3254,6 +3260,8 @@ int compat_50_netbsd32_mq_timedsend(stru int compat_50_netbsd32_mq_timedreceive(struct lwp *, const struct compat_50_netbsd32_mq_timedreceive_args *, register_t *); +int netbsd32_eventfd(struct lwp *, const struct netbsd32_eventfd_args *, register_t *); + int netbsd32___posix_rename(struct lwp *, const struct netbsd32___posix_rename_args *, register_t *); int netbsd32_swapctl(struct lwp *, const struct netbsd32_swapctl_args *, register_t *); Index: src/sys/compat/netbsd32/netbsd32_syscalls.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.155 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.156 --- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.155 Mon Sep 20 01:01:04 2021 +++ src/sys/compat/netbsd32/netbsd32_syscalls.c Mon Sep 20 01:07:56 2021 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.155 2021/09/20 01:01:04 thorpej Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.156 2021/09/20 01:07:56 thorpej Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.140 2021/09/20 01:00:55 thorpej Exp + * created from NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.155 2021/09/20 01:01:04 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.156 2021/09/20 01:07:56 thorpej Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -301,7 +301,7 @@ const char *const netbsd32_syscallnames[ /* 264 */ "netbsd32_mq_receive", /* 265 */ "compat_50_netbsd
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: thorpej Date: Mon Sep 20 01:07:57 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: Regen for eventfd(2). To generate a diff of this commit: cvs rdiff -u -r1.156 -r1.157 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.35 -r1.36 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.154 -r1.155 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.48 -r1.49 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: thorpej Date: Mon Sep 20 01:07:46 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c syscalls.master Log Message: Add the eventfd(2) system call to COMPAT_NETBSD32. To generate a diff of this commit: cvs rdiff -u -r1.232 -r1.233 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.140 -r1.141 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.232 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.233 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.232 Tue Jan 19 03:41:22 2021 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Mon Sep 20 01:07:45 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.232 2021/01/19 03:41:22 simonb Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.233 2021/09/20 01:07:45 thorpej Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.232 2021/01/19 03:41:22 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.233 2021/09/20 01:07:45 thorpej Exp $"); /* * below are all the standard NetBSD system calls, in the 32bit @@ -2634,6 +2634,21 @@ netbsd32_getrandom(struct lwp *l, const return sys_getrandom(l, &ua, retval); } +int +netbsd32_eventfd(struct lwp *l, +const struct netbsd32_eventfd_args *uap, register_t *retval) +{ + /* { + syscallarg(unsigned int) val; + syscallarg(int) flags; + } */ + struct sys_eventfd_args ua; + + NETBSD32TO64_UAP(val); + NETBSD32TO64_UAP(flags); + return sys_eventfd(l, &ua, retval); +} + /* * MI indirect system call support. * Only used if the MD netbsd32_syscall.c doesn't intercept the calls. Index: src/sys/compat/netbsd32/syscalls.master diff -u src/sys/compat/netbsd32/syscalls.master:1.140 src/sys/compat/netbsd32/syscalls.master:1.141 --- src/sys/compat/netbsd32/syscalls.master:1.140 Mon Sep 20 01:00:55 2021 +++ src/sys/compat/netbsd32/syscalls.master Mon Sep 20 01:07:45 2021 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.140 2021/09/20 01:00:55 thorpej Exp $ + $NetBSD: syscalls.master,v 1.141 2021/09/20 01:07:45 thorpej Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -640,7 +640,7 @@ netbsd32_charp msg_ptr, netbsd32_size_t msg_len, \ netbsd32_uintp msg_prio, \ const netbsd32_timespec50p_t abs_timeout); } -267 UNIMPL +267 STD { int|netbsd32||eventfd(unsigned int val, int flags); } 268 UNIMPL 269 UNIMPL 270 STD { int|netbsd32||__posix_rename(netbsd32_charp from, \
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: thorpej Date: Mon Sep 20 01:07:46 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c syscalls.master Log Message: Add the eventfd(2) system call to COMPAT_NETBSD32. To generate a diff of this commit: cvs rdiff -u -r1.232 -r1.233 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.140 -r1.141 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: thorpej Date: Mon Sep 20 01:01:05 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: Regen for timerfd. To generate a diff of this commit: cvs rdiff -u -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.154 -r1.155 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.34 -r1.35 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.153 -r1.154 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.155 src/sys/compat/netbsd32/netbsd32_syscall.h:1.156 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.155 Sat Oct 10 00:03:52 2020 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Mon Sep 20 01:01:04 2021 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.155 2020/10/10 00:03:52 rin Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.156 2021/09/20 01:01:04 thorpej Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.139 2020/10/10 00:00:54 rin Exp + * created from NetBSD: syscalls.master,v 1.140 2021/09/20 01:00:55 thorpej Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -499,6 +499,15 @@ #else /* 176 is excluded ntp_adjtime */ #endif +/* syscall: "netbsd32_timerfd_create" ret: "int" args: "netbsd32_clockid_t" "int" */ +#define NETBSD32_SYS_netbsd32_timerfd_create 177 + +/* syscall: "netbsd32_timerfd_settime" ret: "int" args: "int" "int" "const netbsd32_itimerspecp_t" "netbsd32_itimerspecp_t" */ +#define NETBSD32_SYS_netbsd32_timerfd_settime 178 + +/* syscall: "netbsd32_timerfd_gettime" ret: "int" args: "int" "netbsd32_itimerspecp_t" */ +#define NETBSD32_SYS_netbsd32_timerfd_gettime 179 + /* syscall: "netbsd32_setgid" ret: "int" args: "gid_t" */ #define NETBSD32_SYS_netbsd32_setgid 181 Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.154 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.155 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.154 Sat Oct 10 00:03:52 2020 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Mon Sep 20 01:01:04 2021 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.154 2020/10/10 00:03:52 rin Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.155 2021/09/20 01:01:04 thorpej Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.139 2020/10/10 00:00:54 rin Exp + * created from NetBSD: syscalls.master,v 1.140 2021/09/20 01:00:55 thorpej Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -953,6 +953,26 @@ check_syscall_args(netbsd32_ntp_adjtime) #else #endif +struct netbsd32_timerfd_create_args { + syscallarg(netbsd32_clockid_t) clock_id; + syscallarg(int) flags; +}; +check_syscall_args(netbsd32_timerfd_create) + +struct netbsd32_timerfd_settime_args { + syscallarg(int) fd; + syscallarg(int) flags; + syscallarg(const netbsd32_itimerspecp_t) new_value; + syscallarg(netbsd32_itimerspecp_t) old_value; +}; +check_syscall_args(netbsd32_timerfd_settime) + +struct netbsd32_timerfd_gettime_args { + syscallarg(int) fd; + syscallarg(netbsd32_itimerspecp_t) curr_value; +}; +check_syscall_args(netbsd32_timerfd_gettime) + struct netbsd32_setgid_args { syscallarg(gid_t) gid; }; @@ -3084,6 +3104,12 @@ int netbsd32_ntp_adjtime(struct lwp *, c #else #endif +int netbsd32_timerfd_create(struct lwp *, const struct netbsd32_timerfd_create_args *, register_t *); + +int netbsd32_timerfd_settime(struct lwp *, const struct netbsd32_timerfd_settime_args *, register_t *); + +int netbsd32_timerfd_gettime(struct lwp *, const struct netbsd32_timerfd_gettime_args *, register_t *); + int netbsd32_setgid(struct lwp *, const struct netbsd32_setgid_args *, register_t *); int netbsd32_setegid(struct lwp *, const struct netbsd32_setegid_args *, register_t *); Index: src/sys/compat/netbsd32/netbsd32_syscalls.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.154 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.155 --- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.154 Sat Oct 10 00:03:53 2020 +++ src/sys/compat/netbsd32/netbsd32_syscalls.c Mon Sep 20 01:01:04 2021 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.154 2020/10/10 00:03:53 rin Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.155 2021/09/20 01:01:04 thorpej Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created f
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: thorpej Date: Mon Sep 20 01:01:05 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: Regen for timerfd. To generate a diff of this commit: cvs rdiff -u -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.154 -r1.155 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.34 -r1.35 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.153 -r1.154 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: thorpej Date: Mon Sep 20 01:00:55 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_time.c syscalls.master Log Message: Add timerfd system calls to COMPAT_NETBSD32. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/compat/netbsd32/netbsd32_time.c cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_time.c diff -u src/sys/compat/netbsd32/netbsd32_time.c:1.56 src/sys/compat/netbsd32/netbsd32_time.c:1.57 --- src/sys/compat/netbsd32/netbsd32_time.c:1.56 Tue Sep 7 11:43:05 2021 +++ src/sys/compat/netbsd32/netbsd32_time.c Mon Sep 20 01:00:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_time.c,v 1.56 2021/09/07 11:43:05 riastradh Exp $ */ +/* $NetBSD: netbsd32_time.c,v 1.57 2021/09/20 01:00:55 thorpej Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.56 2021/09/07 11:43:05 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.57 2021/09/20 01:00:55 thorpej Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_tim #include #include #include +#include #include #include #include @@ -524,6 +525,84 @@ netbsd32_timer_getoverrun(struct lwp *l, } int +netbsd32_timerfd_create(struct lwp *l, +const struct netbsd32_timerfd_create_args *uap, register_t *retval) +{ + /* { + syscallarg(netbsd32_clockid_t) clock_id; + syscallarg(int) flags; + } */ + struct sys_timerfd_create_args ua; + + NETBSD32TO64_UAP(clock_id); + NETBSD32TO64_UAP(flags); + return sys_timerfd_create(l, (void *)&ua, retval); +} + +int +netbsd32_timerfd_settime(struct lwp *l, +const struct netbsd32_timerfd_settime_args *uap, register_t *retval) +{ + /* { + syscallarg(int) fd; + syscallarg(int) flags; + syscallarg(const netbsd32_itimerspecp_t) new_value; + syscallarg(netbsd32_itimerspecp_t) old_value; + } */ + struct itimerspec its, oits, *oitsp = NULL; + struct netbsd32_itimerspec its32; + int error; + + if ((error = copyin(SCARG_P32(uap, new_value), &its32, + sizeof(its32))) != 0) { + return error; + } + netbsd32_to_timespec(&its32.it_interval, &its.it_interval); + netbsd32_to_timespec(&its32.it_value, &its.it_value); + + if (SCARG_P32(uap, old_value)) { + oitsp = &oits; + } + + error = do_timerfd_settime(l, SCARG(uap, fd), SCARG(uap, flags), + &its, oitsp, retval); + if (error == 0 && oitsp != NULL) { + memset(&its32, 0, sizeof(its32)); + netbsd32_from_timespec(&oitsp->it_interval, &its32.it_interval); + netbsd32_from_timespec(&oitsp->it_value, &its32.it_value); + error = copyout(&its32, SCARG_P32(uap, old_value), +sizeof(its32)); + } + + return error; +} + +int +netbsd32_timerfd_gettime(struct lwp *l, +const struct netbsd32_timerfd_gettime_args *uap, register_t *retval) +{ + /* { + syscallarg(int) fd; + syscallarg(int) flags; + syscallarg(netbsd32_itimerspecp_t) curr_value; + } */ + int error; + struct itimerspec its; + struct netbsd32_itimerspec its32; + + error = do_timerfd_gettime(l, SCARG(uap, fd), &its, retval); + if (error == 0) { + memset(&its32, 0, sizeof(its32)); + netbsd32_from_timespec(&its.it_interval, &its32.it_interval); + netbsd32_from_timespec(&its.it_value, &its32.it_value); + error = copyout(&its32, SCARG_P32(uap, curr_value), +sizeof(its32)); + } + + return error; +} + +int netbsd32_clock_getcpuclockid2(struct lwp *l, const struct netbsd32_clock_getcpuclockid2_args *uap, register_t *retval) Index: src/sys/compat/netbsd32/syscalls.master diff -u src/sys/compat/netbsd32/syscalls.master:1.139 src/sys/compat/netbsd32/syscalls.master:1.140 --- src/sys/compat/netbsd32/syscalls.master:1.139 Sat Oct 10 00:00:54 2020 +++ src/sys/compat/netbsd32/syscalls.master Mon Sep 20 01:00:55 2021 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.139 2020/10/10 00:00:54 rin Exp $ + $NetBSD: syscalls.master,v 1.140 2021/09/20 01:00:55 thorpej Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -431,9 +431,14 @@ #else 176 EXCL ntp_adjtime #endif -177 UNIMPL -178 UNIMPL -179 UNIMPL +177 STD { int|netbsd32||timerfd_create( \ + netbsd32_clockid_t clock_id, \ + int flags); } +178 STD { int|netbsd32||timerfd_settime(int fd, int flags, \ + const netbsd32_itimerspecp_t new_value, \ + netbsd32_itimerspecp_t old_value); } +179 STD { int|netbsd32||timerfd_gettime(int fd, \ + netbsd32_itimerspecp_t curr_value); } 180 UNIMPL ; Syscalls 180-199 are used by/reserved for BSD
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: thorpej Date: Mon Sep 20 01:00:55 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_time.c syscalls.master Log Message: Add timerfd system calls to COMPAT_NETBSD32. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/compat/netbsd32/netbsd32_time.c cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: riastradh Date: Mon Aug 30 08:39:24 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_nfssvc.c Log Message: compat_netbsd32: Copy out 32-bit version in nfssvc32_nsd_out. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/netbsd32/netbsd32_nfssvc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_nfssvc.c diff -u src/sys/compat/netbsd32/netbsd32_nfssvc.c:1.6 src/sys/compat/netbsd32/netbsd32_nfssvc.c:1.7 --- src/sys/compat/netbsd32/netbsd32_nfssvc.c:1.6 Sun Jan 27 02:08:40 2019 +++ src/sys/compat/netbsd32/netbsd32_nfssvc.c Mon Aug 30 08:39:24 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_nfssvc.c,v 1.6 2019/01/27 02:08:40 pgoyette Exp $ */ +/* $NetBSD: netbsd32_nfssvc.c,v 1.7 2021/08/30 08:39:24 riastradh Exp $ */ /* * Copyright (c) 2015 Matthew R. Green @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_nfssvc.c,v 1.6 2019/01/27 02:08:40 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_nfssvc.c,v 1.7 2021/08/30 08:39:24 riastradh Exp $"); #if defined(_KERNEL_OPT) #include "opt_nfs.h" @@ -134,7 +134,7 @@ nfssvc32_nsd_out(void *argp, const struc args32.nsd_key[0] = nsd->nsd_key[0]; args32.nsd_key[1] = nsd->nsd_key[1]; - return copyout(nsd, argp, sizeof *nsd); + return copyout(&args32, argp, sizeof args32); } static int
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: riastradh Date: Mon Aug 30 08:39:24 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32_nfssvc.c Log Message: compat_netbsd32: Copy out 32-bit version in nfssvc32_nsd_out. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/compat/netbsd32/netbsd32_nfssvc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src/sys/compat/netbsd32
Hi Simon On 17/01/2021 11:26, Simon Burge wrote: On 15/01/2021 07:15, matthew green wrote: Oh, I quite agree. However, in6_nbrinfo predates my involvement with NetBSD and is the same struct on all BSD. While bringing the same functionality to IPv4, I elected to keep the same struct just to have the same API, warts and all. I like consistency. Does anyone else have an in_nbrinfo? I _think_ the "asked" member only seems to get assigned a 0 for ipv4, and with a long being 32-bits on any 32 bit platform making it a long instead of an int doesn't buy anything. No, it's currently unique to NetBSD. Other BSD's just don't have the infrastructure in their network for it either. I'll note that on a 64-bit platform it's 64 bits though so these do gains something. The value is similar to struct if_data counters really, so maybe it should be a uint64_t if you really want to change it. I would then argue that it might be better then to version it proper and move it out of compat32. I'm still keen to make this change (asked as an int instead of a long in in_nbrinfo) and announce a mini flag day for arp for -current users so that it's one less compat32 ioctl we have to maintain. I would just like arp to work without error. My personal preference would be to keep the same API and add compat. I've committed compat32 support for SIOCGNBRINFO_IN6 and in6_nbrinfo. Looks great! Also looks the same as what I did but couldn't get to work. Maybe I missed the netbsd32 on the long. Roy
Re: CVS commit: src/sys/compat/netbsd32
Hi Roy, Roy Marples wrote: > On 15/01/2021 07:15, matthew green wrote: > >> Oh, I quite agree. However, in6_nbrinfo predates my involvement with NetBSD > >> and is the same struct on all BSD. While bringing the same functionality to > >> IPv4, I elected to keep the same struct just to have the same API, warts > >> and all. I like consistency. Does anyone else have an in_nbrinfo? I _think_ the "asked" member only seems to get assigned a 0 for ipv4, and with a long being 32-bits on any 32 bit platform making it a long instead of an int doesn't buy anything. I'm still keen to make this change (asked as an int instead of a long in in_nbrinfo) and announce a mini flag day for arp for -current users so that it's one less compat32 ioctl we have to maintain. > > [ .. ] > >> > >> That breaks API/ABI though yes? As such it would require stuff in compat > >> anyway, but leaving it as it just needs n32 compat gunk instead which is > >> less impactful on other systems. > > > > in6_nbrinfo/in_nbrinfo are not in any published netbsd release so we can > > choose to break them in -current. there's a slight problem that -current > > has > > a minor flag day here, but it's not the compat issue you seem to think. > > CVS disagrees - in6_nbrinfo is from NetBSD-1, only in_nbrinfo is recent: > http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet6/nd6.h?rev=1.14.4.2&content-type=text/x-cvsweb-markup&only_with_tag=netbsd-1-5 Sorry, I only checked the history of in_nbrinfo and just assumed that in6_nbrinfo was of a similar vintage. I've committed compat32 support for SIOCGNBRINFO_IN6 and in6_nbrinfo. Cheers, Simon.
Re: CVS commit: src/sys/compat/netbsd32
On 15/01/2021 02:43, Simon Burge wrote: I'll test a bit more I can't actually test as my ERLite won't boot anymore. Console light is green, cu says I'm connected but I get nothing out of it. With cat5 cables plugged in the ports they flash green and then stick on amber. I'm guessing this is non recoverable :( If it is recoverable somehow I can put NetBSD back on it as I have a shiny new USG in it's place. Roy
Re: CVS commit: src/sys/compat/netbsd32
On 15/01/2021 07:15, matthew green wrote: Oh, I quite agree. However, in6_nbrinfo predates my involvement with NetBSD and is the same struct on all BSD. While bringing the same functionality to IPv4, I elected to keep the same struct just to have the same API, warts and all. I like consistency. [ .. ] That breaks API/ABI though yes? As such it would require stuff in compat anyway, but leaving it as it just needs n32 compat gunk instead which is less impactful on other systems. in6_nbrinfo/in_nbrinfo are not in any published netbsd release so we can choose to break them in -current. there's a slight problem that -current has a minor flag day here, but it's not the compat issue you seem to think. CVS disagrees - in6_nbrinfo is from NetBSD-1, only in_nbrinfo is recent: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet6/nd6.h?rev=1.14.4.2&content-type=text/x-cvsweb-markup&only_with_tag=netbsd-1-5 Roy
re: CVS commit: src/sys/compat/netbsd32
> Oh, I quite agree. > However, in6_nbrinfo predates my involvement with NetBSD and is the same > struct > on all BSD. While bringing the same functionality to IPv4, I elected to keep > the > same struct just to have the same API, warts and all. I like consistency. [ .. ] > > That breaks API/ABI though yes? > As such it would require stuff in compat anyway, but leaving it as it just > needs > n32 compat gunk instead which is less impactful on other systems. in6_nbrinfo/in_nbrinfo are not in any published netbsd release so we can choose to break them in -current. there's a slight problem that -current has a minor flag day here, but it's not the compat issue you seem to think. with simon's proposed patch, the API doesn't change, so there no source compat issue to worry about either. this _only_ breaks -current in the last 4 months or so. i think we should do this, rather than add additional compat. we're allowed (and should!) fix -current issues like this. .mrg.
Re: CVS commit: src/sys/compat/netbsd32
On 15/01/2021 02:43, Simon Burge wrote: Hi Roy, Roy Marples wrote: On 14/01/2021 11:03, Simon Burge wrote: Sure, I will have a look. Anything IPv6 related I might need a helping hand to get a test case though :). As they share a similar structure, you solve one you likely solve the other. I can assume you have working IPv4 ;) In general where we can define the structure that are passed in an interface, regardless if it's a ioctl or sysctl or whatever, we should try to design the structure so that it's the same regardless of if it's built with 32-bit or 64-bit userlands. Oh, I quite agree. However, in6_nbrinfo predates my involvement with NetBSD and is the same struct on all BSD. While bringing the same functionality to IPv4, I elected to keep the same struct just to have the same API, warts and all. I like consistency. The issue with in_nbrinfo and in6_nbrinfo is that there's a "long" in the structure, so this has different sizes depending on your native long size. I _think_ this is the is value out of the la_asked member of struct llentry which is a uint16_t so we can just make it an int the your structures will align nicely. In both cases the ifname name is 16 bytes. For in_nbrinfo in_addr is effectively an int so we have just four ints after the ifname. For in6_nbrinfo the in6_addr is 128 bytes so aligns nicely, then a couple more ints after that. If "asked" is from struct llentry then the attached patch should work without requiring any compat32 support. If you're happy with this, I'll test a bit more then commit. That breaks API/ABI though yes? As such it would require stuff in compat anyway, but leaving it as it just needs n32 compat gunk instead which is less impactful on other systems. Roy
Re: CVS commit: src/sys/compat/netbsd32
Hi Roy, Roy Marples wrote: > On 14/01/2021 11:03, Simon Burge wrote: > > Sure, I will have a look. Anything IPv6 related I might need a helping > > hand to get a test case though :). > > As they share a similar structure, you solve one you likely solve the other. > I can assume you have working IPv4 ;) In general where we can define the structure that are passed in an interface, regardless if it's a ioctl or sysctl or whatever, we should try to design the structure so that it's the same regardless of if it's built with 32-bit or 64-bit userlands. This is hard where you have pointers, both otherwise is usually possible with a bit of planning. You especially need to watch out for long which is a different size on 32-bit/64-bit userlands and also for int64_t which can align differently depending on the architecture. If you can do a printf of the struct size with a variety of arches and they're all the same then good! amd64, i386, mips64 (n32), sparc would probably cover the range of cases to test on (a compile test will do if you look at the generated code for what is passed to printf). The general rule is if we can avoid touching compat/netbsd32 then life is easier! The issue with in_nbrinfo and in6_nbrinfo is that there's a "long" in the structure, so this has different sizes depending on your native long size. I _think_ this is the is value out of the la_asked member of struct llentry which is a uint16_t so we can just make it an int the your structures will align nicely. In both cases the ifname name is 16 bytes. For in_nbrinfo in_addr is effectively an int so we have just four ints after the ifname. For in6_nbrinfo the in6_addr is 128 bytes so aligns nicely, then a couple more ints after that. If "asked" is from struct llentry then the attached patch should work without requiring any compat32 support. If you're happy with this, I'll test a bit more then commit. Cheers, Simon. Index: netinet/in_var.h === RCS file: /cvsroot/src/sys/netinet/in_var.h,v retrieving revision 1.98 diff -d -p -u -r1.98 in_var.h --- netinet/in_var.h11 Sep 2020 15:22:12 - 1.98 +++ netinet/in_var.h15 Jan 2021 02:18:01 - @@ -118,7 +118,7 @@ struct in_ifaddr { struct in_nbrinfo { char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */ struct in_addr addr;/* IPv4 address of the neighbor */ - longasked; /* number of queries already sent for this addr */ + int asked; /* number of queries already sent for this addr */ int state; /* reachability state */ int expire; /* lifetime for NDP state transition */ }; Index: netinet6/nd6.h === RCS file: /cvsroot/src/sys/netinet6/nd6.h,v retrieving revision 1.91 diff -d -p -u -r1.91 nd6.h --- netinet6/nd6.h 11 Sep 2020 15:03:33 - 1.91 +++ netinet6/nd6.h 15 Jan 2021 02:18:01 - @@ -83,7 +83,7 @@ struct nd_kifinfo { struct in6_nbrinfo { char ifname[IFNAMSIZ]; /* if name, e.g. "en0" */ struct in6_addr addr; /* IPv6 address of the neighbor */ - longasked; /* number of queries already sent for this addr */ + int asked; /* number of queries already sent for this addr */ int isrouter; /* if it acts as a router */ int state; /* reachability state */ int expire; /* lifetime for NDP state transition */
Re: CVS commit: src/sys/compat/netbsd32
On 14/01/2021 11:03, Simon Burge wrote: Sure, I will have a look. Anything IPv6 related I might need a helping hand to get a test case though :). As they share a similar structure, you solve one you likely solve the other. I can assume you have working IPv4 ;) Roy
Re: CVS commit: src/sys/compat/netbsd32
Roy Marples wrote: > On 14/01/2021 08:00, Simon Burge wrote: > > Module Name:src > > Committed By: simonb > > Date: Thu Jan 14 08:00:45 UTC 2021 > > > > Modified Files: > > src/sys/compat/netbsd32: netbsd32.h netbsd32_ioctl.c netbsd32_ioctl.h > > > > Log Message: > > Handle FSSIOCSET and FSSIOCGET; vndconfig(8) works with compat32 now. > > XXX: FSSIOCSET50 and FSSIOCGET50 are not (yet) handled. > > Could I prompt you into looking at SIOCGNBRINFO (arp -a) and SIOCGNBRINFO_IN6 > (ndp -a) please? > > I could never get that working. Sure, I will have a look. Anything IPv6 related I might need a helping hand to get a test case though :). Cheers, Simon.
Re: CVS commit: src/sys/compat/netbsd32
On 14/01/2021 08:00, Simon Burge wrote: Module Name:src Committed By: simonb Date: Thu Jan 14 08:00:45 UTC 2021 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_ioctl.c netbsd32_ioctl.h Log Message: Handle FSSIOCSET and FSSIOCGET; vndconfig(8) works with compat32 now. XXX: FSSIOCSET50 and FSSIOCGET50 are not (yet) handled. Could I prompt you into looking at SIOCGNBRINFO (arp -a) and SIOCGNBRINFO_IN6 (ndp -a) please? I could never get that working. Thanks Roy
Re: CVS commit: src/sys/compat/netbsd32
On Mon, 9 Mar 2020, Paul Goyette wrote: Module Name:src Committed By: pgoyette Date: Mon Mar 9 01:06:34 UTC 2020 Modified Files: src/sys/compat/netbsd32: netbsd32_mod.c Log Message: If a syscall requires a module to be autoloaded, the initial invocation of that syscall will return ERESTART. For amd64's netbsd32_syscall() that means we need to back up the PC saved in the trap frame so we can re-issue the syscall instruction. For "normal" syscall traps, we saved the instruction length in the trap frame, but this was missing for the oosyscall/lcall path. Since the PC was not backed up, the kernel-only value ERESTART was returned to userland, causing all sort of grief for old compat_netbsd32 executables! While here, I also added some comments on some recent #endif to better identify their associated #if - no functional change intended for this. XXX Pullup-9 To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/compat/netbsd32/netbsd32_mod.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. !DSPAM:5e6596db22973983836595! ++--+---+ | Paul Goyette | PGP Key fingerprint: | E-mail addresses: | | (Retired) | FA29 0E3B 35AF E8AE 6651 | p...@whooppee.com | | Software Developer | 0786 F758 55DE 53BA 7731 | pgoye...@netbsd.org | ++--+---+
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 11:01:41 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: TRAP_EXEC does not have extra fields to be filled in at the moment. Explicitly ignore fields for now. Pointed out by kamil. Thanks! XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 11:01:41 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: TRAP_EXEC does not have extra fields to be filled in at the moment. Explicitly ignore fields for now. Pointed out by kamil. Thanks! XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_signal.c diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.49 src/sys/compat/netbsd32/netbsd32_signal.c:1.50 --- src/sys/compat/netbsd32/netbsd32_signal.c:1.49 Mon Nov 18 10:25:48 2019 +++ src/sys/compat/netbsd32/netbsd32_signal.c Mon Nov 18 11:01:41 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_signal.c,v 1.49 2019/11/18 10:25:48 rin Exp $ */ +/* $NetBSD: netbsd32_signal.c,v 1.50 2019/11/18 11:01:41 rin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.49 2019/11/18 10:25:48 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.50 2019/11/18 11:01:41 rin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -213,6 +213,7 @@ fill_fault: case SIGTRAP: switch (si32->_code) { case TRAP_EXEC: + break; case TRAP_CHLD: case TRAP_LWP: si->_reason._ptrace_state._pe_report_event = @@ -302,6 +303,7 @@ fill_fault: case SIGTRAP: switch (si->_code) { case TRAP_EXEC: + break; case TRAP_CHLD: case TRAP_LWP: si32->_reason._ptrace_state._pe_report_event =
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 10:25:48 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: When converting siginfo, examine si_code at the beginning, as explained in siginfo(2). - If it is SI_NOINFO, there's no additional information. - If it is non-positive, i.e., codes described in siginfo(2), we need to fill in _rt. XXX Description for SA_ASYNCIO in siginfo(2) seems outdated; neither si_fd nor si_band are filled in with that code. XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_signal.c diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.48 src/sys/compat/netbsd32/netbsd32_signal.c:1.49 --- src/sys/compat/netbsd32/netbsd32_signal.c:1.48 Mon Nov 18 10:14:52 2019 +++ src/sys/compat/netbsd32/netbsd32_signal.c Mon Nov 18 10:25:48 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_signal.c,v 1.48 2019/11/18 10:14:52 rin Exp $ */ +/* $NetBSD: netbsd32_signal.c,v 1.49 2019/11/18 10:25:48 rin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.48 2019/11/18 10:14:52 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.49 2019/11/18 10:25:48 rin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -195,6 +195,11 @@ netbsd32_ksi32_to_ksi(struct _ksiginfo * si->_code = si32->_code; si->_errno = si32->_errno; + if (si32->_code == SI_NOINFO) + return; + else if (si32->_code <= 0) /* codes described in siginfo(2) */ + goto fill_rt; + switch (si32->_signo) { case SIGILL: case SIGFPE: @@ -240,6 +245,7 @@ CTASSERT(sizeof(si->_reason._ptrace_stat case SIGVTALRM: case SIGPROF: default: /* see sigqueue() and kill1() */ +fill_rt: si->_reason._rt._pid = si32->_reason._rt._pid; si->_reason._rt._uid = si32->_reason._rt._uid; si->_reason._rt._value.sival_int = @@ -278,6 +284,11 @@ netbsd32_ksi_to_ksi32(struct __ksiginfo3 si32->_code = si->_code; si32->_errno = si->_errno; + if (si->_code == SI_NOINFO) + return; + else if (si->_code <= 0) /* codes described in siginfo(2) */ + goto fill_rt; + switch (si->_signo) { case SIGILL: case SIGFPE: @@ -323,6 +334,7 @@ CTASSERT(sizeof(si32->_reason._ptrace_st case SIGVTALRM: case SIGPROF: default: /* see sigqueue() and kill1() */ +fill_rt: si32->_reason._rt._pid = si->_reason._rt._pid; si32->_reason._rt._uid = si->_reason._rt._uid; si32->_reason._rt._value.sival_int =
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 10:25:48 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: When converting siginfo, examine si_code at the beginning, as explained in siginfo(2). - If it is SI_NOINFO, there's no additional information. - If it is non-positive, i.e., codes described in siginfo(2), we need to fill in _rt. XXX Description for SA_ASYNCIO in siginfo(2) seems outdated; neither si_fd nor si_band are filled in with that code. XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 10:14:52 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: Provide _ptrace_state for SIGTRAP with TRAP_EXEC, TRAP_CHLD, or TRAP_LWP. Pointed out by kamil. Thanks! XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 10:14:52 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: Provide _ptrace_state for SIGTRAP with TRAP_EXEC, TRAP_CHLD, or TRAP_LWP. Pointed out by kamil. Thanks! XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_signal.c diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.47 src/sys/compat/netbsd32/netbsd32_signal.c:1.48 --- src/sys/compat/netbsd32/netbsd32_signal.c:1.47 Mon Nov 18 04:58:42 2019 +++ src/sys/compat/netbsd32/netbsd32_signal.c Mon Nov 18 10:14:52 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_signal.c,v 1.47 2019/11/18 04:58:42 rin Exp $ */ +/* $NetBSD: netbsd32_signal.c,v 1.48 2019/11/18 10:14:52 rin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.47 2019/11/18 04:58:42 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.48 2019/11/18 10:14:52 rin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -206,17 +206,35 @@ fill_fault: si->_reason._fault._trap = si32->_reason._fault._trap; break; case SIGTRAP: - if (si32->_code != TRAP_SCE && si32->_code != TRAP_SCX) + switch (si32->_code) { + case TRAP_EXEC: + case TRAP_CHLD: + case TRAP_LWP: + si->_reason._ptrace_state._pe_report_event = + si32->_reason._ptrace_state._pe_report_event; +CTASSERT(sizeof(si->_reason._ptrace_state._option._pe_other_pid) == +sizeof(si->_reason._ptrace_state._option._pe_lwp)); + si->_reason._ptrace_state._option._pe_other_pid = + si32->_reason._ptrace_state._option._pe_other_pid; + break; + case TRAP_SCE: + case TRAP_SCX: + si->_reason._syscall._sysnum = + si32->_reason._syscall._sysnum; + si->_reason._syscall._retval[0] = + si32->_reason._syscall._retval[0]; + si->_reason._syscall._retval[1] = + si32->_reason._syscall._retval[1]; + si->_reason._syscall._error = + si32->_reason._syscall._error; + for (i = 0; + i < __arraycount(si->_reason._syscall._args); i++) +si->_reason._syscall._args[i] = +si32->_reason._syscall._args[i]; + break; + default: goto fill_fault; - si->_reason._syscall._sysnum = si32->_reason._syscall._sysnum; - si->_reason._syscall._retval[0] = - si32->_reason._syscall._retval[0]; - si->_reason._syscall._retval[1] = - si32->_reason._syscall._retval[1]; - si->_reason._syscall._error = si32->_reason._syscall._error; - for (i = 0; i < __arraycount(si->_reason._syscall._args); i++) - si->_reason._syscall._args[i] = - si32->_reason._syscall._args[i]; + } break; case SIGALRM: case SIGVTALRM: @@ -271,17 +289,35 @@ fill_fault: si32->_reason._fault._trap = si->_reason._fault._trap; break; case SIGTRAP: - if (si->_code != TRAP_SCE && si->_code != TRAP_SCX) + switch (si->_code) { + case TRAP_EXEC: + case TRAP_CHLD: + case TRAP_LWP: + si32->_reason._ptrace_state._pe_report_event = + si->_reason._ptrace_state._pe_report_event; +CTASSERT(sizeof(si32->_reason._ptrace_state._option._pe_other_pid) == +sizeof(si32->_reason._ptrace_state._option._pe_lwp)); + si32->_reason._ptrace_state._option._pe_other_pid = + si->_reason._ptrace_state._option._pe_other_pid; + break; + case TRAP_SCE: + case TRAP_SCX: + si32->_reason._syscall._sysnum = + si->_reason._syscall._sysnum; + si32->_reason._syscall._retval[0] = + si->_reason._syscall._retval[0]; + si32->_reason._syscall._retval[1] = + si->_reason._syscall._retval[1]; + si32->_reason._syscall._error = + si->_reason._syscall._error; + for (i = 0; + i < __arraycount(si->_reason._syscall._args); i++) +si32->_reason._syscall._args[i] = +si->_reason._syscall._args[i]; + break; + default: goto fill_fault; - si32->_reason._syscall._sysnum = si->_reason._syscall._sysnum; - si32->_reason._syscall._retval[0] = - si->_reason._syscall._retval[0]; - si32->_reason._syscall._retval[1] = - si->_reason._syscall._retval[1]; - si32->_reason._syscall._error = si->_reason._syscall._error; - for (i = 0; i < __arraycount(si32->_reason._syscall._args); i++) - si32->_reason._syscall._args[i] = - si->_reason._syscall._args[i]; + } break; case SIGALRM: case SIGVTALRM:
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 04:58:42 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: Sort by signal numbers as far as possible, adjust locations of functions. No functional changes intended. XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 04:58:42 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_signal.c Log Message: Sort by signal numbers as far as possible, adjust locations of functions. No functional changes intended. XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_signal.c diff -u src/sys/compat/netbsd32/netbsd32_signal.c:1.46 src/sys/compat/netbsd32/netbsd32_signal.c:1.47 --- src/sys/compat/netbsd32/netbsd32_signal.c:1.46 Mon Nov 18 04:09:53 2019 +++ src/sys/compat/netbsd32/netbsd32_signal.c Mon Nov 18 04:58:42 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_signal.c,v 1.46 2019/11/18 04:09:53 rin Exp $ */ +/* $NetBSD: netbsd32_signal.c,v 1.47 2019/11/18 04:58:42 rin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.46 2019/11/18 04:09:53 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_signal.c,v 1.47 2019/11/18 04:58:42 rin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ktrace.h" @@ -197,9 +197,9 @@ netbsd32_ksi32_to_ksi(struct _ksiginfo * switch (si32->_signo) { case SIGILL: + case SIGFPE: case SIGBUS: case SIGSEGV: - case SIGFPE: fill_fault: si->_reason._fault._addr = NETBSD32IPTR64(si32->_reason._fault._addr); @@ -227,6 +227,11 @@ fill_fault: si->_reason._rt._value.sival_int = si32->_reason._rt._value.sival_int; break; + case SIGURG: + case SIGIO: + si->_reason._poll._band = si32->_reason._poll._band; + si->_reason._poll._fd = si32->_reason._poll._fd; + break; case SIGCHLD: si->_reason._child._pid = si32->_reason._child._pid; si->_reason._child._uid = si32->_reason._child._uid; @@ -234,14 +239,17 @@ fill_fault: si->_reason._child._utime = si32->_reason._child._utime; si->_reason._child._stime = si32->_reason._child._stime; break; - case SIGURG: - case SIGIO: - si->_reason._poll._band = si32->_reason._poll._band; - si->_reason._poll._fd = si32->_reason._poll._fd; - break; } } +void +netbsd32_si32_to_si(siginfo_t *si, const siginfo32_t *si32) +{ + + memset(si, 0, sizeof (*si)); + netbsd32_ksi32_to_ksi(&si->_info, &si32->_info); +} + static void netbsd32_ksi_to_ksi32(struct __ksiginfo32 *si32, const struct _ksiginfo *si) { @@ -254,9 +262,9 @@ netbsd32_ksi_to_ksi32(struct __ksiginfo3 switch (si->_signo) { case SIGILL: + case SIGFPE: case SIGBUS: case SIGSEGV: - case SIGFPE: fill_fault: si32->_reason._fault._addr = NETBSD32PTR32I(si->_reason._fault._addr); @@ -284,6 +292,11 @@ fill_fault: si32->_reason._rt._value.sival_int = si->_reason._rt._value.sival_int; break; + case SIGURG: + case SIGIO: + si32->_reason._poll._band = si->_reason._poll._band; + si32->_reason._poll._fd = si->_reason._poll._fd; + break; case SIGCHLD: si32->_reason._child._pid = si->_reason._child._pid; si32->_reason._child._uid = si->_reason._child._uid; @@ -291,11 +304,6 @@ fill_fault: si32->_reason._child._utime = si->_reason._child._utime; si32->_reason._child._stime = si->_reason._child._stime; break; - case SIGURG: - case SIGIO: - si32->_reason._poll._band = si->_reason._poll._band; - si32->_reason._poll._fd = si->_reason._poll._fd; - break; } } @@ -308,14 +316,6 @@ netbsd32_si_to_si32(siginfo32_t *si32, c } void -netbsd32_si32_to_si(siginfo_t *si, const siginfo32_t *si32) -{ - - memset(si, 0, sizeof (*si)); - netbsd32_ksi32_to_ksi(&si->_info, &si32->_info); -} - -void getucontext32(struct lwp *l, ucontext32_t *ucp) { struct proc *p = l->l_proc;
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 04:17:08 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_conv.h netbsd32_ioctl.c netbsd32_ioctl.h Log Message: Sorry, revert unintentional parts of the previous commit: http://mail-index.netbsd.org/source-changes/2019/11/18/msg110946.html I was going to commit only netbsd32_signal.c. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.130 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.41 -r1.42 src/sys/compat/netbsd32/netbsd32_conv.h cvs rdiff -u -r1.105 -r1.106 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.69 -r1.70 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.129 src/sys/compat/netbsd32/netbsd32.h:1.130 --- src/sys/compat/netbsd32/netbsd32.h:1.129 Mon Nov 18 04:09:53 2019 +++ src/sys/compat/netbsd32/netbsd32.h Mon Nov 18 04:17:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.129 2019/11/18 04:09:53 rin Exp $ */ +/* $NetBSD: netbsd32.h,v 1.130 2019/11/18 04:17:08 rin Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green @@ -37,7 +37,6 @@ */ #include /* precautionary upon removal from ucred.h */ -#include #include #include #include @@ -73,11 +72,7 @@ typedef int32_t netbsd32_key_t; typedef int32_t netbsd32_intptr_t; typedef uint32_t netbsd32_uintptr_t; -/* - * netbsd32_[u]int64 are machine dependent and defined in : - * 64 bit integers only have 4-byte alignment on some 32 bit ports, - * but always have 8-byte alignment on 64 bit systems. - */ +/* netbsd32_[u]int64 are machine dependent and defined below */ /* * machine dependant section; must define: @@ -159,6 +154,15 @@ netbsd32_ptr32_incr(netbsd32_pointer_t * #undef NETBSD32_POINTER_TYPE /* + * 64 bit integers only have 4-byte alignment on some 32 bit ports, + * but always have 8-byte alignment on 64 bit systems. + * NETBSD32_INT64_ALIGN may be __attribute__((__aligned__(4))) + */ +typedef int64_t netbsd32_int64 NETBSD32_INT64_ALIGN; +typedef uint64_t netbsd32_uint64 NETBSD32_INT64_ALIGN; +#undef NETBSD32_INT64_ALIGN + +/* * all pointers are netbsd32_pointer_t (defined in ) */ @@ -208,13 +212,14 @@ struct netbsd32_iovec { /* from */ typedef int32_t netbsd32_timer_t; +typedef int32_t netbsd32_time50_t; typedef netbsd32_int64 netbsd32_time_t; typedef netbsd32_pointer_t netbsd32_timerp_t; typedef netbsd32_pointer_t netbsd32_clockidp_t; typedef netbsd32_pointer_t netbsd32_timespec50p_t; struct netbsd32_timespec50 { - int32_t tv_sec; /* seconds */ + netbsd32_time50_t tv_sec; /* seconds */ netbsd32_long tv_nsec; /* and nanoseconds */ }; @@ -226,7 +231,7 @@ struct netbsd32_timespec { typedef netbsd32_pointer_t netbsd32_timeval50p_t; struct netbsd32_timeval50 { - netbsd32_long tv_sec; /* seconds */ + netbsd32_time50_t tv_sec; /* seconds */ netbsd32_long tv_usec; /* and microseconds */ }; Index: src/sys/compat/netbsd32/netbsd32_conv.h diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.41 src/sys/compat/netbsd32/netbsd32_conv.h:1.42 --- src/sys/compat/netbsd32/netbsd32_conv.h:1.41 Mon Nov 18 04:09:53 2019 +++ src/sys/compat/netbsd32/netbsd32_conv.h Mon Nov 18 04:17:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_conv.h,v 1.41 2019/11/18 04:09:53 rin Exp $ */ +/* $NetBSD: netbsd32_conv.h,v 1.42 2019/11/18 04:17:08 rin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -58,7 +58,7 @@ netbsd32_from_timeval50(const struct tim struct netbsd32_timeval50 *tv32) { - tv32->tv_sec = (netbsd32_long)tv->tv_sec; + tv32->tv_sec = (netbsd32_time50_t)tv->tv_sec; tv32->tv_usec = (netbsd32_long)tv->tv_usec; } @@ -152,7 +152,7 @@ netbsd32_from_timespec50(const struct ti struct netbsd32_timespec50 *s32p) { - s32p->tv_sec = (int32_t)p->tv_sec; + s32p->tv_sec = (netbsd32_time50_t)p->tv_sec; s32p->tv_nsec = (netbsd32_long)p->tv_nsec; } Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.105 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.106 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.105 Mon Nov 18 04:09:53 2019 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Mon Nov 18 04:17:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.105 2019/11/18 04:09:53 rin Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.106 2019/11/18 04:17:08 rin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.105 2019/11/18 04:09:53 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.106 2019/11/18 04:17:08 rin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -1066,30 +1066,6 @@ netbsd32_do_clockctl_ntp_adjtime(struct } #endif -#ifdef COMPAT_50 -static void -netbsd32_ioctl_to_time
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 04:17:08 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_conv.h netbsd32_ioctl.c netbsd32_ioctl.h Log Message: Sorry, revert unintentional parts of the previous commit: http://mail-index.netbsd.org/source-changes/2019/11/18/msg110946.html I was going to commit only netbsd32_signal.c. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.130 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.41 -r1.42 src/sys/compat/netbsd32/netbsd32_conv.h cvs rdiff -u -r1.105 -r1.106 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.69 -r1.70 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 04:09:53 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_conv.h netbsd32_ioctl.c netbsd32_ioctl.h netbsd32_signal.c Log Message: Belatedly catch up with kern_sig.c rev 1.358: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_sig.c#rev1.358 Provide syscall information with SIGTRAP TRAP_SCE/TRAP_SCX so that picotrace/truss, for example, works fine on COMPAT_NETBSD32. With some minor changes: - Centralize netbsd32_si{,32}_si{32,}() into netbsd32_ksi{,32}_ksi{32,}(). - Provide si_status with SIGCHLD. - Remove the remaining of SA. XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_conv.h cvs rdiff -u -r1.104 -r1.105 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.68 -r1.69 src/sys/compat/netbsd32/netbsd32_ioctl.h cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 18 04:09:53 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32.h netbsd32_conv.h netbsd32_ioctl.c netbsd32_ioctl.h netbsd32_signal.c Log Message: Belatedly catch up with kern_sig.c rev 1.358: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_sig.c#rev1.358 Provide syscall information with SIGTRAP TRAP_SCE/TRAP_SCX so that picotrace/truss, for example, works fine on COMPAT_NETBSD32. With some minor changes: - Centralize netbsd32_si{,32}_si{32,}() into netbsd32_ksi{,32}_ksi{32,}(). - Provide si_status with SIGCHLD. - Remove the remaining of SA. XXX pullup to netbsd-9 To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_conv.h cvs rdiff -u -r1.104 -r1.105 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.68 -r1.69 src/sys/compat/netbsd32/netbsd32_ioctl.h cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/netbsd32_signal.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.128 src/sys/compat/netbsd32/netbsd32.h:1.129 --- src/sys/compat/netbsd32/netbsd32.h:1.128 Thu Nov 7 15:21:55 2019 +++ src/sys/compat/netbsd32/netbsd32.h Mon Nov 18 04:09:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.128 2019/11/07 15:21:55 rin Exp $ */ +/* $NetBSD: netbsd32.h,v 1.129 2019/11/18 04:09:53 rin Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green @@ -37,6 +37,7 @@ */ #include /* precautionary upon removal from ucred.h */ +#include #include #include #include @@ -72,7 +73,11 @@ typedef int32_t netbsd32_key_t; typedef int32_t netbsd32_intptr_t; typedef uint32_t netbsd32_uintptr_t; -/* netbsd32_[u]int64 are machine dependent and defined below */ +/* + * netbsd32_[u]int64 are machine dependent and defined in : + * 64 bit integers only have 4-byte alignment on some 32 bit ports, + * but always have 8-byte alignment on 64 bit systems. + */ /* * machine dependant section; must define: @@ -154,15 +159,6 @@ netbsd32_ptr32_incr(netbsd32_pointer_t * #undef NETBSD32_POINTER_TYPE /* - * 64 bit integers only have 4-byte alignment on some 32 bit ports, - * but always have 8-byte alignment on 64 bit systems. - * NETBSD32_INT64_ALIGN may be __attribute__((__aligned__(4))) - */ -typedef int64_t netbsd32_int64 NETBSD32_INT64_ALIGN; -typedef uint64_t netbsd32_uint64 NETBSD32_INT64_ALIGN; -#undef NETBSD32_INT64_ALIGN - -/* * all pointers are netbsd32_pointer_t (defined in ) */ @@ -212,14 +208,13 @@ struct netbsd32_iovec { /* from */ typedef int32_t netbsd32_timer_t; -typedef int32_t netbsd32_time50_t; typedef netbsd32_int64 netbsd32_time_t; typedef netbsd32_pointer_t netbsd32_timerp_t; typedef netbsd32_pointer_t netbsd32_clockidp_t; typedef netbsd32_pointer_t netbsd32_timespec50p_t; struct netbsd32_timespec50 { - netbsd32_time50_t tv_sec; /* seconds */ + int32_t tv_sec; /* seconds */ netbsd32_long tv_nsec; /* and nanoseconds */ }; @@ -231,7 +226,7 @@ struct netbsd32_timespec { typedef netbsd32_pointer_t netbsd32_timeval50p_t; struct netbsd32_timeval50 { - netbsd32_time50_t tv_sec; /* seconds */ + netbsd32_long tv_sec; /* seconds */ netbsd32_long tv_usec; /* and microseconds */ }; Index: src/sys/compat/netbsd32/netbsd32_conv.h diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.40 src/sys/compat/netbsd32/netbsd32_conv.h:1.41 --- src/sys/compat/netbsd32/netbsd32_conv.h:1.40 Thu Oct 3 22:16:53 2019 +++ src/sys/compat/netbsd32/netbsd32_conv.h Mon Nov 18 04:09:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_conv.h,v 1.40 2019/10/03 22:16:53 kamil Exp $ */ +/* $NetBSD: netbsd32_conv.h,v 1.41 2019/11/18 04:09:53 rin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -58,7 +58,7 @@ netbsd32_from_timeval50(const struct tim struct netbsd32_timeval50 *tv32) { - tv32->tv_sec = (netbsd32_time50_t)tv->tv_sec; + tv32->tv_sec = (netbsd32_long)tv->tv_sec; tv32->tv_usec = (netbsd32_long)tv->tv_usec; } @@ -152,7 +152,7 @@ netbsd32_from_timespec50(const struct ti struct netbsd32_timespec50 *s32p) { - s32p->tv_sec = (netbsd32_time50_t)p->tv_sec; + s32p->tv_sec = (int32_t)p->tv_sec; s32p->tv_nsec = (netbsd32_long)p->tv_nsec; } Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.105 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.104 Tue Aug 20 09:32:21 2019 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Mon Nov 18 04:09:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_ioctl.c,v 1.104 2019/08/20 09:32:21 christos Exp $ */ +/* $NetBSD: netbsd32_ioctl.c,v 1.105 2019/11/18 04:09:53 rin Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -31,7 +31,7 @@ */ #include -_
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Thu Nov 7 15:21:56 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32.h Log Message: For netbsd32_statvfs, f_spare should be netbsd32_uint64, not uint64_t. Fix syscalls using struct statvfs on COMPAT_NETBSD32 on amd64, where NETBSD32_INT64_ALIGN is __attribute__((__aligned__(4))). To generate a diff of this commit: cvs rdiff -u -r1.127 -r1.128 src/sys/compat/netbsd32/netbsd32.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Thu Nov 7 15:21:56 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32.h Log Message: For netbsd32_statvfs, f_spare should be netbsd32_uint64, not uint64_t. Fix syscalls using struct statvfs on COMPAT_NETBSD32 on amd64, where NETBSD32_INT64_ALIGN is __attribute__((__aligned__(4))). To generate a diff of this commit: cvs rdiff -u -r1.127 -r1.128 src/sys/compat/netbsd32/netbsd32.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.127 src/sys/compat/netbsd32/netbsd32.h:1.128 --- src/sys/compat/netbsd32/netbsd32.h:1.127 Thu Oct 3 22:16:53 2019 +++ src/sys/compat/netbsd32/netbsd32.h Thu Nov 7 15:21:55 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.127 2019/10/03 22:16:53 kamil Exp $ */ +/* $NetBSD: netbsd32.h,v 1.128 2019/11/07 15:21:55 rin Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green @@ -902,7 +902,7 @@ struct netbsd32_statvfs { netbsd32_u_long f_fsid; /* Posix compatible fsid */ netbsd32_u_long f_namemax; /* maximum filename length */ uid_t f_owner; /* user that mounted the file system */ - uint64_t f_spare[4]; /* spare space */ + netbsd32_uint64 f_spare[4]; /* spare space */ char f_fstypename[_VFS_NAMELEN]; /* fs type name */ char f_mntonname[_VFS_MNAMELEN]; /* directory on which mounted */ char f_mntfromname[_VFS_MNAMELEN]; /* mounted file system */
Re: CVS commit: src/sys/compat/netbsd32
On 2019/11/04 20:20, Rin Okuyama wrote: Module Name:src Committed By: rin Date: Mon Nov 4 11:20:22 UTC 2019 Modified Files: src/sys/compat/netbsd32: syscalls.master Log Message: For netbsd32_readlinkat(2), bufsize is netbsd_size_t, not size_t. Since bufsize is the last argument, this affects only LP64EB. XXX pullup to netbsd-9, -8, and -7 To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. s/netbsd_size_t/netbsd32_size_t/ in the commit log.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 4 11:33:01 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.144 -r1.145 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.24 -r1.25 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.35 -r1.36 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 4 11:33:01 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.145 -r1.146 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.144 -r1.145 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.24 -r1.25 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.35 -r1.36 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.145 src/sys/compat/netbsd32/netbsd32_syscall.h:1.146 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.145 Mon Nov 4 11:21:36 2019 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Mon Nov 4 11:33:01 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.145 2019/11/04 11:21:36 rin Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.146 2019/11/04 11:33:01 rin Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp + * created from NetBSD: syscalls.master,v 1.130 2019/11/04 11:32:22 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -1274,7 +1274,7 @@ /* syscall: "netbsd32_clock_getcpuclockid2" ret: "int" args: "idtype_t" "id_t" "netbsd32_clockidp_t" */ #define NETBSD32_SYS_netbsd32_clock_getcpuclockid2 482 -/* syscall: "netbsd32___getvfsstat90" ret: "int" args: "netbsd32_statvfsp_t" "size_t" "int" */ +/* syscall: "netbsd32___getvfsstat90" ret: "int" args: "netbsd32_statvfsp_t" "netbsd32_size_t" "int" */ #define NETBSD32_SYS_netbsd32___getvfsstat90 483 /* syscall: "netbsd32___statvfs190" ret: "int" args: "netbsd32_charp" "netbsd32_statvfsp_t" "int" */ @@ -1283,7 +1283,7 @@ /* syscall: "netbsd32___fstatvfs190" ret: "int" args: "int" "netbsd32_statvfsp_t" "int" */ #define NETBSD32_SYS_netbsd32___fstatvfs190 485 -/* syscall: "netbsd32___fhstatvfs190" ret: "int" args: "netbsd32_voidp" "size_t" "netbsd32_statvfsp_t" "int" */ +/* syscall: "netbsd32___fhstatvfs190" ret: "int" args: "netbsd32_voidp" "netbsd32_size_t" "netbsd32_statvfsp_t" "int" */ #define NETBSD32_SYS_netbsd32___fhstatvfs190 486 #define NETBSD32_SYS_MAXSYSCALL 487 Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.144 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.145 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.144 Mon Nov 4 11:21:36 2019 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Mon Nov 4 11:33:01 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.144 2019/11/04 11:21:36 rin Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.145 2019/11/04 11:33:01 rin Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp + * created from NetBSD: syscalls.master,v 1.130 2019/11/04 11:32:22 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -2624,7 +2624,7 @@ check_syscall_args(netbsd32_clock_getcpu struct netbsd32___getvfsstat90_args { syscallarg(netbsd32_statvfsp_t) buf; - syscallarg(size_t) bufsize; + syscallarg(netbsd32_size_t) bufsize; syscallarg(int) flags; }; check_syscall_args(netbsd32___getvfsstat90) @@ -2645,7 +2645,7 @@ check_syscall_args(netbsd32___fstatvfs19 struct netbsd32___fhstatvfs190_args { syscallarg(netbsd32_voidp) fhp; - syscallarg(size_t) fh_size; + syscallarg(netbsd32_size_t) fh_size; syscallarg(netbsd32_statvfsp_t) buf; syscallarg(int) flags; }; Index: src/sys/compat/netbsd32/netbsd32_syscalls.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.144 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.145 --- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.144 Mon Nov 4 11:21:36 2019 +++ src/sys/compat/netbsd32/netbsd32_syscalls.c Mon Nov 4 11:33:01 2019 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.144 2019/11/04 11:21:36 rin Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.145 2019/11/04 11:33:01 rin Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp + * created from NetBSD: syscalls.master,v 1.130 2019/11/04 11:32:22 rin Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.144 2019/11/04 11:21:36 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.145 2019/11/04 11:33:01 rin Exp $"); #if defined(_KERNEL_OPT)
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 4 11:32:23 UTC 2019 Modified Files: src/sys/compat/netbsd32: syscalls.master Log Message: netbsd32_size_t should be used instead of size_t for argument of 32-bit syscalls: - netbsd32___getvfsstat90: bufsize - netbsd32___fhstatvfs190: fh_size No need to pullup, since these syscalls were introduced after branch of netbsd-9. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.130 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/syscalls.master diff -u src/sys/compat/netbsd32/syscalls.master:1.129 src/sys/compat/netbsd32/syscalls.master:1.130 --- src/sys/compat/netbsd32/syscalls.master:1.129 Mon Nov 4 11:20:22 2019 +++ src/sys/compat/netbsd32/syscalls.master Mon Nov 4 11:32:22 2019 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp $ + $NetBSD: syscalls.master,v 1.130 2019/11/04 11:32:22 rin Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -1169,11 +1169,11 @@ id_t id, netbsd32_clockidp_t clock_id); } 483 STD { int|netbsd32|90|getvfsstat( \ netbsd32_statvfsp_t buf, \ - size_t bufsize, int flags); } + netbsd32_size_t bufsize, int flags); } 484 STD { int|netbsd32|90|statvfs1(netbsd32_charp path, \ netbsd32_statvfsp_t buf, int flags); } 485 STD { int|netbsd32|90|fstatvfs1(int fd, \ netbsd32_statvfsp_t buf, int flags); } 486 STD { int|netbsd32|90|fhstatvfs1(netbsd32_voidp fhp, \ - size_t fh_size, netbsd32_statvfsp_t buf, \ + netbsd32_size_t fh_size, netbsd32_statvfsp_t buf, \ int flags); }
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 4 11:32:23 UTC 2019 Modified Files: src/sys/compat/netbsd32: syscalls.master Log Message: netbsd32_size_t should be used instead of size_t for argument of 32-bit syscalls: - netbsd32___getvfsstat90: bufsize - netbsd32___fhstatvfs190: fh_size No need to pullup, since these syscalls were introduced after branch of netbsd-9. To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.130 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 4 11:21:36 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.144 -r1.145 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.23 -r1.24 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.34 -r1.35 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.144 src/sys/compat/netbsd32/netbsd32_syscall.h:1.145 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.144 Sun Oct 13 22:31:31 2019 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Mon Nov 4 11:21:36 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.144 2019/10/13 22:31:31 christos Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.145 2019/11/04 11:21:36 rin Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.128 2019/09/22 22:59:38 christos Exp + * created from NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -1228,7 +1228,7 @@ /* syscall: "netbsd32_openat" ret: "int" args: "int" "const netbsd32_charp" "int" "..." */ #define NETBSD32_SYS_netbsd32_openat 468 -/* syscall: "netbsd32_readlinkat" ret: "netbsd32_ssize_t" args: "int" "const netbsd32_charp" "netbsd32_charp" "size_t" */ +/* syscall: "netbsd32_readlinkat" ret: "netbsd32_ssize_t" args: "int" "const netbsd32_charp" "netbsd32_charp" "netbsd32_size_t" */ #define NETBSD32_SYS_netbsd32_readlinkat 469 /* syscall: "netbsd32_symlinkat" ret: "int" args: "const netbsd32_charp" "int" "const netbsd32_charp" */ Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.143 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.144 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.143 Sun Oct 13 22:31:31 2019 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Mon Nov 4 11:21:36 2019 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.143 2019/10/13 22:31:31 christos Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.144 2019/11/04 11:21:36 rin Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.128 2019/09/22 22:59:38 christos Exp + * created from NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -2511,7 +2511,7 @@ struct netbsd32_readlinkat_args { syscallarg(int) fd; syscallarg(const netbsd32_charp) path; syscallarg(netbsd32_charp) buf; - syscallarg(size_t) bufsize; + syscallarg(netbsd32_size_t) bufsize; }; check_syscall_args(netbsd32_readlinkat) Index: src/sys/compat/netbsd32/netbsd32_syscalls.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.143 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.144 --- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.143 Sun Oct 13 22:31:32 2019 +++ src/sys/compat/netbsd32/netbsd32_syscalls.c Mon Nov 4 11:21:36 2019 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.143 2019/10/13 22:31:32 christos Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.144 2019/11/04 11:21:36 rin Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.128 2019/09/22 22:59:38 christos Exp + * created from NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.143 2019/10/13 22:31:32 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.144 2019/11/04 11:21:36 rin Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) Index: src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.23 src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.24 --- src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.23 Sun Oct 13 22:31:32 2019 +++ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c Mon Nov 4 11:21:36 2019 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.23 2019/10/13 22:31:32 christos Exp $ */ +/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.24 2019/11/04 11:21:36 rin Exp $ */ /* * System call autoload table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.128 2019/
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 4 11:21:36 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.144 -r1.145 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.23 -r1.24 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.34 -r1.35 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 4 11:20:22 UTC 2019 Modified Files: src/sys/compat/netbsd32: syscalls.master Log Message: For netbsd32_readlinkat(2), bufsize is netbsd_size_t, not size_t. Since bufsize is the last argument, this affects only LP64EB. XXX pullup to netbsd-9, -8, and -7 To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: rin Date: Mon Nov 4 11:20:22 UTC 2019 Modified Files: src/sys/compat/netbsd32: syscalls.master Log Message: For netbsd32_readlinkat(2), bufsize is netbsd_size_t, not size_t. Since bufsize is the last argument, this affects only LP64EB. XXX pullup to netbsd-9, -8, and -7 To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/syscalls.master diff -u src/sys/compat/netbsd32/syscalls.master:1.128 src/sys/compat/netbsd32/syscalls.master:1.129 --- src/sys/compat/netbsd32/syscalls.master:1.128 Sun Sep 22 22:59:38 2019 +++ src/sys/compat/netbsd32/syscalls.master Mon Nov 4 11:20:22 2019 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.128 2019/09/22 22:59:38 christos Exp $ + $NetBSD: syscalls.master,v 1.129 2019/11/04 11:20:22 rin Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -1120,7 +1120,7 @@ 469 STD { netbsd32_ssize_t|netbsd32||readlinkat(int fd, \ const netbsd32_charp path, \ netbsd32_charp buf, \ - size_t bufsize); } + netbsd32_size_t bufsize); } 470 STD { int|netbsd32||symlinkat(const netbsd32_charp path1, \ int fd, \ const netbsd32_charp path2); }
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Sun Oct 13 22:31:32 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.22 -r1.23 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.141 -r1.142 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.33 -r1.34 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Sun Oct 13 22:31:32 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c netbsd32_systrace_args.c Log Message: regen To generate a diff of this commit: cvs rdiff -u -r1.143 -r1.144 src/sys/compat/netbsd32/netbsd32_syscall.h cvs rdiff -u -r1.142 -r1.143 src/sys/compat/netbsd32/netbsd32_syscallargs.h \ src/sys/compat/netbsd32/netbsd32_syscalls.c cvs rdiff -u -r1.22 -r1.23 \ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c cvs rdiff -u -r1.141 -r1.142 src/sys/compat/netbsd32/netbsd32_sysent.c cvs rdiff -u -r1.33 -r1.34 src/sys/compat/netbsd32/netbsd32_systrace_args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.143 src/sys/compat/netbsd32/netbsd32_syscall.h:1.144 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.143 Sun Sep 22 19:03:20 2019 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Sun Oct 13 18:31:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.143 2019/09/22 23:03:20 christos Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.144 2019/10/13 22:31:31 christos Exp $ */ /* * System call numbers. Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.142 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.143 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.142 Sun Sep 22 19:03:20 2019 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Sun Oct 13 18:31:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.142 2019/09/22 23:03:20 christos Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.143 2019/10/13 22:31:31 christos Exp $ */ /* * System call argument lists. Index: src/sys/compat/netbsd32/netbsd32_syscalls.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.142 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.143 --- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.142 Sun Sep 22 19:03:20 2019 +++ src/sys/compat/netbsd32/netbsd32_syscalls.c Sun Oct 13 18:31:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.142 2019/09/22 23:03:20 christos Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.143 2019/10/13 22:31:32 christos Exp $ */ /* * System call names. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.142 2019/09/22 23:03:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.143 2019/10/13 22:31:32 christos Exp $"); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) Index: src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.22 src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.23 --- src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c:1.22 Sun Sep 22 19:03:20 2019 +++ src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c Sun Oct 13 18:31:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.22 2019/09/22 23:03:20 christos Exp $ */ +/* $NetBSD: netbsd32_syscalls_autoload.c,v 1.23 2019/10/13 22:31:32 christos Exp $ */ /* * System call autoload table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls_autoload.c,v 1.22 2019/09/22 23:03:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls_autoload.c,v 1.23 2019/10/13 22:31:32 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" Index: src/sys/compat/netbsd32/netbsd32_sysent.c diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.141 src/sys/compat/netbsd32/netbsd32_sysent.c:1.142 --- src/sys/compat/netbsd32/netbsd32_sysent.c:1.141 Sun Sep 22 19:03:20 2019 +++ src/sys/compat/netbsd32/netbsd32_sysent.c Sun Oct 13 18:31:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_sysent.c,v 1.141 2019/09/22 23:03:20 christos Exp $ */ +/* $NetBSD: netbsd32_sysent.c,v 1.142 2019/10/13 22:31:32 christos Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.141 2019/09/22 23:03:20 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysent.c,v 1.142 2019/10/13 22:31:32 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -1635,7 +1635,7 @@ struct sysent netbsd32_sysent[] = { .sy_call = (sy_call_t *)netbsd32___getdents30 }, /* 390 = netbsd32___getdents30 */ { - .sy_call = (sy_call_t *)nullop, + .sy_call = (sy_call_t *)(void *)nullop, }, /* 391 = filler */ { ns(struct compat_30_netbsd32___fhstat30_args), Index: src/sys/compat/netbsd32/netbsd32_systrace_args.c diff -u src/sys/compat/netbsd32/netbsd32_systrace_args.c:1.33 src/sys/compat/netbsd32/netbsd32_systrace_args.c:1.34 --- src/sys/compat/netbsd32/netbsd32_systrace_args.c:1.33 Sun Sep 22 19:03:20 2019 +++
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: kamil Date: Sat Oct 5 14:19:53 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c Log Message: Validate input before converting timeval::tv_usec in compat/netbsd32 To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_time.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: kamil Date: Sat Oct 5 14:19:53 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_time.c Log Message: Validate input before converting timeval::tv_usec in compat/netbsd32 To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/sys/compat/netbsd32/netbsd32_compat_50.c cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_time.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_compat_50.c diff -u src/sys/compat/netbsd32/netbsd32_compat_50.c:1.40 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.41 --- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.40 Fri Sep 20 15:09:07 2019 +++ src/sys/compat/netbsd32/netbsd32_compat_50.c Sat Oct 5 14:19:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 kamil Exp $ */ +/* $NetBSD: netbsd32_compat_50.c,v 1.41 2019/10/05 14:19:53 kamil Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.41 2019/10/05 14:19:53 kamil Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -216,6 +216,10 @@ compat_50_netbsd32_settimeofday(struct l return error; netbsd32_to_timeval50(&atv32, &atv); + + if (atv.tv_usec < 0 || atv.tv_usec >= 100) + return EINVAL; + TIMEVAL_TO_TIMESPEC(&atv, &ats); return settime(p, &ats); } Index: src/sys/compat/netbsd32/netbsd32_time.c diff -u src/sys/compat/netbsd32/netbsd32_time.c:1.52 src/sys/compat/netbsd32/netbsd32_time.c:1.53 --- src/sys/compat/netbsd32/netbsd32_time.c:1.52 Thu Sep 26 01:30:00 2019 +++ src/sys/compat/netbsd32/netbsd32_time.c Sat Oct 5 14:19:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $ */ +/* $NetBSD: netbsd32_time.c,v 1.53 2019/10/05 14:19:53 kamil Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.53 2019/10/05 14:19:53 kamil Exp $"); #if defined(_KERNEL_OPT) #include "opt_ntp.h" @@ -243,6 +243,10 @@ netbsd32___settimeofday50(struct lwp *l, return error; netbsd32_to_timeval(&atv32, &atv); + + if (atv.tv_usec < 0 || atv.tv_usec >= 100) + return EINVAL; + TIMEVAL_TO_TIMESPEC(&atv, &ats); return settime(p, &ats); } @@ -546,4 +550,3 @@ netbsd32_clock_getcpuclockid2(struct lwp } return copyout(&clock_id, SCARG_P32(uap, clock_id), sizeof(clock_id)); } -
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Sat Sep 28 15:15:34 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_drm.c Log Message: fix sign-compare. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_drm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_drm.c diff -u src/sys/compat/netbsd32/netbsd32_drm.c:1.3 src/sys/compat/netbsd32/netbsd32_drm.c:1.4 --- src/sys/compat/netbsd32/netbsd32_drm.c:1.3 Tue Aug 20 10:26:05 2019 +++ src/sys/compat/netbsd32/netbsd32_drm.c Sat Sep 28 11:15:34 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $ */ +/* $NetBSD: netbsd32_drm.c,v 1.4 2019/09/28 15:15:34 christos Exp $ */ /* * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.4 2019/09/28 15:15:34 christos Exp $"); #include #include @@ -345,7 +345,7 @@ compat_drm_getstats(struct file *file, v if (error) return error; - for (int i = 0; i < st64.count; ++i) { + for (size_t i = 0; i < st64.count; ++i) { st32.data[i].value = st64.data[i].value; st32.data[i].type = st64.data[i].type; }
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: christos Date: Sat Sep 28 15:15:34 UTC 2019 Modified Files: src/sys/compat/netbsd32: netbsd32_drm.c Log Message: fix sign-compare. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_drm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.