diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index 2d2c5bb55ac..7da1dccd6b4 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -97,20 +97,6 @@ linux_mmap2(struct thread *td, struct linux_mmap2_args *args) args->flags, args->fd, args->pgoff)); } -int -linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) -{ - - return (linux_mprotect_common(td, uap->addr, uap->len, uap->prot)); -} - -int -linux_madvise(struct thread *td, struct linux_madvise_args *uap) -{ - - return (linux_madvise_common(td, uap->addr, uap->len, uap->behav)); -} - int linux_iopl(struct thread *td, struct linux_iopl_args *args) { diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index f6b14d8e465..fb088ae37b2 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include @@ -345,20 +344,6 @@ linux_mmap(struct thread *td, struct linux_mmap_args *args) (uint32_t)linux_args.pgoff)); } -int -linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) -{ - - return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, uap->prot)); -} - -int -linux_madvise(struct thread *td, struct linux_madvise_args *uap) -{ - - return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); -} - int linux_iopl(struct thread *td, struct linux_iopl_args *args) { diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c index 9c9d56ca994..b9548387315 100644 --- a/sys/arm64/linux/linux_machdep.c +++ b/sys/arm64/linux/linux_machdep.c @@ -77,21 +77,6 @@ linux_mmap2(struct thread *td, struct linux_mmap2_args *uap) uap->flags, uap->fd, uap->pgoff)); } -int -linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) -{ - - return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, - uap->prot)); -} - -int -linux_madvise(struct thread *td, struct linux_madvise_args *uap) -{ - - return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); -} - int linux_set_cloned_tls(struct thread *td, void *desc) { diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 5e692fea1ea..b9c67d513cd 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -75,6 +75,7 @@ #include #include #include +#include #include #include #include @@ -348,6 +349,22 @@ linux_msync(struct thread *td, struct linux_msync_args *args) args->fl & ~LINUX_MS_SYNC)); } +int +linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) +{ + + return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, + uap->prot)); +} + +int +linux_madvise(struct thread *td, struct linux_madvise_args *uap) +{ + + return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, + uap->behav)); +} + #ifdef LINUX_LEGACY_SYSCALLS int linux_time(struct thread *td, struct linux_time_args *args) diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 8dbcbcd2609..7f1738cda84 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -332,20 +332,6 @@ linux_mmap(struct thread *td, struct linux_mmap_args *args) (uint32_t)linux_args.pgoff)); } -int -linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) -{ - - return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, uap->prot)); -} - -int -linux_madvise(struct thread *td, struct linux_madvise_args *uap) -{ - - return (linux_madvise_common(td, PTROUT(uap->addr), uap->len, uap->behav)); -} - int linux_ioperm(struct thread *td, struct linux_ioperm_args *args) {