summaryrefslogtreecommitdiffstats
path: root/sys/i386/linux
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2004-03-28 21:43:27 +0000
committerbms <bms@FreeBSD.org>2004-03-28 21:43:27 +0000
commit54410035eae95a97fb17584b66d0b444cc2cc12e (patch)
tree14512ddab3969c97af31189ba5109ee0075d20e8 /sys/i386/linux
parent3709170070ae609614e96ef892496a543fb91483 (diff)
downloadFreeBSD-src-54410035eae95a97fb17584b66d0b444cc2cc12e.zip
FreeBSD-src-54410035eae95a97fb17584b66d0b444cc2cc12e.tar.gz
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
Diffstat (limited to 'sys/i386/linux')
-rw-r--r--sys/i386/linux/linux_dummy.c1
-rw-r--r--sys/i386/linux/linux_proto.h4
-rw-r--r--sys/i386/linux/linux_syscall.h2
-rw-r--r--sys/i386/linux/linux_sysent.c2
-rw-r--r--sys/i386/linux/syscalls.master2
5 files changed, 3 insertions, 8 deletions
diff --git a/sys/i386/linux/linux_dummy.c b/sys/i386/linux/linux_dummy.c
index 67d1b88..0ff2460 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 cd04521..fec6d44 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 fd4701a..73064d7 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 7cd6b60..a9ba557 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 4e2d338..efb908e 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
OpenPOWER on IntegriCloud