Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux Removed a hack to make PowerPC mmap work. T...



details:   https://anonhg.NetBSD.org/src/rev/d9ea77109845
branches:  trunk
changeset: 514675:d9ea77109845
user:      manu <manu%NetBSD.org@localhost>
date:      Sat Sep 08 07:09:43 2001 +0000

description:
Removed a hack to make PowerPC mmap work. This could have side effects on
alpha and i386. It has been tested and works on i386.

diffstat:

 sys/compat/linux/arch/alpha/linux_syscalls.c       |   2 +-
 sys/compat/linux/arch/alpha/syscalls.master        |   4 +-
 sys/compat/linux/arch/powerpc/linux_mmap.h         |  18 +----
 sys/compat/linux/arch/powerpc/linux_mmap_powerpc.c |  79 ----------------------
 sys/compat/linux/arch/powerpc/linux_syscall.h      |   8 +-
 sys/compat/linux/arch/powerpc/linux_syscallargs.h  |  15 +---
 sys/compat/linux/arch/powerpc/linux_syscalls.c     |   6 +-
 sys/compat/linux/arch/powerpc/linux_sysent.c       |   8 +-
 sys/compat/linux/arch/powerpc/syscalls.master      |  32 ++++----
 sys/compat/linux/common/linux_misc.c               |   6 +-
 sys/compat/linux/common/linux_mmap.h               |   4 +-
 11 files changed, 40 insertions(+), 142 deletions(-)

diffs (truncated from 412 to 300 lines):

diff -r a46be7721be7 -r d9ea77109845 sys/compat/linux/arch/alpha/linux_syscalls.c
--- a/sys/compat/linux/arch/alpha/linux_syscalls.c      Sat Sep 08 06:06:52 2001 +0000
+++ b/sys/compat/linux/arch/alpha/linux_syscalls.c      Sat Sep 08 07:09:43 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscalls.c,v 1.40 2001/07/04 10:26:28 jdolecek Exp $ */
+/* $NetBSD: linux_syscalls.c,v 1.41 2001/09/08 07:09:43 manu Exp $ */
 
 /*
  * System call names.
diff -r a46be7721be7 -r d9ea77109845 sys/compat/linux/arch/alpha/syscalls.master
--- a/sys/compat/linux/arch/alpha/syscalls.master       Sat Sep 08 06:06:52 2001 +0000
+++ b/sys/compat/linux/arch/alpha/syscalls.master       Sat Sep 08 07:09:43 2001 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.35 2001/07/04 10:25:32 jdolecek Exp $
+       $NetBSD: syscalls.master,v 1.36 2001/09/08 07:09:43 manu Exp $
 ;
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -173,7 +173,7 @@
 70     UNIMPL
 ;71    ALIAS           osf1_sys_mmap
 71     NOARGS          { int linux_sys_mmap(unsigned long addr, size_t len, \
-                           int prot, int flags, int fd, off_t offset); }
+                           int prot, int flags, int fd, linux_off_t offset); }
 72     UNIMPL
 73     NOARGS          { int sys_munmap(void *addr, size_t len); }
 74     NOARGS          { int sys_mprotect(void *addr, size_t len, int prot); }
diff -r a46be7721be7 -r d9ea77109845 sys/compat/linux/arch/powerpc/linux_mmap.h
--- a/sys/compat/linux/arch/powerpc/linux_mmap.h        Sat Sep 08 06:06:52 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_mmap.h        Sat Sep 08 07:09:43 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_mmap.h,v 1.2 2001/01/19 01:31:25 manu Exp $   */
+/* $NetBSD: linux_mmap.h,v 1.3 2001/09/08 07:09:43 manu Exp $   */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -56,20 +56,4 @@
 #define LINUX_MAP_DENYWRITE    0x0800
 #define        LINUX_MAP_EXECUTABLE    0x1000
 
-/* 
- * On the PowerPC, we have a problem with the offset argument. It's 32 bit
- * long on Linux and 64 bit long on NetBSD. Therefore we use a wrapper
- * function linux_sys_powerpc_mmap() to linux_sys_mmap()
- * 
- * Linux's off_t is __kernel_off_t (include/linux/types.h) which in turn
- * is a long (include/asm-ppc/posix_types.h)
- */
-#define linux_off_t long
-
-#ifdef _KERNEL
-__BEGIN_DECLS 
-int linux_sys_powerpc_mmap(struct proc *, void *, register_t *);
-__END_DECLS
-#endif /* !_KERNEL */ 
-
 #endif /* !_POWERPC_LINUX_MMAP_H */
diff -r a46be7721be7 -r d9ea77109845 sys/compat/linux/arch/powerpc/linux_mmap_powerpc.c
--- a/sys/compat/linux/arch/powerpc/linux_mmap_powerpc.c        Sat Sep 08 06:06:52 2001 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/* $NetBSD: linux_mmap_powerpc.c,v 1.1 2001/01/19 01:36:51 manu Exp $ */
-
-/*-
- * Copyright (c) 2001 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Emmanuel Dreyfus.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/cdefs.h>
-
-#include <compat/linux/arch/powerpc/linux_types.h>
-#include <compat/linux/arch/powerpc/linux_signal.h>
-#include <compat/linux/arch/powerpc/linux_syscallargs.h>
-
-#include <compat/linux/common/linux_mmap.h>
-
-/*
- * This wraps linux_sys_powerpc_mmap() to linux_sys_mmap(). We do this
- * because the offset agrument has no the same length (see linux_mmap.h)
- *
- * XXX This should die. We should use a linux_off_t in the 
- * common linux_sys_mmap() function
- */
-int linux_sys_powerpc_mmap(p, v, retval)
-       struct proc *p;
-       void *v;
-       register_t *retval;
-{
-       struct linux_sys_powerpc_mmap_args /* {
-               syscallarg(unsigned long) addr;
-               syscallarg(size_t) len;
-               syscallarg(int) prot;
-               syscallarg(int) flags;
-               syscallarg(int) fd;
-               syscallarg(linux_off_t) offset;
-       } */ *uap = v;
-       struct linux_sys_mmap_args cma;
-
-       SCARG(&cma,addr) = SCARG(uap, addr);
-       SCARG(&cma,len) = SCARG(uap, len);
-       SCARG(&cma,prot) = SCARG(uap, prot);
-       SCARG(&cma,flags) = SCARG(uap, flags);
-       SCARG(&cma,fd) = SCARG(uap, fd);
-       SCARG(&cma,offset) = (off_t) SCARG(uap, offset);
-
-       return linux_sys_mmap(p, &cma, retval);
-}
diff -r a46be7721be7 -r d9ea77109845 sys/compat/linux/arch/powerpc/linux_syscall.h
--- a/sys/compat/linux/arch/powerpc/linux_syscall.h     Sat Sep 08 06:06:52 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_syscall.h     Sat Sep 08 07:09:43 2001 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscall.h,v 1.9 2001/05/30 11:37:27 mrg Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.10 2001/09/08 07:09:44 manu Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.5 2001/05/13 20:54:45 manu Exp   
+ * created from        NetBSD: syscalls.master,v 1.6 2001/05/30 11:37:27 mrg Exp   
  */
 
 /* syscall: "syscall" ret: "int" args: */
@@ -246,8 +246,8 @@
 /* syscall: "readdir" ret: "int" args: "int" "caddr_t" "unsigned int" */
 #define        LINUX_SYS_readdir       89
 
-/* syscall: "powerpc_mmap" ret: "int" args: "unsigned long" "size_t" "int" "int" "int" "linux_off_t" */
-#define        LINUX_SYS_powerpc_mmap  90
+/* syscall: "mmap" ret: "int" args: "unsigned long" "size_t" "int" "int" "int" "linux_off_t" */
+#define        LINUX_SYS_mmap  90
 
 /* syscall: "munmap" ret: "int" args: "caddr_t" "int" */
 #define        LINUX_SYS_munmap        91
diff -r a46be7721be7 -r d9ea77109845 sys/compat/linux/arch/powerpc/linux_syscallargs.h
--- a/sys/compat/linux/arch/powerpc/linux_syscallargs.h Sat Sep 08 06:06:52 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_syscallargs.h Sat Sep 08 07:09:43 2001 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscallargs.h,v 1.9 2001/05/30 11:37:27 mrg Exp $ */
+/* $NetBSD: linux_syscallargs.h,v 1.10 2001/09/08 07:09:44 manu Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.5 2001/05/13 20:54:45 manu Exp   
+ * created from        NetBSD: syscalls.master,v 1.6 2001/05/30 11:37:27 mrg Exp   
  */
 
 #ifndef _LINUX_SYS__SYSCALLARGS_H_
@@ -234,15 +234,6 @@
        syscallarg(unsigned int) count;
 };
 
-struct linux_sys_powerpc_mmap_args {
-       syscallarg(unsigned long) addr;
-       syscallarg(size_t) len;
-       syscallarg(int) prot;
-       syscallarg(int) flags;
-       syscallarg(int) fd;
-       syscallarg(linux_off_t) offset;
-};
-
 struct linux_sys_truncate_args {
        syscallarg(const char *) path;
        syscallarg(long) length;
@@ -581,7 +572,7 @@
 int    linux_sys_swapon(struct proc *, void *, register_t *);
 int    linux_sys_reboot(struct proc *, void *, register_t *);
 int    linux_sys_readdir(struct proc *, void *, register_t *);
-int    linux_sys_powerpc_mmap(struct proc *, void *, register_t *);
+int    linux_sys_mmap(struct proc *, void *, register_t *);
 int    sys_munmap(struct proc *, void *, register_t *);
 int    linux_sys_truncate(struct proc *, void *, register_t *);
 int    compat_43_sys_ftruncate(struct proc *, void *, register_t *);
diff -r a46be7721be7 -r d9ea77109845 sys/compat/linux/arch/powerpc/linux_syscalls.c
--- a/sys/compat/linux/arch/powerpc/linux_syscalls.c    Sat Sep 08 06:06:52 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_syscalls.c    Sat Sep 08 07:09:43 2001 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_syscalls.c,v 1.9 2001/05/30 11:37:27 mrg Exp $ */
+/* $NetBSD: linux_syscalls.c,v 1.10 2001/09/08 07:09:44 manu Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.5 2001/05/13 20:54:45 manu Exp   
+ * created from        NetBSD: syscalls.master,v 1.6 2001/05/30 11:37:27 mrg Exp   
  */
 
 #if defined(_KERNEL_OPT)
@@ -117,7 +117,7 @@
        "swapon",                       /* 87 = swapon */
        "reboot",                       /* 88 = reboot */
        "readdir",                      /* 89 = readdir */
-       "powerpc_mmap",                 /* 90 = powerpc_mmap */
+       "mmap",                 /* 90 = mmap */
        "munmap",                       /* 91 = munmap */
        "truncate",                     /* 92 = truncate */
        "ftruncate",                    /* 93 = ftruncate */
diff -r a46be7721be7 -r d9ea77109845 sys/compat/linux/arch/powerpc/linux_sysent.c
--- a/sys/compat/linux/arch/powerpc/linux_sysent.c      Sat Sep 08 06:06:52 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_sysent.c      Sat Sep 08 07:09:43 2001 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: linux_sysent.c,v 1.9 2001/05/30 11:37:27 mrg Exp $ */
+/* $NetBSD: linux_sysent.c,v 1.10 2001/09/08 07:09:44 manu Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.5 2001/05/13 20:54:45 manu Exp   
+ * created from        NetBSD: syscalls.master,v 1.6 2001/05/30 11:37:27 mrg Exp   
  */
 
 #if defined(_KERNEL_OPT)
@@ -207,8 +207,8 @@
            linux_sys_reboot },                 /* 88 = reboot */
        { 3, s(struct linux_sys_readdir_args), 0,
            linux_sys_readdir },                /* 89 = readdir */
-       { 6, s(struct linux_sys_powerpc_mmap_args), 0,
-           linux_sys_powerpc_mmap },           /* 90 = powerpc_mmap */
+       { 6, s(struct linux_sys_mmap_args), 0,
+           linux_sys_mmap },                   /* 90 = mmap */
        { 2, s(struct sys_munmap_args), 0,
            sys_munmap },                       /* 91 = munmap */
        { 2, s(struct linux_sys_truncate_args), 0,
diff -r a46be7721be7 -r d9ea77109845 sys/compat/linux/arch/powerpc/syscalls.master
--- a/sys/compat/linux/arch/powerpc/syscalls.master     Sat Sep 08 06:06:52 2001 +0000
+++ b/sys/compat/linux/arch/powerpc/syscalls.master     Sat Sep 08 07:09:43 2001 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.6 2001/05/30 11:37:27 mrg Exp $  
+       $NetBSD: syscalls.master,v 1.7 2001/09/08 07:09:44 manu Exp $  
 
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -93,7 +93,8 @@
 7      STD             { int linux_sys_waitpid(int pid, int *status, \
                            int options);}
 8      STD             { int linux_sys_creat(const char *path, int mode); }
-9      STD             { int linux_sys_link(const char *path, const char *link); }
+9      STD             { int linux_sys_link(const char *path, const \
+                           char *link); }
 10     STD             { int linux_sys_unlink(const char *path); }
 11     STD             { int linux_sys_execve(const char *path, char **argp, \
                            char **envp); }
@@ -115,7 +116,7 @@
 24     NOARGS          { uid_t sys_getuid(void); }
 25     STD             { int linux_sys_stime(linux_time_t *t); }
 26     STD             { int linux_sys_ptrace(int request, int pid, \
-                         int addr, int data); }
+                           int addr, int data); }
 27     STD             { int linux_sys_alarm(unsigned int secs); }
 28     OBSOL           ofstat
 29     STD             { int linux_sys_pause(void); }
@@ -152,7 +153,8 @@
 56     OBSOL           mpx
 57     NOARGS          { int sys_setpgid(int pid, int pgid); }
 58     OBSOL           ulimit
-59 STD      { int linux_sys_olduname(struct linux_old_utsname *up); }
+59     STD             { int linux_sys_olduname(struct linux_old_utsname \
+                          *up); }
 60     NOARGS          { int sys_umask(int newmask); }
 61     NOARGS          { int sys_chroot(char *path); }
 62     UNIMPL          ustat
@@ -198,14 +200,14 @@
                            int cmd, void *arg); }



Home | Main Index | Thread Index | Old Index