Module Name:    src
Committed By:   simonb
Date:           Thu Jan 14 02:43:04 UTC 2021

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

Log Message:
Use netbsd32_* types instead of relying on __packed in the vnd ioctl
structures.  __packed didn't work on archs where 64-bit types were
64-bit aligned with a 32-bit ABI (eg MIPS n32).

OK mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 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.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.73 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.74
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.73	Mon Sep  7 03:12:51 2020
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Thu Jan 14 02:43:04 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.h,v 1.73 2020/09/07 03:12:51 mrg Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.h,v 1.74 2021/01/14 02:43:04 simonb Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -42,6 +42,8 @@
 #include <netinet/ip_mroute.h>
 #include <net80211/ieee80211_ioctl.h>
 
+#include <compat/netbsd32/netbsd32.h>
+
 /* we define some handy macros here... */
 #define IOCTL_STRUCT_CONV_TO(cmd, type)	\
 		size = IOCPARM_LEN(cmd); \
@@ -475,23 +477,19 @@ struct netbsd32_sioc_sg_req {
 /* from <sys/sockio.h> */
 #define	SIOCGETSGCNT32	_IOWR('u', 52, struct netbsd32_sioc_sg_req) /* sg pkt cnt */
 
-/*
- * The next two structures are marked "__packed" as they normally end up
- * being padded in 64-bit mode.
- */
 struct netbsd32_vnd_ioctl {
 	netbsd32_charp	vnd_file;	/* pathname of file to mount */
 	int		vnd_flags;	/* flags; see below */
 	struct vndgeom	vnd_geom;	/* geometry to emulate */
 	unsigned int	vnd_osize;	/* (returned) size of disk */
-	uint64_t	vnd_size;	/* (returned) size of disk */
-} __packed;
+	netbsd32_uint64	vnd_size;	/* (returned) size of disk */
+};
 
 struct netbsd32_vnd_user {
 	int		vnu_unit;	/* which vnd unit */
-	dev_t		vnu_dev;	/* file is on this device... */
-	ino_t		vnu_ino;	/* ...at this inode */
-} __packed;
+	netbsd32_dev_t	vnu_dev;	/* file is on this device... */
+	netbsd32_ino_t	vnu_ino;	/* ...at this inode */
+};
 
 /* from <dev/vndvar.h> */
 #define VNDIOCSET32	_IOWR('F', 0, struct netbsd32_vnd_ioctl)	/* enable disk */

Reply via email to