From cffd5a3eb4a27553e49993b5b6e53361a2729a43 Mon Sep 17 00:00:00 2001 From: Bruce M Simpson Date: Sun, 28 Mar 2004 21:43:27 +0000 Subject: [PATCH] Use the BSD madvise() syscall implementation for Linux binary emulation, instead of treating it as an unimplemented syscall. This appears to make StarOffice 7.0 Linux binaries work according to submitter; also tested with nvidia driver by submitter. Submitted by: Matthias Schuendehuette --- sys/i386/linux/linux_dummy.c | 1 - sys/i386/linux/linux_proto.h | 4 ---- sys/i386/linux/linux_syscall.h | 2 +- sys/i386/linux/linux_sysent.c | 2 +- sys/i386/linux/syscalls.master | 2 +- 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy.c index 67d1b88fe043..0ff2460d71f1 100644 --- a/sys/i386/linux/linux_dummy.c +++ b/sys/i386/linux/linux_dummy.c @@ -69,7 +69,6 @@ DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); DUMMY(mincore); -DUMMY(madvise); DUMMY(fadvise64); #define DUMMY_XATTR(s) \ diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index cd045210bdd4..fec6d4461110 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -631,9 +631,6 @@ struct linux_mincore_args { char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)]; char vec_l_[PADL_(u_char *)]; u_char * vec; char vec_r_[PADR_(u_char *)]; }; -struct linux_madvise_args { - register_t dummy; -}; struct linux_getdents64_args { char fd_l_[PADL_(l_uint)]; l_uint fd; char fd_r_[PADR_(l_uint)]; char dirent_l_[PADL_(void *)]; void * dirent; char dirent_r_[PADR_(void *)]; @@ -833,7 +830,6 @@ int linux_setfsuid(struct thread *, struct linux_setfsuid_args *); int linux_setfsgid(struct thread *, struct linux_setfsgid_args *); int linux_pivot_root(struct thread *, struct linux_pivot_root_args *); int linux_mincore(struct thread *, struct linux_mincore_args *); -int linux_madvise(struct thread *, struct linux_madvise_args *); int linux_getdents64(struct thread *, struct linux_getdents64_args *); int linux_fcntl64(struct thread *, struct linux_fcntl64_args *); int linux_setxattr(struct thread *, struct linux_setxattr_args *); diff --git a/sys/i386/linux/linux_syscall.h b/sys/i386/linux/linux_syscall.h index fd4701af147e..73064d705c05 100644 --- a/sys/i386/linux/linux_syscall.h +++ b/sys/i386/linux/linux_syscall.h @@ -210,7 +210,7 @@ #define LINUX_SYS_linux_setfsgid 216 #define LINUX_SYS_linux_pivot_root 217 #define LINUX_SYS_linux_mincore 218 -#define LINUX_SYS_linux_madvise 219 +#define LINUX_SYS_madvise 219 #define LINUX_SYS_linux_getdents64 220 #define LINUX_SYS_linux_fcntl64 221 #define LINUX_SYS_linux_setxattr 226 diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c index 7cd6b605538f..a9ba557255f7 100644 --- a/sys/i386/linux/linux_sysent.c +++ b/sys/i386/linux/linux_sysent.c @@ -236,7 +236,7 @@ struct sysent linux_sysent[] = { { AS(linux_setfsgid_args), (sy_call_t *)linux_setfsgid }, /* 216 = linux_setfsgid */ { AS(linux_pivot_root_args), (sy_call_t *)linux_pivot_root }, /* 217 = linux_pivot_root */ { AS(linux_mincore_args), (sy_call_t *)linux_mincore }, /* 218 = linux_mincore */ - { 0, (sy_call_t *)linux_madvise }, /* 219 = linux_madvise */ + { SYF_MPSAFE | AS(madvise_args), (sy_call_t *)madvise }, /* 219 = madvise */ { AS(linux_getdents64_args), (sy_call_t *)linux_getdents64 }, /* 220 = linux_getdents64 */ { AS(linux_fcntl64_args), (sy_call_t *)linux_fcntl64 }, /* 221 = linux_fcntl64 */ { 0, (sy_call_t *)nosys }, /* 222 = */ diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index 4e2d338719ca..efb908e75346 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -292,7 +292,7 @@ 216 STD { int linux_setfsgid(l_gid_t gid); } 217 STD { int linux_pivot_root(char *new_root, char *put_old); } 218 STD { int linux_mincore(l_ulong start, l_size_t len, u_char *vec); } -219 STD { int linux_madvise(void); } +219 MNOPROTO { int madvise(void *addr, size_t len, int behav); } 220 STD { int linux_getdents64(l_uint fd, void *dirent, l_uint count); } 221 STD { int linux_fcntl64(l_uint fd, l_uint cmd, l_ulong arg); } 222 UNIMPL