Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux/arch connect madvise(2) and mincore(2) - ap...



details:   https://anonhg.NetBSD.org/src/rev/9553c66a3033
branches:  trunk
changeset: 568806:9553c66a3033
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Aug 01 10:32:40 2004 +0000

description:
connect madvise(2) and mincore(2) - apparently the newer Linux libs
don't stub it anymore, so allow the application to take advantage
of them

the Linux calls appear to be compatible in the flag values and semantics,
so a wrapper is not necessary

diffstat:

 sys/compat/linux/arch/alpha/syscalls.master    |    7 +-
 sys/compat/linux/arch/arm/syscalls.master      |    6 +-
 sys/compat/linux/arch/i386/linux_syscall.h     |    8 +-
 sys/compat/linux/arch/i386/linux_syscallargs.h |  188 +++++++++++++++++++++++-
 sys/compat/linux/arch/i386/linux_syscalls.c    |    8 +-
 sys/compat/linux/arch/i386/linux_sysent.c      |   12 +-
 sys/compat/linux/arch/i386/syscalls.master     |    6 +-
 sys/compat/linux/arch/mips/syscalls.master     |    6 +-
 sys/compat/linux/arch/powerpc/syscalls.master  |    6 +-
 9 files changed, 209 insertions(+), 38 deletions(-)

diffs (truncated from 560 to 300 lines):

diff -r e45d592173e8 -r 9553c66a3033 sys/compat/linux/arch/alpha/syscalls.master
--- a/sys/compat/linux/arch/alpha/syscalls.master       Sun Aug 01 10:19:26 2004 +0000
+++ b/sys/compat/linux/arch/alpha/syscalls.master       Sun Aug 01 10:32:40 2004 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.42 2003/01/18 08:02:46 thorpej Exp $
+       $NetBSD: syscalls.master,v 1.43 2004/08/01 10:36:35 jdolecek Exp $
 ;
 ;      @(#)syscalls.master     8.1 (Berkeley) 7/19/93
 
@@ -179,8 +179,7 @@
 73     NOARGS          { int sys_munmap(void *addr, size_t len); }
 74     STD             { int linux_sys_mprotect(const void *start, \
                            unsigned long len, int prot); }
-; Linux sys_madvise just returns 0.
-75     UNIMPL          madvise
+75     NOARGS          { int sys_madvise(void *addr, size_t len, int behav); }
 76     UNIMPL          vhangup
 77     UNIMPL
 78     UNIMPL
@@ -601,7 +600,7 @@
 372    UNIMPL          getresgid
 373    UNIMPL          sys_dipc
 374    UNIMPL          pivot_root
-375    UNIMPL          mincore
+375    NOARGS          { int sys_mincore(void *addr, size_t len, char *vec); }
 376    UNIMPL          pciconfig_iobase
 377    STD             { int linux_sys_getdents64(int fd, \
                            struct linux_dirent64 *dent, unsigned int count); }
diff -r e45d592173e8 -r 9553c66a3033 sys/compat/linux/arch/arm/syscalls.master
--- a/sys/compat/linux/arch/arm/syscalls.master Sun Aug 01 10:19:26 2004 +0000
+++ b/sys/compat/linux/arch/arm/syscalls.master Sun Aug 01 10:32:40 2004 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.15 2003/08/10 20:16:20 jdolecek Exp $
+       $NetBSD: syscalls.master,v 1.16 2004/08/01 10:32:40 jdolecek Exp $
 
 ; Derived from sys/compat/linux/arch/*/syscalls.master
 ; and from Linux 2.4.12 arch/arm/kernel/calls.S
@@ -373,8 +373,8 @@
 217    STD             { int linux_sys_getdents64(int fd, \
                            struct linux_dirent64 *dent, unsigned int count); }
 218    UNIMPL          pivot_root
-219    UNIMPL          mincore
-220    UNIMPL          madvise
+219    NOARGS          { int sys_mincore(void *addr, size_t len, char *vec); }
+220    NOARGS          { int sys_madvise(void *addr, size_t len, int behav); }
 221    STD             { int linux_sys_fcntl64(int fd, int cmd, void *arg); }
 ; Fill until 256
 222    UNIMPL
diff -r e45d592173e8 -r 9553c66a3033 sys/compat/linux/arch/i386/linux_syscall.h
--- a/sys/compat/linux/arch/i386/linux_syscall.h        Sun Aug 01 10:19:26 2004 +0000
+++ b/sys/compat/linux/arch/i386/linux_syscall.h        Sun Aug 01 10:32:40 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscall.h,v 1.49 2003/08/10 20:17:23 jdolecek Exp $ */
+/* $NetBSD: linux_syscall.h,v 1.50 2004/08/01 10:32:40 jdolecek Exp $ */
 
 /*
  * System call numbers.
@@ -557,6 +557,12 @@
 /* syscall: "getfsuid" ret: "int" args: */
 #define        LINUX_SYS_getfsuid      216
 
+/* syscall: "mincore" ret: "int" args: "void *" "size_t" "char *" */
+#define        LINUX_SYS_mincore       218
+
+/* syscall: "madvise" ret: "int" args: "void *" "size_t" "int" */
+#define        LINUX_SYS_madvise       219
+
 /* syscall: "getdents64" ret: "int" args: "int" "struct linux_dirent64 *" "unsigned int" */
 #define        LINUX_SYS_getdents64    220
 
diff -r e45d592173e8 -r 9553c66a3033 sys/compat/linux/arch/i386/linux_syscallargs.h
--- a/sys/compat/linux/arch/i386/linux_syscallargs.h    Sun Aug 01 10:19:26 2004 +0000
+++ b/sys/compat/linux/arch/i386/linux_syscallargs.h    Sun Aug 01 10:32:40 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_syscallargs.h,v 1.49 2003/08/10 20:17:23 jdolecek Exp $ */
+/* $NetBSD: linux_syscallargs.h,v 1.50 2004/08/01 10:32:40 jdolecek Exp $ */
 
 /*
  * System call argument lists.
@@ -620,185 +620,351 @@
  */
 
 int    linux_sys_nosys(struct lwp *, void *, register_t *);
+
 int    sys_exit(struct lwp *, void *, register_t *);
+
 int    sys_fork(struct lwp *, void *, register_t *);
+
 int    sys_read(struct lwp *, void *, register_t *);
+
 int    sys_write(struct lwp *, void *, register_t *);
+
 int    linux_sys_open(struct lwp *, void *, register_t *);
+
 int    sys_close(struct lwp *, void *, register_t *);
+
 int    linux_sys_waitpid(struct lwp *, void *, register_t *);
+
 int    linux_sys_creat(struct lwp *, void *, register_t *);
+
 int    linux_sys_link(struct lwp *, void *, register_t *);
+
 int    linux_sys_unlink(struct lwp *, void *, register_t *);
+
 int    linux_sys_execve(struct lwp *, void *, register_t *);
+
 int    linux_sys_chdir(struct lwp *, void *, register_t *);
+
 int    linux_sys_time(struct lwp *, void *, register_t *);
+
 int    linux_sys_mknod(struct lwp *, void *, register_t *);
+
 int    linux_sys_chmod(struct lwp *, void *, register_t *);
+
 int    linux_sys_lchown16(struct lwp *, void *, register_t *);
+
 int    linux_sys_break(struct lwp *, void *, register_t *);
+
 int    compat_43_sys_lseek(struct lwp *, void *, register_t *);
+
 int    sys_getpid(struct lwp *, void *, register_t *);
+
 int    sys_setuid(struct lwp *, void *, register_t *);
+
 int    sys_getuid(struct lwp *, void *, register_t *);
+
 int    linux_sys_stime(struct lwp *, void *, register_t *);
+
 int    linux_sys_ptrace(struct lwp *, void *, register_t *);
+
 int    linux_sys_alarm(struct lwp *, void *, register_t *);
+
 int    linux_sys_pause(struct lwp *, void *, register_t *);
+
 int    linux_sys_utime(struct lwp *, void *, register_t *);
+
 int    linux_sys_access(struct lwp *, void *, register_t *);
+
 int    linux_sys_nice(struct lwp *, void *, register_t *);
+
 int    sys_sync(struct lwp *, void *, register_t *);
+
 int    linux_sys_kill(struct lwp *, void *, register_t *);
+
 int    linux_sys_rename(struct lwp *, void *, register_t *);
+
 int    linux_sys_mkdir(struct lwp *, void *, register_t *);
+
 int    linux_sys_rmdir(struct lwp *, void *, register_t *);
+
 int    sys_dup(struct lwp *, void *, register_t *);
+
 int    linux_sys_pipe(struct lwp *, void *, register_t *);
+
 int    linux_sys_times(struct lwp *, void *, register_t *);
+
 int    linux_sys_brk(struct lwp *, void *, register_t *);
+
 int    sys_setgid(struct lwp *, void *, register_t *);
+
 int    sys_getgid(struct lwp *, void *, register_t *);
+
 int    linux_sys_signal(struct lwp *, void *, register_t *);
+
 int    sys_geteuid(struct lwp *, void *, register_t *);
+
 int    sys_getegid(struct lwp *, void *, register_t *);
+
 int    sys_acct(struct lwp *, void *, register_t *);
+
 int    linux_sys_ioctl(struct lwp *, void *, register_t *);
+
 int    linux_sys_fcntl(struct lwp *, void *, register_t *);
+
 int    sys_setpgid(struct lwp *, void *, register_t *);
+
 int    linux_sys_oldolduname(struct lwp *, void *, register_t *);
+
 int    sys_umask(struct lwp *, void *, register_t *);
+
 int    sys_chroot(struct lwp *, void *, register_t *);
+
 int    sys_dup2(struct lwp *, void *, register_t *);
+
 int    sys_getppid(struct lwp *, void *, register_t *);
+
 int    sys_getpgrp(struct lwp *, void *, register_t *);
+
 int    sys_setsid(struct lwp *, void *, register_t *);
+
 int    linux_sys_sigaction(struct lwp *, void *, register_t *);
+
 int    linux_sys_siggetmask(struct lwp *, void *, register_t *);
+
 int    linux_sys_sigsetmask(struct lwp *, void *, register_t *);
+
 int    linux_sys_setreuid16(struct lwp *, void *, register_t *);
+
 int    linux_sys_setregid16(struct lwp *, void *, register_t *);
+
 int    linux_sys_sigsuspend(struct lwp *, void *, register_t *);
+
 int    linux_sys_sigpending(struct lwp *, void *, register_t *);
+
 int    compat_43_sys_sethostname(struct lwp *, void *, register_t *);
+
 int    linux_sys_setrlimit(struct lwp *, void *, register_t *);
+
 int    linux_sys_getrlimit(struct lwp *, void *, register_t *);
+
 int    sys_getrusage(struct lwp *, void *, register_t *);
+
 int    linux_sys_gettimeofday(struct lwp *, void *, register_t *);
+
 int    linux_sys_settimeofday(struct lwp *, void *, register_t *);
+
 int    linux_sys_getgroups16(struct lwp *, void *, register_t *);
+
 int    linux_sys_setgroups16(struct lwp *, void *, register_t *);
+
 int    linux_sys_oldselect(struct lwp *, void *, register_t *);
+
 int    linux_sys_symlink(struct lwp *, void *, register_t *);
+
 int    compat_43_sys_lstat(struct lwp *, void *, register_t *);
+
 int    linux_sys_readlink(struct lwp *, void *, register_t *);
+
 int    linux_sys_uselib(struct lwp *, void *, register_t *);
+
 int    linux_sys_swapon(struct lwp *, void *, register_t *);
+
 int    linux_sys_reboot(struct lwp *, void *, register_t *);
+
 int    linux_sys_readdir(struct lwp *, void *, register_t *);
+
 int    linux_sys_old_mmap(struct lwp *, void *, register_t *);
+
 int    sys_munmap(struct lwp *, void *, register_t *);
+
 int    linux_sys_truncate(struct lwp *, void *, register_t *);
+
 int    compat_43_sys_ftruncate(struct lwp *, void *, register_t *);
+
 int    sys_fchmod(struct lwp *, void *, register_t *);
+
 int    linux_sys_fchown16(struct lwp *, void *, register_t *);
+
 int    sys_getpriority(struct lwp *, void *, register_t *);
+
 int    sys_setpriority(struct lwp *, void *, register_t *);
+
 int    sys_profil(struct lwp *, void *, register_t *);
+
 int    linux_sys_statfs(struct lwp *, void *, register_t *);
+
 int    linux_sys_fstatfs(struct lwp *, void *, register_t *);
+
 int    linux_sys_ioperm(struct lwp *, void *, register_t *);
+
 int    linux_sys_socketcall(struct lwp *, void *, register_t *);
+
 int    sys_setitimer(struct lwp *, void *, register_t *);
+
 int    sys_getitimer(struct lwp *, void *, register_t *);
+
 int    linux_sys_stat(struct lwp *, void *, register_t *);
+
 int    linux_sys_lstat(struct lwp *, void *, register_t *);
+
 int    linux_sys_fstat(struct lwp *, void *, register_t *);
+
 int    linux_sys_olduname(struct lwp *, void *, register_t *);
+
 int    linux_sys_iopl(struct lwp *, void *, register_t *);
+
 int    linux_sys_wait4(struct lwp *, void *, register_t *);
+
 int    linux_sys_swapoff(struct lwp *, void *, register_t *);
+
 int    linux_sys_sysinfo(struct lwp *, void *, register_t *);
+
 int    linux_sys_ipc(struct lwp *, void *, register_t *);
+
 int    sys_fsync(struct lwp *, void *, register_t *);
+
 int    linux_sys_sigreturn(struct lwp *, void *, register_t *);
+
 int    linux_sys_clone(struct lwp *, void *, register_t *);
+
 int    linux_sys_setdomainname(struct lwp *, void *, register_t *);
+
 int    linux_sys_uname(struct lwp *, void *, register_t *);
+
 int    linux_sys_modify_ldt(struct lwp *, void *, register_t *);
+
 int    linux_sys_mprotect(struct lwp *, void *, register_t *);
+
 int    linux_sys_sigprocmask(struct lwp *, void *, register_t *);
+



Home | Main Index | Thread Index | Old Index