CVS commit: src/sys/compat/netbsd32

2022-04-23 Thread Reinoud Zandijk
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

2022-04-23 Thread Reinoud Zandijk
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 = _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, _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 = _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(_args32.iso_args, udata,
 sizeof(fs_args32.iso_args));
 			

CVS commit: src/sys/compat/netbsd32

2021-12-21 Thread Roy Marples
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(>addr, >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(>addr, >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

2021-12-21 Thread Roy Marples
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

2021-11-11 Thread Martin Husemann
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_path;
+		*pathp32 = NETBSD32PTR64(fae32->fae_data.open.path);
+		return true;
+	case FAE_CHDIR:
+		*pathp = >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 == NULL || pathp32 == NULL)
 			continue;
-		error = copyinstr(NETBSD32PTR64(f32->fae_path), pbuf,
-		MAXPATHLEN, );
+		error = copyinstr(pathp32, pbuf, MAXPATHLEN, );
 		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

2021-11-11 Thread Martin Husemann
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

2021-09-19 Thread Jason R Thorpe
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 */	

CVS commit: src/sys/compat/netbsd32

2021-09-19 Thread Jason R Thorpe
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

2021-09-19 Thread Jason R Thorpe
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, , 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, , 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

2021-09-19 Thread Jason R Thorpe
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

2021-09-19 Thread Jason R Thorpe
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 

CVS commit: src/sys/compat/netbsd32

2021-09-19 Thread Jason R Thorpe
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

2021-09-19 Thread Jason R Thorpe
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 *), 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), ,
+			sizeof(its32))) != 0) {
+		return error;
+	}
+	netbsd32_to_timespec(_interval, _interval);
+	netbsd32_to_timespec(_value, _value);
+
+	if (SCARG_P32(uap, old_value)) {
+		oitsp = 
+	}
+
+	error = do_timerfd_settime(l, SCARG(uap, fd), SCARG(uap, flags),
+	, oitsp, retval);
+	if (error == 0 && oitsp != NULL) {
+		memset(, 0, sizeof(its32));
+		netbsd32_from_timespec(>it_interval, _interval);
+		netbsd32_from_timespec(>it_value, _value);
+		error = copyout(, 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), , retval);
+	if (error == 0) {
+		memset(, 0, sizeof(its32));
+		netbsd32_from_timespec(_interval, _interval);
+		netbsd32_from_timespec(_value, _value);
+		error = copyout(, 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

2021-09-19 Thread Jason R Thorpe
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

2021-08-30 Thread Taylor R Campbell
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(, argp, sizeof args32);
 }
 
 static int



CVS commit: src/sys/compat/netbsd32

2021-08-30 Thread Taylor R Campbell
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

2021-01-17 Thread Roy Marples

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

2021-01-17 Thread Simon Burge
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=text/x-cvsweb-markup_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

2021-01-15 Thread Roy Marples

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

2021-01-14 Thread Roy Marples

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=text/x-cvsweb-markup_with_tag=netbsd-1-5

Roy


re: CVS commit: src/sys/compat/netbsd32

2021-01-14 Thread matthew green
> 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

2021-01-14 Thread Roy Marples

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

2021-01-14 Thread Simon Burge
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

2021-01-14 Thread Roy Marples

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

2021-01-14 Thread Simon Burge
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

2021-01-14 Thread Roy Marples

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

2020-03-08 Thread Paul Goyette

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

2019-11-18 Thread Rin Okuyama
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

2019-11-18 Thread Rin Okuyama
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

2019-11-18 Thread Rin Okuyama
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

2019-11-18 Thread Rin Okuyama
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

2019-11-18 Thread Rin Okuyama
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

2019-11-18 Thread Rin Okuyama
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

2019-11-17 Thread Rin Okuyama
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

2019-11-17 Thread Rin Okuyama
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(>_info, >_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(>_info, >_info);
-}
-
-void
 getucontext32(struct lwp *l, ucontext32_t *ucp)
 {
 	struct proc *p = l->l_proc;



CVS commit: src/sys/compat/netbsd32

2019-11-17 Thread Rin Okuyama
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

CVS commit: src/sys/compat/netbsd32

2019-11-17 Thread Rin Okuyama
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

2019-11-17 Thread Rin Okuyama
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

2019-11-17 Thread Rin Okuyama
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

2019-11-07 Thread Rin Okuyama
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

2019-11-07 Thread Rin Okuyama
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

2019-11-04 Thread Rin Okuyama

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

2019-11-04 Thread Rin Okuyama
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

2019-11-04 Thread Rin Okuyama
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

2019-11-04 Thread Rin Okuyama
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

2019-11-04 Thread Rin Okuyama
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

2019-11-04 Thread Rin Okuyama
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 

CVS commit: src/sys/compat/netbsd32

2019-11-04 Thread Rin Okuyama
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

2019-11-04 Thread Rin Okuyama
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

2019-11-04 Thread Rin Okuyama
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

2019-10-13 Thread Christos Zoulas
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

2019-10-13 Thread Christos Zoulas
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

2019-10-05 Thread Kamil Rytarowski
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

2019-10-05 Thread Kamil Rytarowski
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(, );
+
+	if (atv.tv_usec < 0 || atv.tv_usec >= 100)
+		return EINVAL;
+
 	TIMEVAL_TO_TIMESPEC(, );
 	return settime(p, );
 }

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(, );
+
+	if (atv.tv_usec < 0 || atv.tv_usec >= 100)
+		return EINVAL;
+
 	TIMEVAL_TO_TIMESPEC(, );
 	return settime(p, );
 }
@@ -546,4 +550,3 @@ netbsd32_clock_getcpuclockid2(struct lwp
 	}
 	return copyout(_id, SCARG_P32(uap, clock_id), sizeof(clock_id));
 }
-



CVS commit: src/sys/compat/netbsd32

2019-09-28 Thread Christos Zoulas
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

2019-09-28 Thread Christos Zoulas
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.



CVS commit: src/sys/compat/netbsd32

2019-09-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Sep 28 08:21:08 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_socket.c

Log Message:
signed/unsigned comparison.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_socket.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_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.52 src/sys/compat/netbsd32/netbsd32_socket.c:1.53
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.52	Fri Sep 27 08:17:11 2019
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Sat Sep 28 08:21:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.52 2019/09/27 08:17:11 mlelstv Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.53 2019/09/28 08:21:08 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.52 2019/09/27 08:17:11 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.53 2019/09/28 08:21:08 mlelstv Exp $");
 
 #include 
 #include 
@@ -418,7 +418,7 @@ copyin32_msg_control(struct lwp *l, stru
 			size_t nclen;
 
 			nclen = cidx + cspace;
-			if (nclen >= PAGE_SIZE) {
+			if (nclen >= (size_t)PAGE_SIZE) {
 error = EINVAL;
 goto failure;
 			}



CVS commit: src/sys/compat/netbsd32

2019-09-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Sep 28 08:21:08 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_socket.c

Log Message:
signed/unsigned comparison.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/compat/netbsd32/netbsd32_socket.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

2019-09-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Sep 27 08:17:12 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_socket.c

Log Message:
Ensure failure if resid goes negative.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/compat/netbsd32/netbsd32_socket.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_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.51 src/sys/compat/netbsd32/netbsd32_socket.c:1.52
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.51	Fri Sep 27 08:12:01 2019
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Fri Sep 27 08:17:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.51 2019/09/27 08:12:01 mlelstv Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.52 2019/09/27 08:17:11 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.51 2019/09/27 08:12:01 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.52 2019/09/27 08:17:11 mlelstv Exp $");
 
 #include 
 #include 
@@ -403,7 +403,8 @@ copyin32_msg_control(struct lwp *l, stru
 		/*
 		 * Sanity check the control message length.
 		 */
-		if (cmsg32.cmsg_len > (size_t)resid ||
+		if (resid < 0 ||
+		cmsg32.cmsg_len > (size_t)resid ||
 		cmsg32.cmsg_len < sizeof(cmsg32)) {
 			error = EINVAL;
 			goto failure;



CVS commit: src/sys/compat/netbsd32

2019-09-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Sep 27 08:17:12 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_socket.c

Log Message:
Ensure failure if resid goes negative.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/compat/netbsd32/netbsd32_socket.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

2019-09-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Sep 27 08:12:01 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_socket.c

Log Message:
signed/unsigned mismatch.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/netbsd32/netbsd32_socket.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_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.50 src/sys/compat/netbsd32/netbsd32_socket.c:1.51
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.50	Thu Sep 26 01:32:09 2019
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Fri Sep 27 08:12:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.50 2019/09/26 01:32:09 christos Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.51 2019/09/27 08:12:01 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.50 2019/09/26 01:32:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.51 2019/09/27 08:12:01 mlelstv Exp $");
 
 #include 
 #include 
@@ -403,7 +403,7 @@ copyin32_msg_control(struct lwp *l, stru
 		/*
 		 * Sanity check the control message length.
 		 */
-		if (cmsg32.cmsg_len > resid ||
+		if (cmsg32.cmsg_len > (size_t)resid ||
 		cmsg32.cmsg_len < sizeof(cmsg32)) {
 			error = EINVAL;
 			goto failure;



CVS commit: src/sys/compat/netbsd32

2019-09-27 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Sep 27 08:12:01 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_socket.c

Log Message:
signed/unsigned mismatch.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/compat/netbsd32/netbsd32_socket.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

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 01:32:09 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_fs.c netbsd32_rndpseudo_50.c
netbsd32_socket.c

Log Message:
use size_t for counters (which are compared and set with unsigneds)


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_socket.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_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.84 src/sys/compat/netbsd32/netbsd32_fs.c:1.85
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.84	Sun Sep 22 18:59:38 2019
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Wed Sep 25 21:32:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.84 2019/09/22 22:59:38 christos Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.85 2019/09/26 01:32:09 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.84 2019/09/22 22:59:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.85 2019/09/26 01:32:09 christos Exp $");
 
 #include 
 #include 
@@ -139,7 +139,8 @@ dofilereadv32(int fd, struct file *fp, s
 	struct iovec *iov;
 	struct iovec *needfree;
 	struct iovec aiov[UIO_SMALLIOV];
-	long i, cnt, error = 0;
+	long i, error = 0;
+	size_t cnt;
 	u_int iovlen;
 	struct iovec *ktriov = NULL;
 
@@ -243,7 +244,8 @@ dofilewritev32(int fd, struct file *fp, 
 	struct iovec *iov;
 	struct iovec *needfree;
 	struct iovec aiov[UIO_SMALLIOV];
-	long i, cnt, error = 0;
+	long i, error = 0;
+	size_t cnt;
 	u_int iovlen;
 	struct iovec *ktriov = NULL;
 

Index: src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c
diff -u src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.3 src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.4
--- src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.3	Wed Jun 26 22:36:27 2019
+++ src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c	Wed Sep 25 21:32:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_rndpseudo_50.c,v 1.3 2019/06/27 02:36:27 christos Exp $	*/
+/*	$NetBSD: netbsd32_rndpseudo_50.c,v 1.4 2019/09/26 01:32:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_rndpseudo_50.c,v 1.3 2019/06/27 02:36:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_rndpseudo_50.c,v 1.4 2019/09/26 01:32:09 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -79,7 +79,7 @@ compat32_50_rnd_ioctl(struct file *fp, u
 	{
 		rndstat_t rstbuf = {.start = 0};
 		rndstat50_32_t *rst50_32 = (rndstat50_32_t *)addr;
-		int count;
+		size_t count;
 
 		if (rst50_32->count > RND_MAXSTATCOUNT50)
 			return (EINVAL);

Index: src/sys/compat/netbsd32/netbsd32_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.49 src/sys/compat/netbsd32/netbsd32_socket.c:1.50
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.49	Wed Nov 14 12:51:37 2018
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Wed Sep 25 21:32:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.49 2018/11/14 17:51:37 hannken Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.50 2019/09/26 01:32:09 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.49 2018/11/14 17:51:37 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.50 2019/09/26 01:32:09 christos Exp $");
 
 #include 
 #include 
@@ -74,11 +74,12 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_soc
 #define CMSG32_LEN(l)	(CMSG32_ALIGN(sizeof(struct cmsghdr)) + (l))
 
 static int
-copyout32_msg_control_mbuf(struct lwp *l, struct msghdr *mp, int *len,
+copyout32_msg_control_mbuf(struct lwp *l, struct msghdr *mp, u_int *len,
 struct mbuf *m, char **q, bool *truncated)
 {
 	struct cmsghdr *cmsg, cmsg32;
-	int i, j, error;
+	size_t i, j;
+	int error;
 
 	*truncated = false;
 	cmsg = mtod(m, struct cmsghdr *);



CVS commit: src/sys/compat/netbsd32

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 01:32:09 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_fs.c netbsd32_rndpseudo_50.c
netbsd32_socket.c

Log Message:
use size_t for counters (which are compared and set with unsigneds)


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/compat/netbsd32/netbsd32_fs.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c
cvs rdiff -u -r1.49 -r1.50 src/sys/compat/netbsd32/netbsd32_socket.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

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 01:30:46 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32.h

Log Message:
accrightslen should be u_int for compat too


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 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

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 01:30:46 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32.h

Log Message:
accrightslen should be u_int for compat too


To generate a diff of this commit:
cvs rdiff -u -r1.125 -r1.126 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.125 src/sys/compat/netbsd32/netbsd32.h:1.126
--- src/sys/compat/netbsd32/netbsd32.h:1.125	Wed Sep 25 17:40:42 2019
+++ src/sys/compat/netbsd32/netbsd32.h	Wed Sep 25 21:30:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.125 2019/09/25 21:40:42 christos Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.126 2019/09/26 01:30:46 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -738,7 +738,7 @@ struct netbsd32_omsghdr {
 	netbsd32_iovecp_t msg_iov;		/* scatter/gather array */
 	int		 msg_iovlen;		/* # elements in msg_iov */
 	netbsd32_caddr_t msg_accrights;		/* access rights sent/recvd */
-	int		 msg_accrightslen;
+	u_int		 msg_accrightslen;
 };
 
 typedef netbsd32_pointer_t netbsd32_mmsghdrp_t;



CVS commit: src/sys/compat/netbsd32

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 01:30:00 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_time.c

Log Message:
make the ?: expression types match


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 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

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 26 01:30:00 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_time.c

Log Message:
make the ?: expression types match


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 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_time.c
diff -u src/sys/compat/netbsd32/netbsd32_time.c:1.51 src/sys/compat/netbsd32/netbsd32_time.c:1.52
--- src/sys/compat/netbsd32/netbsd32_time.c:1.51	Sat Jan 26 21:08:40 2019
+++ src/sys/compat/netbsd32/netbsd32_time.c	Wed Sep 25 21:30:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_time.c,v 1.51 2019/01/27 02:08:40 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.51 2019/01/27 02:08:40 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.52 2019/09/26 01:30:00 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -534,11 +534,11 @@ netbsd32_clock_getcpuclockid2(struct lwp
 
 	switch (SCARG(uap, idtype)) {
 	case P_PID:
-		pid = id == 0 ? l->l_proc->p_pid : id;
+		pid = id == 0 ? l->l_proc->p_pid : (pid_t)id;
 		clock_id = CLOCK_PROCESS_CPUTIME_ID | pid;
 		break;
 	case P_LWPID:
-		lid = id == 0 ? l->l_lid : id;
+		lid = id == 0 ? l->l_lid : (lwpid_t)id;
 		clock_id = CLOCK_THREAD_CPUTIME_ID | lid;
 		break;
 	default:



CVS commit: src/sys/compat/netbsd32

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 25 21:40:43 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32.h

Log Message:
avoid signed-compare warning; use uintmax_t to print.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 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

2019-09-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 25 21:40:43 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32.h

Log Message:
avoid signed-compare warning; use uintmax_t to print.


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 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.124 src/sys/compat/netbsd32/netbsd32.h:1.125
--- src/sys/compat/netbsd32/netbsd32.h:1.124	Sun Sep 22 18:59:38 2019
+++ src/sys/compat/netbsd32/netbsd32.h	Wed Sep 25 17:40:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.124 2019/09/22 22:59:38 christos Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.125 2019/09/25 21:40:42 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -128,9 +128,9 @@ static __inline NETBSD32_POINTER_TYPE
 netbsd32_ptr32i(const void *p64)
 {
 	uintptr_t u64 = (uintptr_t)p64;
-	KASSERTMSG(u64 == (NETBSD32_POINTER_TYPE)u64, "u64 %llx != %llx",
-		   (unsigned long long)u64,
-		   (unsigned long long)(NETBSD32_POINTER_TYPE)u64);
+	KASSERTMSG(u64 == (uintptr_t)(NETBSD32_POINTER_TYPE)u64,
+	"u64 %jx != %jx", (uintmax_t)u64,
+	   (uintmax_t)(NETBSD32_POINTER_TYPE)u64);
 	return u64;
 }
 



CVS commit: src/sys/compat/netbsd32

2019-09-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Sep 21 06:56:51 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_fs.c

Log Message:
Fix netbsd32___mount50():

 - zero out fs_args32 to prevent info leaks
 - remove unused and non-functional copyin in NFS (lgtm bot)
 - declare udata, and don't pass kernel pointers to copyout (lgtm bot)
 - make sure data_len is just big enough, to mimic the native behavior
 - don't forget to update *retval with the 32bit value
 - add an XXX for NFS


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 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_fs.c
diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.82 src/sys/compat/netbsd32/netbsd32_fs.c:1.83
--- src/sys/compat/netbsd32/netbsd32_fs.c:1.82	Wed Dec 26 08:01:40 2018
+++ src/sys/compat/netbsd32/netbsd32_fs.c	Sat Sep 21 06:56:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_fs.c,v 1.82 2018/12/26 08:01:40 mrg Exp $	*/
+/*	$NetBSD: netbsd32_fs.c,v 1.83 2019/09/21 06:56:51 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.82 2018/12/26 08:01:40 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.83 2019/09/21 06:56:51 maxv Exp $");
 
 #include 
 #include 
@@ -809,17 +809,21 @@ netbsd32___mount50(struct lwp *l, const 
 	const char *type = SCARG_P32(uap, type);
 	const char *path = SCARG_P32(uap, path);
 	int flags = SCARG(uap, flags);
-	void *data = SCARG_P32(uap, data);
+	void *data, *udata;
 	size_t data_len = SCARG(uap, data_len);
 	enum uio_seg data_seg;
 	size_t len;
 	int error;
  
+	udata = data = SCARG_P32(uap, data);
+	memset(_args32, 0, sizeof(fs_args32));
+
 	error = copyinstr(type, mtype, sizeof(mtype), );
 	if (error)
 		return error;
+
 	if (strcmp(mtype, MOUNT_TMPFS) == 0) {
-		if (data_len != sizeof(fs_args32.tmpfs_args))
+		if (data_len < sizeof(fs_args32.tmpfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.tmpfs_args, 
@@ -843,7 +847,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.tmpfs_args;
 		data_len = sizeof(fs_args.tmpfs_args);
 	} else if (strcmp(mtype, MOUNT_MFS) == 0) {
-		if (data_len != sizeof(fs_args32.mfs_args))
+		if (data_len < sizeof(fs_args32.mfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.mfs_args, 
@@ -864,7 +868,7 @@ netbsd32___mount50(struct lwp *l, const 
 	} else if ((strcmp(mtype, MOUNT_UFS) == 0) ||
 		   (strcmp(mtype, MOUNT_EXT2FS) == 0) ||
 		   (strcmp(mtype, MOUNT_LFS) == 0)) {
-		if (data_len > sizeof(fs_args32.ufs_args))
+		if (data_len < sizeof(fs_args32.ufs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.ufs_args, 
@@ -878,7 +882,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.ufs_args;
 		data_len = sizeof(fs_args.ufs_args);
 	} else if (strcmp(mtype, MOUNT_CD9660) == 0) {
-		if (data_len != sizeof(fs_args32.iso_args))
+		if (data_len < sizeof(fs_args32.iso_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.iso_args, 
@@ -895,7 +899,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.iso_args;
 		data_len = sizeof(fs_args.iso_args);
 	} else if (strcmp(mtype, MOUNT_MSDOS) == 0) {
-		if (data_len != sizeof(fs_args32.msdosfs_args))
+		if (data_len < sizeof(fs_args32.msdosfs_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.msdosfs_args, 
@@ -925,8 +929,9 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.msdosfs_args;
 		data_len = sizeof(fs_args.msdosfs_args);
 	} else if (strcmp(mtype, MOUNT_NFS) == 0) {
-		if (data_len != sizeof(fs_args32.nfs_args))
+		if (data_len < sizeof(fs_args32.nfs_args))
 			return EINVAL;
+		/* XXX: NFS requires copyin even with MNT_GETARGS */
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.nfs_args, 
 			sizeof(fs_args32.nfs_args));
@@ -952,7 +957,7 @@ netbsd32___mount50(struct lwp *l, const 
 		data = _args.nfs_args;
 		data_len = sizeof(fs_args.nfs_args);
 	} else if (strcmp(mtype, MOUNT_NULL) == 0) {
-		if (data_len > sizeof(fs_args32.null_args))
+		if (data_len < sizeof(fs_args32.null_args))
 			return EINVAL;
 		if ((flags & MNT_GETARGS) == 0) {
 			error = copyin(data, _args32.null_args, 
@@ -968,10 +973,12 @@ netbsd32___mount50(struct lwp *l, const 
 	} else {
 		data_seg = UIO_USERSPACE;
 	}
+
 	error = do_sys_mount(l, mtype, UIO_SYSSPACE, path, flags, data, data_seg,
 	data_len, retval);
 	if (error)
 		return error;
+
 	if (flags & MNT_GETARGS) {
 		data_len = *retval;
 		if (strcmp(mtype, MOUNT_TMPFS) == 0) {
@@ -989,8 +996,9 @@ netbsd32___mount50(struct lwp *l, const 
 			fs_args.tmpfs_args.ta_root_gid;
 			

CVS commit: src/sys/compat/netbsd32

2019-09-21 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Sep 21 06:56:51 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_fs.c

Log Message:
Fix netbsd32___mount50():

 - zero out fs_args32 to prevent info leaks
 - remove unused and non-functional copyin in NFS (lgtm bot)
 - declare udata, and don't pass kernel pointers to copyout (lgtm bot)
 - make sure data_len is just big enough, to mimic the native behavior
 - don't forget to update *retval with the 32bit value
 - add an XXX for NFS


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 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

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 15:16:41 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_select.c

Log Message:
Validate usec ranges in netbsd32___select50()

Later in the code selcommon() checks for proper timespec, check only
correct usec of timeval before type conversions.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/netbsd32/netbsd32_select.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_select.c
diff -u src/sys/compat/netbsd32/netbsd32_select.c:1.19 src/sys/compat/netbsd32/netbsd32_select.c:1.20
--- src/sys/compat/netbsd32/netbsd32_select.c:1.19	Fri Apr 23 15:19:20 2010
+++ src/sys/compat/netbsd32/netbsd32_select.c	Fri Sep 20 15:16:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_select.c,v 1.19 2010/04/23 15:19:20 rmind Exp $	*/
+/*	$NetBSD: netbsd32_select.c,v 1.20 2019/09/20 15:16:41 kamil Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_select.c,v 1.19 2010/04/23 15:19:20 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_select.c,v 1.20 2019/09/20 15:16:41 kamil Exp $");
 
 #include 
 #include 
@@ -68,6 +68,10 @@ netbsd32___select50(struct lwp *l,
 		error = copyin(SCARG_P32(uap, tv), , sizeof(tv32));
 		if (error != 0)
 			return error;
+
+		if (tv32.tv_usec < 0 || tv32.tv_usec >= 100)
+			return EINVAL;
+
 		ats.tv_sec = tv32.tv_sec;
 		ats.tv_nsec = tv32.tv_usec * 1000;
 		ts = 



CVS commit: src/sys/compat/netbsd32

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 15:16:41 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_select.c

Log Message:
Validate usec ranges in netbsd32___select50()

Later in the code selcommon() checks for proper timespec, check only
correct usec of timeval before type conversions.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/compat/netbsd32/netbsd32_select.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

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 15:09:07 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c

Log Message:
Validate usec ranges in compat_50_netbsd32_select()

Later in the code selcommon() checks for proper timespec, check only
correct usec of timeval before type conversions.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 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.39 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.40
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.39	Thu Jun 27 02:36:27 2019
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Fri Sep 20 15:09:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.39 2019/06/27 02:36:27 christos Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 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.39 2019/06/27 02:36:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.40 2019/09/20 15:09:07 kamil Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -140,6 +140,10 @@ compat_50_netbsd32_select(struct lwp *l,
 		error = copyin(SCARG_P32(uap, tv), , sizeof(tv32));
 		if (error != 0)
 			return error;
+
+		if (tv32.tv_usec < 0 || tv32.tv_usec >= 100)
+			return EINVAL;
+
 		ats.tv_sec = tv32.tv_sec;
 		ats.tv_nsec = tv32.tv_usec * 1000;
 		ts = 



CVS commit: src/sys/compat/netbsd32

2019-09-20 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 20 15:09:07 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c

Log Message:
Validate usec ranges in compat_50_netbsd32_select()

Later in the code selcommon() checks for proper timespec, check only
correct usec of timeval before type conversions.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 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

2019-09-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 15 20:26:52 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_execve.c

Log Message:
fix fexecve


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 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

2019-09-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep 15 20:26:52 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_execve.c

Log Message:
fix fexecve


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 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_execve.c
diff -u src/sys/compat/netbsd32/netbsd32_execve.c:1.39 src/sys/compat/netbsd32/netbsd32_execve.c:1.40
--- src/sys/compat/netbsd32/netbsd32_execve.c:1.39	Mon Sep  3 12:29:29 2018
+++ src/sys/compat/netbsd32/netbsd32_execve.c	Sun Sep 15 16:26:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_execve.c,v 1.39 2018/09/03 16:29:29 riastradh Exp $	*/
+/*	$NetBSD: netbsd32_execve.c,v 1.40 2019/09/15 20:26:51 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.39 2018/09/03 16:29:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_execve.c,v 1.40 2019/09/15 20:26:51 christos Exp $");
 
 #include 
 #include 
@@ -71,9 +71,8 @@ netbsd32_execve(struct lwp *l, const str
 		syscallarg(netbsd32_charpp) argp;
 		syscallarg(netbsd32_charpp) envp;
 	} */
-	const char *path = SCARG_P32(uap, path);
 
-	return execve1(l, path, SCARG_P32(uap, argp),
+	return execve1(l, SCARG_P32(uap, path), -1, SCARG_P32(uap, argp),
 	SCARG_P32(uap, envp), netbsd32_execve_fetch_element);
 }
 
@@ -86,13 +85,9 @@ netbsd32_fexecve(struct lwp *l, const st
 		syscallarg(netbsd32_charpp) argp;
 		syscallarg(netbsd32_charpp) envp;
 	} */
-	struct sys_fexecve_args ua;
 
-	NETBSD32TO64_UAP(fd);
-	NETBSD32TOP_UAP(argp, char * const);
-	NETBSD32TOP_UAP(envp, char * const);
-
-	return sys_fexecve(l, , retval);
+	return execve1(l, NULL, SCARG(uap, fd), SCARG_P32(uap, argp),
+	SCARG_P32(uap, envp), netbsd32_execve_fetch_element);
 }
 
 static int



CVS commit: src/sys/compat/netbsd32

2019-08-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 23 13:59:45 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_43.c

Log Message:
Fix info leak.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_compat_43.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_43.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_43.c:1.57 src/sys/compat/netbsd32/netbsd32_compat_43.c:1.58
--- src/sys/compat/netbsd32/netbsd32_compat_43.c:1.57	Sun Jan 27 02:08:40 2019
+++ src/sys/compat/netbsd32/netbsd32_compat_43.c	Fri Aug 23 13:59:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_43.c,v 1.57 2019/01/27 02:08:40 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_43.c,v 1.58 2019/08/23 13:59:45 maxv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.57 2019/01/27 02:08:40 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_43.c,v 1.58 2019/08/23 13:59:45 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_43.h"
@@ -77,6 +77,7 @@ static void
 netbsd32_from_stat(const struct stat *sb, struct netbsd32_stat43 *sp32)
 {
 
+	memset(sp32, 0, sizeof(*sp32));
 	sp32->st_dev = sb->st_dev;
 	sp32->st_ino = sb->st_ino;
 	sp32->st_mode = sb->st_mode;



CVS commit: src/sys/compat/netbsd32

2019-08-23 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 23 13:59:45 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_43.c

Log Message:
Fix info leak.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/netbsd32/netbsd32_compat_43.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

2019-08-21 Thread Christos Zoulas
Thanks for the quick review! The errors below should be all fixed.

christos

> On Aug 20, 2019, at 3:18 PM, Maxime Villard  wrote:
> 
> 1) In compat_drm_agp_info(), seems like it should be info64to32.
> 
> 2) In compat_drm_getstats(), the assignments in the loop are inverted, it's
> st32 which should be set to the values of st64, not the other way around.
> 
> 3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?).
> 
> 4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in
> this function it seems.



Re: CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Maxime Villard

Le 20/08/2019 à 11:32, Christos Zoulas a écrit :

Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:32:21 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32 netbsd32_ioctl.c
netbsd32_ioctl.h
Added Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
compat32 drm ioctl support from Surya Shankar at GSoC 2019


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_drm.c
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.67 -r1.68 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.


Pieces of code like this one which touch kernel entry points should go through
proper reviewing because they can cause immense trouble. They should not be
committed and enabled by default blindly like you just did.

Here are my remarks:

1) In compat_drm_agp_info(), seems like it should be info64to32.

2) In compat_drm_getstats(), the assignments in the loop are inverted, it's
st32 which should be set to the values of st64, not the other way around.

3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?).

4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in
this function it seems.

Etc, that's just after a quick glance. I will disable this code until it
receives proper review.


CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 14:26:06 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
>From maxv@:

1) In compat_drm_agp_info(), seems like it should be info64to32.
2) In compat_drm_getstats(), the assignments in the loop are inverted, it's
   st32 which should be set to the values of st64, not the other way around.
3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?).
4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in
   this function it seems.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.



CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 14:26:06 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
>From maxv@:

1) In compat_drm_agp_info(), seems like it should be info64to32.
2) In compat_drm_getstats(), the assignments in the loop are inverted, it's
   st32 which should be set to the values of st64, not the other way around.
3) In compat_drm_dma(), again inverted 32<->64, and there is no copyout (?).
4) In compat_drm_agp_enable(), m64 is uninitialized, everything is wrong in
   this function it seems.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.2 src/sys/compat/netbsd32/netbsd32_drm.c:1.3
--- src/sys/compat/netbsd32/netbsd32_drm.c:1.2	Tue Aug 20 05:55:49 2019
+++ src/sys/compat/netbsd32/netbsd32_drm.c	Tue Aug 20 10:26:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $ */
+/*	$NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.3 2019/08/20 14:26:05 christos Exp $");
 
 #include 
 #include 
@@ -338,16 +338,18 @@ compat_drm_getstats(struct file *file, v
 		return error;
 
 	st64.count = st32.count;
+	if (st64.count > __arraycount(st64.data))
+		return EINVAL;
 
 	error = drm_ioctl(file, DRM_IOCTL_GET_STATS, );
 	if (error)
 		return error;
 
-	// XXX: or does that need to be count?
-	for (int i = 0; i < __arraycount(st64.data); ++i) {
-		st64.data[i].value = st32.data[i].value;
-		st64.data[i].type = st32.data[i].type;
+	for (int i = 0; i < st64.count; ++i) {
+		st32.data[i].value = st64.data[i].value;
+		st32.data[i].type = st64.data[i].type;
 	}
+	st32.count = st64.count;
 
 	return copyout(arg, , sizeof(s32));
 }
@@ -565,15 +567,15 @@ compat_drm_dma(struct file *file, void *
 	if ((error = copyin(, arg, sizeof(d32))) != 0)
 		return error;
 
-	dma64to32(, );
+	dma32to64(, );
 
 	error = drm_ioctl(file, DRM_IOCTL_DMA, );
 	if (error)
 		return error;
 
-	dma32to64(, );
+	dma64to32(, );
 
-	return 0;
+	return copyout(arg, , sizeof(d32));
 }
 
 //XXX:i commented the below line for later use
@@ -592,7 +594,7 @@ compat_drm_agp_enable(struct file *file,
 	if ((error = copyin(, arg, sizeof(m32))) != 0)
 		return error;
 
-	m32.mode = m64.mode;
+	m64.mode = m32.mode;
 
 	return drm_ioctl(file, DRM_IOCTL_AGP_ENABLE, );
 }
@@ -612,17 +614,17 @@ typedef struct drm_agp_info32 {
 } drm_agp_info32_t;
 
 static void 
-info32to64(struct drm_agp_info *i64, const drm_agp_info32_t *i32)
+info64to32(drm_agp_info32_t *i32, const struct drm_agp_info *i64)
 {
-	i64->agp_version_major = i32->agp_version_major;
-	i64->agp_version_minor = i32->agp_version_minor;
-	i64->mode = i32->mode;
-	i64->aperture_base = i32->aperture_base;
-	i64->aperture_size = i32->aperture_size;
-	i64->memory_allowed = i32->memory_allowed;
-	i64->memory_used = i64->memory_used;
-	i64->id_vendor = i32->id_vendor;
-	i64->id_device = i32->id_device;
+	i32->agp_version_major = i64->agp_version_major;
+	i32->agp_version_minor = i64->agp_version_minor;
+	i32->mode = i64->mode;
+	i32->aperture_base = i64->aperture_base;
+	i32->aperture_size = i64->aperture_size;
+	i32->memory_allowed = i64->memory_allowed;
+	i32->memory_used = i64->memory_used;
+	i32->id_vendor = i64->id_vendor;
+	i32->id_device = i64->id_device;
 }
 
 static int 
@@ -636,7 +638,7 @@ compat_drm_agp_info(struct file *file, v
 	if (error)
 		return error;
 	
-	info32to64(,);
+	info64to32(, );
 	
 	return copyout(arg, , sizeof(i32));
 



CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 14:12:33 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32

Log Message:
make things compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/files.netbsd32

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.47 src/sys/compat/netbsd32/files.netbsd32:1.48
--- src/sys/compat/netbsd32/files.netbsd32:1.47	Tue Aug 20 08:25:41 2019
+++ src/sys/compat/netbsd32/files.netbsd32	Tue Aug 20 10:12:33 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.netbsd32,v 1.47 2019/08/20 12:25:41 maxv Exp $
+#	$NetBSD: files.netbsd32,v 1.48 2019/08/20 14:12:33 christos Exp $
 #
 # config file description for machine-independent netbsd32 compat code.
 # included by ports that need it.
@@ -8,7 +8,7 @@
 
 define	compat_netbsd32
 
-makeoptions	drmkms	CPPFLAGS+="-DNETBSD32_DRMKMS"
+#makeoptions	drmkms	CPPFLAGS+="-DNETBSD32_DRMKMS"
 
 file	compat/netbsd32/netbsd32_core.c		compat_netbsd32 & coredump
 file	compat/netbsd32/netbsd32_exec_elf32.c	compat_netbsd32 & exec_elf32



CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 14:12:33 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32

Log Message:
make things compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/compat/netbsd32/files.netbsd32

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

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:55:49 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
add NetBSD copyright.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.



CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:55:49 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
add NetBSD copyright.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.1 src/sys/compat/netbsd32/netbsd32_drm.c:1.2
--- src/sys/compat/netbsd32/netbsd32_drm.c:1.1	Tue Aug 20 05:32:21 2019
+++ src/sys/compat/netbsd32/netbsd32_drm.c	Tue Aug 20 05:55:49 2019
@@ -1,6 +1,9 @@
-/*	$NetBSD: netbsd32_drm.c,v 1.1 2019/08/20 09:32:21 christos Exp $ */
+/*	$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $ */
 
 /*
+ * Copyright (c) 2019 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
  * This code was written by Surya Shankar for GSoC 2019.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.1 2019/08/20 09:32:21 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_drm.c,v 1.2 2019/08/20 09:55:49 christos Exp $");
 
 #include 
 #include 



CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:32:21 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32 netbsd32_ioctl.c
netbsd32_ioctl.h
Added Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
compat32 drm ioctl support from Surya Shankar at GSoC 2019


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_drm.c
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.67 -r1.68 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/files.netbsd32
diff -u src/sys/compat/netbsd32/files.netbsd32:1.45 src/sys/compat/netbsd32/files.netbsd32:1.46
--- src/sys/compat/netbsd32/files.netbsd32:1.45	Mon Jun 17 21:36:50 2019
+++ src/sys/compat/netbsd32/files.netbsd32	Tue Aug 20 05:32:21 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.netbsd32,v 1.45 2019/06/18 01:36:50 christos Exp $
+#	$NetBSD: files.netbsd32,v 1.46 2019/08/20 09:32:21 christos Exp $
 #
 # config file description for machine-independent netbsd32 compat code.
 # included by ports that need it.
@@ -7,10 +7,14 @@
 # own file lists.
 
 define	compat_netbsd32
+
+makeoptions	drmkms	CPPFLAGS+="-DNETBSD32_DRMKMS"
+
 file	compat/netbsd32/netbsd32_core.c		compat_netbsd32 & coredump
 file	compat/netbsd32/netbsd32_exec_elf32.c	compat_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_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_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.103 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.104
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.103	Fri May 17 03:37:12 2019
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Tue Aug 20 05:32:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.103 2019/05/17 07:37:12 msaitoh Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.104 2019/08/20 09:32:21 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.103 2019/05/17 07:37:12 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.104 2019/08/20 09:32:21 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -1517,6 +1517,12 @@ netbsd32_ioctl(struct lwp *l,
 		IOCTL_STRUCT_CONV_TO(DIOCLWEDGES, dkwedge_list);
 
 	default:
+#ifdef NETBSD32_DRMKMS
+		if (IOCGROUP(com) == 'd') {
+			error = netbsd32_drm_ioctl(fp, com, data32, l);
+			break;
+		}
+#endif
 #ifdef NETBSD32_MD_IOCTL
 		error = netbsd32_md_ioctl(fp, com, data32, l);
 #else

Index: src/sys/compat/netbsd32/netbsd32_ioctl.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.67 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.68
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.67	Fri May 17 03:37:12 2019
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Tue Aug 20 05:32:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.h,v 1.67 2019/05/17 07:37:12 msaitoh Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.h,v 1.68 2019/08/20 09:32:21 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -36,6 +36,9 @@
 #include 
 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 /* we define some handy macros here... */
@@ -624,3 +627,5 @@ struct netbsd32_disk_strategy {
 
 #define DIOCGSTRATEGY32		_IOR('d', 125, struct netbsd32_disk_strategy)
 #define DIOCSSTRATEGY32		_IOW('d', 126, struct netbsd32_disk_strategy)
+
+int	netbsd32_drm_ioctl(struct file *, unsigned long, void *, struct lwp *);

Added files:

Index: src/sys/compat/netbsd32/netbsd32_drm.c
diff -u /dev/null src/sys/compat/netbsd32/netbsd32_drm.c:1.1
--- /dev/null	Tue Aug 20 05:32:21 2019
+++ src/sys/compat/netbsd32/netbsd32_drm.c	Tue Aug 20 05:32:21 2019
@@ -0,0 +1,974 @@
+/*	$NetBSD: netbsd32_drm.c,v 1.1 2019/08/20 09:32:21 christos Exp $ */
+
+/*
+ * This code was written by Surya Shankar for GSoC 2019.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 

CVS commit: src/sys/compat/netbsd32

2019-08-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 20 09:32:21 UTC 2019

Modified Files:
src/sys/compat/netbsd32: files.netbsd32 netbsd32_ioctl.c
netbsd32_ioctl.h
Added Files:
src/sys/compat/netbsd32: netbsd32_drm.c

Log Message:
compat32 drm ioctl support from Surya Shankar at GSoC 2019


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/files.netbsd32
cvs rdiff -u -r0 -r1.1 src/sys/compat/netbsd32/netbsd32_drm.c
cvs rdiff -u -r1.103 -r1.104 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.67 -r1.68 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

2019-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 27 02:36:27 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_rndpseudo_50.c

Log Message:
Include the right stuff so compat_netbsd32_50 compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_rndpseudo_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.38 src/sys/compat/netbsd32/netbsd32_compat_50.c:1.39
--- src/sys/compat/netbsd32/netbsd32_compat_50.c:1.38	Tue Jun 18 18:34:25 2019
+++ src/sys/compat/netbsd32/netbsd32_compat_50.c	Wed Jun 26 22:36:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_50.c,v 1.38 2019/06/18 22:34:25 kamil Exp $	*/
+/*	$NetBSD: netbsd32_compat_50.c,v 1.39 2019/06/27 02:36:27 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -36,10 +36,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.38 2019/06/18 22:34:25 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_50.c,v 1.39 2019/06/27 02:36:27 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
+#include "opt_compat_netbsd32.h"
 #include "opt_ntp.h"
 #include "opt_quota.h"
 #endif

Index: src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c
diff -u src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.2 src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.3
--- src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c:1.2	Sat Jan 26 21:08:40 2019
+++ src/sys/compat/netbsd32/netbsd32_rndpseudo_50.c	Wed Jun 26 22:36:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_rndpseudo_50.c,v 1.2 2019/01/27 02:08:40 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_rndpseudo_50.c,v 1.3 2019/06/27 02:36:27 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_rndpseudo_50.c,v 1.2 2019/01/27 02:08:40 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_rndpseudo_50.c,v 1.3 2019/06/27 02:36:27 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -41,6 +41,8 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_rnd
 #include 
 
 #include 
+
+#include 
 #include 
 
 /*



CVS commit: src/sys/compat/netbsd32

2019-06-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun 27 02:36:27 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_rndpseudo_50.c

Log Message:
Include the right stuff so compat_netbsd32_50 compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_rndpseudo_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

2019-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 16:46:03 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c

Log Message:
sort -u opt_ to remove dup.


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 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

2019-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 16:46:03 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c

Log Message:
sort -u opt_ to remove dup.


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 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.225 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.226
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.225	Tue Jun 18 12:22:54 2019
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Tue Jun 18 12:46:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.225 2019/06/18 16:22:54 christos Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.226 2019/06/18 16:46:03 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.225 2019/06/18 16:22:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.226 2019/06/18 16:46:03 christos Exp $");
 
 /*
  * below are all the standard NetBSD system calls, in the 32bit
@@ -46,15 +46,14 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_net
  */
 
 #if defined(_KERNEL_OPT)
+#include "opt_compat_43.h"
+#include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
-#include "opt_ntp.h"
 #include "opt_ktrace.h"
-#include "opt_compat_netbsd.h"
-#include "opt_compat_43.h"
-#include "opt_sysv.h"
+#include "opt_ntp.h"
 #include "opt_quota.h"
 #include "opt_syscall_debug.h"
-#include "opt_quota.h"
+#include "opt_sysv.h"
 #endif
 
 #include 



CVS commit: src/sys/compat/netbsd32

2019-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 16:24: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.141 -r1.142 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.140 -r1.141 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.20 -r1.21 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.31 -r1.32 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.141 src/sys/compat/netbsd32/netbsd32_syscall.h:1.142
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.141	Mon Jun 17 21:37:04 2019
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Tue Jun 18 12:24:32 2019
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.141 2019/06/18 01:37:04 christos Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.142 2019/06/18 16:24:32 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.127 2019/06/18 16:23:24 christos Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1240,9 +1240,13 @@
 /* syscall: "netbsd32_futimens" ret: "int" args: "int" "const netbsd32_timespecp_t" */
 #define	NETBSD32_SYS_netbsd32_futimens	472
 
+#if defined(QUOTA) || !defined(_KERNEL_OPT)
 /* syscall: "netbsd32___quotactl" ret: "int" args: "const netbsd32_charp" "netbsd32_voidp" */
 #define	NETBSD32_SYS_netbsd32___quotactl	473
 
+#else
+/* 473 is excluded netbsd32___quotactl */
+#endif
 /* syscall: "netbsd32_posix_spawn" ret: "int" args: "netbsd32_pid_tp" "const netbsd32_charp" "const netbsd32_posix_spawn_file_actionsp" "const netbsd32_posix_spawnattrp" "netbsd32_charpp" "netbsd32_charpp" */
 #define	NETBSD32_SYS_netbsd32_posix_spawn	474
 

Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.140 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.141
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.140	Mon Jun 17 21:37:04 2019
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Tue Jun 18 12:24:32 2019
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.140 2019/06/18 01:37:04 christos Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.141 2019/06/18 16:24:32 christos Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.127 2019/06/18 16:23:24 christos Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2534,12 +2534,15 @@ struct netbsd32_futimens_args {
 	syscallarg(const netbsd32_timespecp_t) tptr;
 };
 check_syscall_args(netbsd32_futimens)
+#if defined(QUOTA) || !defined(_KERNEL_OPT)
 
 struct netbsd32___quotactl_args {
 	syscallarg(const netbsd32_charp) path;
 	syscallarg(netbsd32_voidp) args;
 };
 check_syscall_args(netbsd32___quotactl)
+#else
+#endif
 
 struct netbsd32_posix_spawn_args {
 	syscallarg(netbsd32_pid_tp) pid;
@@ -3424,8 +3427,11 @@ int	netbsd32_unlinkat(struct lwp *, cons
 
 int	netbsd32_futimens(struct lwp *, const struct netbsd32_futimens_args *, register_t *);
 
+#if defined(QUOTA) || !defined(_KERNEL_OPT)
 int	netbsd32___quotactl(struct lwp *, const struct netbsd32___quotactl_args *, register_t *);
 
+#else
+#endif
 int	netbsd32_posix_spawn(struct lwp *, const struct netbsd32_posix_spawn_args *, register_t *);
 
 int	netbsd32_recvmmsg(struct lwp *, const struct netbsd32_recvmmsg_args *, register_t *);
Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.140 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.141
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.140	Mon Jun 17 21:37:04 2019
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Tue Jun 18 12:24:32 2019
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.140 2019/06/18 01:37:04 christos Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.141 2019/06/18 16:24:32 christos Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp
+ * created from	NetBSD: syscalls.master,v 1.127 2019/06/18 16:23:24 christos Exp
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_syscalls.c,v 1.140 2019/06/18 01:37:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: 

CVS commit: src/sys/compat/netbsd32

2019-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 16:24: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.141 -r1.142 src/sys/compat/netbsd32/netbsd32_syscall.h
cvs rdiff -u -r1.140 -r1.141 src/sys/compat/netbsd32/netbsd32_syscallargs.h \
src/sys/compat/netbsd32/netbsd32_syscalls.c
cvs rdiff -u -r1.20 -r1.21 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.139 -r1.140 src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.31 -r1.32 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

2019-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 16:23:24 UTC 2019

Modified Files:
src/sys/compat/netbsd32: syscalls.master

Log Message:
Add ifdef for quota and include the syscall numbers header


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 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.126 src/sys/compat/netbsd32/syscalls.master:1.127
--- src/sys/compat/netbsd32/syscalls.master:1.126	Mon Jun 17 21:36:50 2019
+++ src/sys/compat/netbsd32/syscalls.master	Tue Jun 18 12:23:24 2019
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.126 2019/06/18 01:36:50 christos Exp $
+	$NetBSD: syscalls.master,v 1.127 2019/06/18 16:23:24 christos Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -50,6 +50,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 %%
@@ -1124,8 +1125,12 @@
 			int flag); }
 472	STD  		{ int|netbsd32||futimens(int fd, \
 			const netbsd32_timespecp_t tptr); }
+#if defined(QUOTA) || !defined(_KERNEL_OPT)
 473	STD		{ int|netbsd32||__quotactl(const netbsd32_charp path, \
 			netbsd32_voidp args); }
+#else
+473	EXCL		netbsd32___quotactl
+#endif
 474	NOERR		{ int|netbsd32||posix_spawn(netbsd32_pid_tp pid, \
 			const netbsd32_charp path, \
 			const netbsd32_posix_spawn_file_actionsp \



CVS commit: src/sys/compat/netbsd32

2019-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 16:23:24 UTC 2019

Modified Files:
src/sys/compat/netbsd32: syscalls.master

Log Message:
Add ifdef for quota and include the syscall numbers header


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 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

2019-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 16:22:54 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c netbsd32_quota.c

Log Message:
Add options for quota.


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_quota.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

2019-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 16:22:54 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_netbsd.c netbsd32_quota.c

Log Message:
Add options for quota.


To generate a diff of this commit:
cvs rdiff -u -r1.224 -r1.225 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_quota.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.224 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.225
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.224	Tue Jun 18 12:05:30 2019
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Tue Jun 18 12:22:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.224 2019/06/18 16:05:30 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.225 2019/06/18 16:22:54 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.224 2019/06/18 16:05:30 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.225 2019/06/18 16:22:54 christos Exp $");
 
 /*
  * below are all the standard NetBSD system calls, in the 32bit
@@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_net
 #include "opt_compat_netbsd.h"
 #include "opt_compat_43.h"
 #include "opt_sysv.h"
+#include "opt_quota.h"
 #include "opt_syscall_debug.h"
 #include "opt_quota.h"
 #endif

Index: src/sys/compat/netbsd32/netbsd32_quota.c
diff -u src/sys/compat/netbsd32/netbsd32_quota.c:1.1 src/sys/compat/netbsd32/netbsd32_quota.c:1.2
--- src/sys/compat/netbsd32/netbsd32_quota.c:1.1	Mon Dec 24 15:44:39 2018
+++ src/sys/compat/netbsd32/netbsd32_quota.c	Tue Jun 18 12:22:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_quota.c,v 1.1 2018/12/24 20:44:39 mrg Exp $	*/
+/*	$NetBSD: netbsd32_quota.c,v 1.2 2019/06/18 16:22:54 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green
@@ -29,7 +29,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_quota.c,v 1.1 2018/12/24 20:44:39 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_quota.c,v 1.2 2019/06/18 16:22:54 christos Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_quota.h"
+#endif
 
 #include 
 #include 
@@ -42,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_quo
 #include 
 #include 
 
+#ifdef QUOTA
 int
 netbsd32___quotactl(struct lwp *l, const struct netbsd32___quotactl_args *uap, register_t *retval)
 {
@@ -135,3 +140,4 @@ netbsd32___quotactl(struct lwp *l, const
 
 	return do_sys_quotactl(SCARG_P32(uap, path), );
 }
+#endif



  1   2   >