mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
linux(4): Deduplicate mprotect, madvise
MFC after: 1 week
This commit is contained in:
parent
9636299233
commit
553b1a4e4e
5 changed files with 17 additions and 58 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@
|
|||
#include <compat/linux/linux_emul.h>
|
||||
#include <compat/linux/linux_fork.h>
|
||||
#include <compat/linux/linux_ipc.h>
|
||||
#include <compat/linux/linux_misc.h>
|
||||
#include <compat/linux/linux_mmap.h>
|
||||
#include <compat/linux/linux_signal.h>
|
||||
#include <compat/linux/linux_util.h>
|
||||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@
|
|||
#include <compat/linux/linux_dtrace.h>
|
||||
#include <compat/linux/linux_file.h>
|
||||
#include <compat/linux/linux_mib.h>
|
||||
#include <compat/linux/linux_mmap.h>
|
||||
#include <compat/linux/linux_signal.h>
|
||||
#include <compat/linux/linux_time.h>
|
||||
#include <compat/linux/linux_util.h>
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue