Mon Mar 16 20:48:13 2009 UTC ()
Fix dev_t alignment, by not using the new 64bit value directly but
rather a 32bit aligned version (netbsd32_dev_t = netbsd32_uint64).

ok by cube@.


(njoly)
diff -r1.81 -r1.82 src/sys/compat/netbsd32/netbsd32.h
diff -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_netbsd.c
diff -r1.78 -r1.79 src/sys/compat/netbsd32/syscalls.master

cvs diff -r1.81 -r1.82 src/sys/compat/netbsd32/netbsd32.h (expand / switch to unified diff)

--- src/sys/compat/netbsd32/netbsd32.h 2009/01/28 00:43:04 1.81
+++ src/sys/compat/netbsd32/netbsd32.h 2009/03/16 20:48:13 1.82
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: netbsd32.h,v 1.81 2009/01/28 00:43:04 njoly Exp $ */ 1/* $NetBSD: netbsd32.h,v 1.82 2009/03/16 20:48:13 njoly Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998, 2001, 2008 Matthew R. Green 4 * Copyright (c) 1998, 2001, 2008 Matthew R. Green
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -148,26 +148,27 @@ typedef netbsd32_pointer_t netbsd32_fsid @@ -148,26 +148,27 @@ typedef netbsd32_pointer_t netbsd32_fsid
148typedef netbsd32_pointer_t netbsd32_lwpidp; 148typedef netbsd32_pointer_t netbsd32_lwpidp;
149typedef netbsd32_pointer_t netbsd32_ucontextp; 149typedef netbsd32_pointer_t netbsd32_ucontextp;
150typedef netbsd32_pointer_t netbsd32_caddr_t; 150typedef netbsd32_pointer_t netbsd32_caddr_t;
151typedef netbsd32_pointer_t netbsd32_lwpctlp; 151typedef netbsd32_pointer_t netbsd32_lwpctlp;
152 152
153/* 153/*
154 * now, the compatibility structures and their fake pointer types. 154 * now, the compatibility structures and their fake pointer types.
155 */ 155 */
156 156
157/* from <sys/types.h> */ 157/* from <sys/types.h> */
158typedef netbsd32_pointer_t netbsd32_fd_setp_t; 158typedef netbsd32_pointer_t netbsd32_fd_setp_t;
159typedef netbsd32_intptr_t netbsd32_semid_t; 159typedef netbsd32_intptr_t netbsd32_semid_t;
160typedef netbsd32_pointer_t netbsd32_semidp_t; 160typedef netbsd32_pointer_t netbsd32_semidp_t;
 161typedef netbsd32_uint64 netbsd32_dev_t;
161 162
162/* from <sys/uio.h> */ 163/* from <sys/uio.h> */
163typedef netbsd32_pointer_t netbsd32_iovecp_t; 164typedef netbsd32_pointer_t netbsd32_iovecp_t;
164struct netbsd32_iovec { 165struct netbsd32_iovec {
165 netbsd32_voidp iov_base; /* Base address. */ 166 netbsd32_voidp iov_base; /* Base address. */
166 netbsd32_size_t iov_len; /* Length. */ 167 netbsd32_size_t iov_len; /* Length. */
167}; 168};
168 169
169/* from <sys/time.h> */ 170/* from <sys/time.h> */
170typedef int32_t netbsd32_timer_t; 171typedef int32_t netbsd32_timer_t;
171typedef int32_t netbsd32_time50_t; 172typedef int32_t netbsd32_time50_t;
172typedef netbsd32_int64 netbsd32_time_t; 173typedef netbsd32_int64 netbsd32_time_t;
173typedef netbsd32_pointer_t netbsd32_timerp_t; 174typedef netbsd32_pointer_t netbsd32_timerp_t;
@@ -584,33 +585,33 @@ struct netbsd32_msghdr { @@ -584,33 +585,33 @@ struct netbsd32_msghdr {
584typedef netbsd32_pointer_t netbsd32_omsghdrp_t; 585typedef netbsd32_pointer_t netbsd32_omsghdrp_t;
585struct netbsd32_omsghdr { 586struct netbsd32_omsghdr {
586 netbsd32_caddr_t msg_name; /* optional address */ 587 netbsd32_caddr_t msg_name; /* optional address */
587 int msg_namelen; /* size of address */ 588 int msg_namelen; /* size of address */
588 netbsd32_iovecp_t msg_iov; /* scatter/gather array */ 589 netbsd32_iovecp_t msg_iov; /* scatter/gather array */
589 int msg_iovlen; /* # elements in msg_iov */ 590 int msg_iovlen; /* # elements in msg_iov */
590 netbsd32_caddr_t msg_accrights; /* access rights sent/recvd */ 591 netbsd32_caddr_t msg_accrights; /* access rights sent/recvd */
591 int msg_accrightslen; 592 int msg_accrightslen;
592}; 593};
593 594
594/* from <sys/stat.h> */ 595/* from <sys/stat.h> */
595typedef netbsd32_pointer_t netbsd32_stat12p_t; 596typedef netbsd32_pointer_t netbsd32_stat12p_t;
596struct netbsd32_stat12 { /* NetBSD-1.2 stat struct */ 597struct netbsd32_stat12 { /* NetBSD-1.2 stat struct */
597 dev_t st_dev; /* inode's device */ 598 uint32_t st_dev; /* inode's device */
598 uint32_t st_ino; /* inode's number */ 599 uint32_t st_ino; /* inode's number */
599 uint16_t st_mode; /* inode protection mode */ 600 uint16_t st_mode; /* inode protection mode */
600 uint16_t st_nlink; /* number of hard links */ 601 uint16_t st_nlink; /* number of hard links */
601 uid_t st_uid; /* user ID of the file's owner */ 602 uid_t st_uid; /* user ID of the file's owner */
602 gid_t st_gid; /* group ID of the file's group */ 603 gid_t st_gid; /* group ID of the file's group */
603 dev_t st_rdev; /* device type */ 604 uint32_t st_rdev; /* device type */
604 struct netbsd32_timespec st_atimespec;/* time of last access */ 605 struct netbsd32_timespec st_atimespec;/* time of last access */
605 struct netbsd32_timespec st_mtimespec;/* time of last data modification */ 606 struct netbsd32_timespec st_mtimespec;/* time of last data modification */
606 struct netbsd32_timespec st_ctimespec;/* time of last file status change */ 607 struct netbsd32_timespec st_ctimespec;/* time of last file status change */
607 netbsd32_int64 st_size; /* file size, in bytes */ 608 netbsd32_int64 st_size; /* file size, in bytes */
608 netbsd32_int64 st_blocks; /* blocks allocated for file */ 609 netbsd32_int64 st_blocks; /* blocks allocated for file */
609 uint32_t st_blksize; /* optimal blocksize for I/O */ 610 uint32_t st_blksize; /* optimal blocksize for I/O */
610 uint32_t st_flags; /* user defined flags for file */ 611 uint32_t st_flags; /* user defined flags for file */
611 uint32_t st_gen; /* file generation number */ 612 uint32_t st_gen; /* file generation number */
612 int32_t st_lspare; 613 int32_t st_lspare;
613 netbsd32_int64 st_qspare[2]; 614 netbsd32_int64 st_qspare[2];
614}; 615};
615 616
616typedef netbsd32_pointer_t netbsd32_stat43p_t; 617typedef netbsd32_pointer_t netbsd32_stat43p_t;
@@ -666,33 +667,33 @@ struct netbsd32_stat50 { @@ -666,33 +667,33 @@ struct netbsd32_stat50 {
666 struct netbsd32_timespec50 st_mtimespec;/* time of last data modification */ 667 struct netbsd32_timespec50 st_mtimespec;/* time of last data modification */
667 struct netbsd32_timespec50 st_ctimespec;/* time of last file status change */ 668 struct netbsd32_timespec50 st_ctimespec;/* time of last file status change */
668 struct netbsd32_timespec50 st_birthtimespec; /* time of creation */ 669 struct netbsd32_timespec50 st_birthtimespec; /* time of creation */
669 netbsd32_int64 st_size; /* file size, in bytes */ 670 netbsd32_int64 st_size; /* file size, in bytes */
670 netbsd32_uint64 st_blocks; /* blocks allocated for file */ 671 netbsd32_uint64 st_blocks; /* blocks allocated for file */
671 blksize_t st_blksize; /* optimal blocksize for I/O */ 672 blksize_t st_blksize; /* optimal blocksize for I/O */
672 uint32_t st_flags; /* user defined flags for file */ 673 uint32_t st_flags; /* user defined flags for file */
673 uint32_t st_gen; /* file generation number */ 674 uint32_t st_gen; /* file generation number */
674 uint32_t st_spare[2]; 675 uint32_t st_spare[2];
675}; 676};
676 677
677typedef netbsd32_pointer_t netbsd32_statp_t; 678typedef netbsd32_pointer_t netbsd32_statp_t;
678struct netbsd32_stat { 679struct netbsd32_stat {
679 dev_t st_dev; /* inode's device */ 680 netbsd32_dev_t st_dev; /* inode's device */
680 mode_t st_mode; /* inode protection mode */ 681 mode_t st_mode; /* inode protection mode */
681 netbsd32_uint64 st_ino; /* inode's number */ 682 netbsd32_uint64 st_ino; /* inode's number */
682 nlink_t st_nlink; /* number of hard links */ 683 nlink_t st_nlink; /* number of hard links */
683 uid_t st_uid; /* user ID of the file's owner */ 684 uid_t st_uid; /* user ID of the file's owner */
684 gid_t st_gid; /* group ID of the file's group */ 685 gid_t st_gid; /* group ID of the file's group */
685 dev_t st_rdev; /* device type */ 686 netbsd32_dev_t st_rdev; /* device type */
686 struct netbsd32_timespec st_atimespec;/* time of last access */ 687 struct netbsd32_timespec st_atimespec;/* time of last access */
687 struct netbsd32_timespec st_mtimespec;/* time of last data modification */ 688 struct netbsd32_timespec st_mtimespec;/* time of last data modification */
688 struct netbsd32_timespec st_ctimespec;/* time of last file status change */ 689 struct netbsd32_timespec st_ctimespec;/* time of last file status change */
689 struct netbsd32_timespec st_birthtimespec; /* time of creation */ 690 struct netbsd32_timespec st_birthtimespec; /* time of creation */
690 netbsd32_int64 st_size; /* file size, in bytes */ 691 netbsd32_int64 st_size; /* file size, in bytes */
691 netbsd32_uint64 st_blocks; /* blocks allocated for file */ 692 netbsd32_uint64 st_blocks; /* blocks allocated for file */
692 blksize_t st_blksize; /* optimal blocksize for I/O */ 693 blksize_t st_blksize; /* optimal blocksize for I/O */
693 uint32_t st_flags; /* user defined flags for file */ 694 uint32_t st_flags; /* user defined flags for file */
694 uint32_t st_gen; /* file generation number */ 695 uint32_t st_gen; /* file generation number */
695 uint32_t st_spare[2]; 696 uint32_t st_spare[2];
696}; 697};
697 698
698/* from <sys/statvfs.h> */ 699/* from <sys/statvfs.h> */

cvs diff -r1.155 -r1.156 src/sys/compat/netbsd32/netbsd32_netbsd.c (expand / switch to unified diff)

--- src/sys/compat/netbsd32/netbsd32_netbsd.c 2009/03/04 18:11:24 1.155
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c 2009/03/16 20:48:13 1.156
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: netbsd32_netbsd.c,v 1.155 2009/03/04 18:11:24 skrll Exp $ */ 1/* $NetBSD: netbsd32_netbsd.c,v 1.156 2009/03/16 20:48:13 njoly Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998, 2001, 2008 Matthew R. Green 4 * Copyright (c) 1998, 2001, 2008 Matthew R. Green
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE. 26 * SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.155 2009/03/04 18:11:24 skrll Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.156 2009/03/16 20:48:13 njoly Exp $");
31 31
32#if defined(_KERNEL_OPT) 32#if defined(_KERNEL_OPT)
33#include "opt_ddb.h" 33#include "opt_ddb.h"
34#include "opt_ntp.h" 34#include "opt_ntp.h"
35#include "opt_compat_netbsd.h" 35#include "opt_compat_netbsd.h"
36#include "opt_compat_43.h" 36#include "opt_compat_43.h"
37#include "opt_sysv.h" 37#include "opt_sysv.h"
38#include "opt_syscall_debug.h" 38#include "opt_syscall_debug.h"
39#include "opt_sa.h" 39#include "opt_sa.h"
40 40
41#include "fs_lfs.h" 41#include "fs_lfs.h"
42#endif 42#endif
43 43
@@ -313,27 +313,27 @@ netbsd32_fchdir(struct lwp *l, const str @@ -313,27 +313,27 @@ netbsd32_fchdir(struct lwp *l, const str
313 struct sys_fchdir_args ua; 313 struct sys_fchdir_args ua;
314 314
315 NETBSD32TO64_UAP(fd); 315 NETBSD32TO64_UAP(fd);
316 316
317 return (sys_fchdir(l, &ua, retval)); 317 return (sys_fchdir(l, &ua, retval));
318} 318}
319 319
320int 320int
321netbsd32___mknod50(struct lwp *l, const struct netbsd32___mknod50_args *uap, register_t *retval) 321netbsd32___mknod50(struct lwp *l, const struct netbsd32___mknod50_args *uap, register_t *retval)
322{ 322{
323 /* { 323 /* {
324 syscallarg(const netbsd32_charp) path; 324 syscallarg(const netbsd32_charp) path;
325 syscallarg(mode_t) mode; 325 syscallarg(mode_t) mode;
326 syscallarg(dev_t) dev; 326 syscallarg(netbsd32_dev_t) dev;
327 } */ 327 } */
328 328
329 return do_sys_mknod(l, SCARG_P32(uap, path), SCARG(uap, mode), 329 return do_sys_mknod(l, SCARG_P32(uap, path), SCARG(uap, mode),
330 SCARG(uap, dev), retval); 330 SCARG(uap, dev), retval);
331} 331}
332 332
333int 333int
334netbsd32_chmod(struct lwp *l, const struct netbsd32_chmod_args *uap, register_t *retval) 334netbsd32_chmod(struct lwp *l, const struct netbsd32_chmod_args *uap, register_t *retval)
335{ 335{
336 /* { 336 /* {
337 syscallarg(const netbsd32_charp) path; 337 syscallarg(const netbsd32_charp) path;
338 syscallarg(mode_t) mode; 338 syscallarg(mode_t) mode;
339 } */ 339 } */

cvs diff -r1.78 -r1.79 src/sys/compat/netbsd32/syscalls.master (expand / switch to unified diff)

--- src/sys/compat/netbsd32/syscalls.master 2009/02/26 21:08:48 1.78
+++ src/sys/compat/netbsd32/syscalls.master 2009/03/16 20:48:13 1.79
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1 $NetBSD: syscalls.master,v 1.78 2009/02/26 21:08:48 christos Exp $ 1 $NetBSD: syscalls.master,v 1.79 2009/03/16 20:48:13 njoly Exp $
2 2
3; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp 3; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
4; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 4; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
5 5
6; NetBSD system call name/number "master" file. 6; NetBSD system call name/number "master" file.
7; (See syscalls.conf to see what it is processed into.) 7; (See syscalls.conf to see what it is processed into.)
8; 8;
9; Fields: number type [type-dependent ...] 9; Fields: number type [type-dependent ...]
10; number system call number, must be in order 10; number system call number, must be in order
11; type one of STD, OBSOL, UNIMPL, IGNORED, NODEF, NOARGS, or one of 11; type one of STD, OBSOL, UNIMPL, IGNORED, NODEF, NOARGS, or one of
12; the compatibility options defined in syscalls.conf. 12; the compatibility options defined in syscalls.conf.
13; 13;
14; types: 14; types:
@@ -974,16 +974,16 @@ @@ -974,16 +974,16 @@
974 netbsd32_itimerspecp_t ovalue); } 974 netbsd32_itimerspecp_t ovalue); }
975447 STD { int|netbsd32|50|timer_gettime(timer_t timerid, \ 975447 STD { int|netbsd32|50|timer_gettime(timer_t timerid, \
976 netbsd32_itimerspecp_t value); } 976 netbsd32_itimerspecp_t value); }
977#if defined(NTP) || !defined(_KERNEL_OPT) 977#if defined(NTP) || !defined(_KERNEL_OPT)
978448 STD { int|netbsd32|50|ntp_gettime( \ 978448 STD { int|netbsd32|50|ntp_gettime( \
979 netbsd32_ntptimevalp_t ntvp); } 979 netbsd32_ntptimevalp_t ntvp); }
980#else 980#else
981448 EXCL ___ntp_gettime50 981448 EXCL ___ntp_gettime50
982#endif 982#endif
983449 STD { int|netbsd32|50|wait4(int pid, \ 983449 STD { int|netbsd32|50|wait4(int pid, \
984 netbsd32_intp status, \ 984 netbsd32_intp status, \
985 int options, netbsd32_rusagep_t rusage); } 985 int options, netbsd32_rusagep_t rusage); }
986450 STD { int|netbsd32|50|mknod(const netbsd32_charp path, \ 986450 STD { int|netbsd32|50|mknod(const netbsd32_charp path, \
987 mode_t mode, dev_t dev); } 987 mode_t mode, netbsd32_dev_t dev); }
988451 STD { int|netbsd32|50|fhstat(const netbsd32_voidp fhp, \ 988451 STD { int|netbsd32|50|fhstat(const netbsd32_voidp fhp, \
989 netbsd32_size_t fh_size, netbsd32_statp_t sb); } 989 netbsd32_size_t fh_size, netbsd32_statp_t sb); }