Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/netbsd32 Do not use native off_t type under compa...



details:   https://anonhg.NetBSD.org/src/rev/14af9f7b16a4
branches:  trunk
changeset: 329041:14af9f7b16a4
user:      njoly <njoly%NetBSD.org@localhost>
date:      Wed Apr 30 17:23:45 2014 +0000

description:
Do not use native off_t type under compat netbsd32, but a new
netbsd32_off_t that provide the expected alignment for 64bit types.

diffstat:

 sys/compat/netbsd32/netbsd32.h        |   3 ++-
 sys/compat/netbsd32/netbsd32_fs.c     |   8 ++++----
 sys/compat/netbsd32/netbsd32_netbsd.c |  20 ++++++++++----------
 sys/compat/netbsd32/syscalls.master   |  24 ++++++++++++------------
 4 files changed, 28 insertions(+), 27 deletions(-)

diffs (210 lines):

diff -r 87ba6b37b18a -r 14af9f7b16a4 sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h    Wed Apr 30 15:53:09 2014 +0000
+++ b/sys/compat/netbsd32/netbsd32.h    Wed Apr 30 17:23:45 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32.h,v 1.99 2014/02/03 17:03:16 manu Exp $       */
+/*     $NetBSD: netbsd32.h,v 1.100 2014/04/30 17:23:45 njoly Exp $     */
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -166,6 +166,7 @@
 typedef netbsd32_intptr_t netbsd32_semid_t;
 typedef netbsd32_pointer_t netbsd32_semidp_t;
 typedef netbsd32_uint64 netbsd32_dev_t;
+typedef netbsd32_int64 netbsd32_off_t;
 
 /* from <sys/uio.h> */
 typedef netbsd32_pointer_t netbsd32_iovecp_t;
diff -r 87ba6b37b18a -r 14af9f7b16a4 sys/compat/netbsd32/netbsd32_fs.c
--- a/sys/compat/netbsd32/netbsd32_fs.c Wed Apr 30 15:53:09 2014 +0000
+++ b/sys/compat/netbsd32/netbsd32_fs.c Wed Apr 30 17:23:45 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_fs.c,v 1.69 2013/10/17 18:01:11 njoly Exp $   */
+/*     $NetBSD: netbsd32_fs.c,v 1.70 2014/04/30 17:23:45 njoly Exp $   */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.69 2013/10/17 18:01:11 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.70 2014/04/30 17:23:45 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -634,7 +634,7 @@
                syscallarg(const netbsd32_iovecp_t) iovp;
                syscallarg(int) iovcnt;
                syscallarg(int) pad;
-               syscallarg(off_t) offset;
+               syscallarg(netbsd32_off_t) offset;
        } */
        file_t *fp;
        struct vnode *vp;
@@ -680,7 +680,7 @@
                syscallarg(const netbsd32_iovecp_t) iovp;
                syscallarg(int) iovcnt;
                syscallarg(int) pad;
-               syscallarg(off_t) offset;
+               syscallarg(netbsd32_off_t) offset;
        } */
        file_t *fp;
        struct vnode *vp;
diff -r 87ba6b37b18a -r 14af9f7b16a4 sys/compat/netbsd32/netbsd32_netbsd.c
--- a/sys/compat/netbsd32/netbsd32_netbsd.c     Wed Apr 30 15:53:09 2014 +0000
+++ b/sys/compat/netbsd32/netbsd32_netbsd.c     Wed Apr 30 17:23:45 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_netbsd.c,v 1.185 2014/03/22 08:15:25 maxv Exp $       */
+/*     $NetBSD: netbsd32_netbsd.c,v 1.186 2014/04/30 17:23:45 njoly Exp $      */
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.185 2014/03/22 08:15:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.186 2014/04/30 17:23:45 njoly Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ddb.h"
@@ -1363,7 +1363,7 @@
                syscallarg(netbsd32_voidp) buf;
                syscallarg(netbsd32_size_t) nbyte;
                syscallarg(int) PAD;
-               syscallarg(off_t) offset;
+               syscallarg(netbsd32_off_t) offset;
        } */
        struct sys_pread_args ua;
 
@@ -1383,7 +1383,7 @@
                syscallarg(const netbsd32_voidp) buf;
                syscallarg(netbsd32_size_t) nbyte;
                syscallarg(int) PAD;
-               syscallarg(off_t) offset;
+               syscallarg(netbsd32_off_t) offset;
        } */
        struct sys_pwrite_args ua;
 
@@ -1519,7 +1519,7 @@
                syscallarg(int) flags;
                syscallarg(int) fd;
                syscallarg(netbsd32_long) PAD;
-               syscallarg(off_t) pos;
+               syscallarg(netbsd32_off_t) pos;
        } */
        struct sys_mmap_args ua;
        int error;
@@ -1582,7 +1582,7 @@
        /* {
                syscallarg(int) fd;
                syscallarg(int) PAD;
-               syscallarg(off_t) offset;
+               syscallarg(netbsd32_off_t) offset;
                syscallarg(int) whence;
        } */
        struct sys_lseek_args ua;
@@ -1617,7 +1617,7 @@
        /* {
                syscallarg(const netbsd32_charp) path;
                syscallarg(int) PAD;
-               syscallarg(off_t) length;
+               syscallarg(netbsd32_off_t) length;
        } */
        struct sys_truncate_args ua;
 
@@ -1633,7 +1633,7 @@
        /* {
                syscallarg(int) fd;
                syscallarg(int) PAD;
-               syscallarg(off_t) length;
+               syscallarg(netbsd32_off_t) length;
        } */
        struct sys_ftruncate_args ua;
 
@@ -2611,8 +2611,8 @@
        /* {
                syscallarg(int) fd;
                syscallarg(int) PAD;
-               syscallarg(off_t) offset;
-               syscallarg(off_t) len;
+               syscallarg(netbsd32_off_t) offset;
+               syscallarg(netbsd32_off_t) len;
                syscallarg(int) advice;
        } */
 
diff -r 87ba6b37b18a -r 14af9f7b16a4 sys/compat/netbsd32/syscalls.master
--- a/sys/compat/netbsd32/syscalls.master       Wed Apr 30 15:53:09 2014 +0000
+++ b/sys/compat/netbsd32/syscalls.master       Wed Apr 30 17:23:45 2014 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.98 2013/10/17 18:01:11 njoly Exp $
+       $NetBSD: syscalls.master,v 1.99 2014/04/30 17:23:45 njoly Exp $
 
 ;      from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;      @(#)syscalls.master     8.2 (Berkeley) 1/13/94
@@ -359,10 +359,10 @@
 172    UNIMPL
 173    STD             { netbsd32_ssize_t|netbsd32||pread(int fd, \
                            netbsd32_voidp buf, netbsd32_size_t nbyte, \
-                           int PAD, off_t offset); }
+                           int PAD, netbsd32_off_t offset); }
 174    STD             { netbsd32_ssize_t|netbsd32||pwrite(int fd, \
                            netbsd32_voidp buf, netbsd32_size_t nbyte, \
-                           int PAD, off_t offset); }
+                           int PAD, netbsd32_off_t offset); }
 #if defined(NTP) || !defined(_KERNEL_OPT)
 175    COMPAT_30       { int|netbsd32||ntp_gettime( \
                            netbsd32_ntptimeval50p_t ntvp); }
@@ -402,15 +402,15 @@
                            netbsd32_longp basep); }
 197    STD             { netbsd32_voidp|netbsd32||mmap(netbsd32_voidp addr, \
                            netbsd32_size_t len, int prot, int flags, int fd, \
-                           netbsd32_long PAD, off_t pos); }
+                           netbsd32_long PAD, netbsd32_off_t pos); }
 198    INDIR           { quad_t|netbsd32||___syscall(quad_t code, \
                            ... register32_t args[NETBSD32_SYS_MAXSYSARGS]); }
-199    STD             { off_t|netbsd32||lseek(int fd, int PAD, off_t offset, \
-                           int whence); }
+199    STD             { netbsd32_off_t|netbsd32||lseek(int fd, int PAD, \
+                           netbsd32_off_t offset, int whence); }
 200    STD             { int|netbsd32||truncate(netbsd32_charp path, int PAD, \
-                           off_t length); }
+                           netbsd32_off_t length); }
 201    STD             { int|netbsd32||ftruncate(int fd, int PAD, \
-                           off_t length); }
+                           netbsd32_off_t length); }
 202    STD             { int|netbsd32||__sysctl(netbsd32_intp name, \
                            u_int namelen, netbsd32_voidp old, \
                            netbsd32_size_tp oldlenp, netbsd32_voidp new, \
@@ -583,10 +583,10 @@
                            int pid); }
 289    STD             { netbsd32_ssize_t|netbsd32||preadv(int fd, \
                            netbsd32_iovecp_t iovp, int iovcnt, int PAD, \
-                           off_t offset); }
+                           netbsd32_off_t offset); }
 290    STD             { netbsd32_ssize_t|netbsd32||pwritev(int fd, \
                            netbsd32_iovecp_t iovp, int iovcnt, int PAD, \
-                           off_t offset); }
+                           netbsd32_off_t offset); }
 291    STD             { int|netbsd32|14|sigaction(int signum, \
                            netbsd32_sigactionp_t nsa, \
                            netbsd32_sigactionp_t osa); }
@@ -705,7 +705,7 @@
 352    UNIMPL
 353    UNIMPL
 354    STD             { int|netbsd32||fsync_range(int fd, int flags, \
-                           off_t start, off_t length); }
+                           netbsd32_off_t start, netbsd32_off_t length); }
 355    STD             { int|netbsd32||uuidgen(netbsd32_uuidp_t store, \
                            int count); }
 356    STD             { int|netbsd32||getvfsstat(netbsd32_statvfsp_t buf, \
@@ -851,7 +851,7 @@
 415    UNIMPL
 
 416    STD             { int|netbsd32|50|posix_fadvise(int fd, int PAD, \
-                           off_t offset, off_t len, int advice); }
+                           netbsd32_off_t offset, netbsd32_off_t len, int advice); }
 417    STD             { int|netbsd32|50|select(int nd, \
                            netbsd32_fd_setp_t in,  netbsd32_fd_setp_t ou, \
                            netbsd32_fd_setp_t ex, netbsd32_timevalp_t tv); }



Home | Main Index | Thread Index | Old Index