Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107601313
D28292.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D28292.diff
View Options
diff --git a/sys/compat/cloudabi/cloudabi_mem.c b/sys/compat/cloudabi/cloudabi_mem.c
--- a/sys/compat/cloudabi/cloudabi_mem.c
+++ b/sys/compat/cloudabi/cloudabi_mem.c
@@ -110,8 +110,14 @@
if (error != 0)
return (error);
- return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags,
- uap->fd, uap->off));
+ return (kern_mmap(td, &(struct mmap_req){
+ .mr_hint = (uintptr_t)uap->addr,
+ .mr_len = uap->len,
+ .mr_prot = prot,
+ .mr_flags = flags,
+ .mr_fd = uap->fd,
+ .mr_pos = uap->off,
+ }));
}
int
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -502,8 +502,14 @@
prot |= PROT_EXEC;
#endif
- return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot,
- uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos)));
+ return (kern_mmap(td, &(struct mmap_req){
+ .mr_hint = (uintptr_t)uap->addr,
+ .mr_len = uap->len,
+ .mr_prot = prot,
+ .mr_flags = uap->flags,
+ .mr_fd = uap->fd,
+ .mr_pos = PAIR32TO64(off_t, uap->pos),
+ }));
}
#ifdef COMPAT_FREEBSD6
@@ -519,8 +525,14 @@
prot |= PROT_EXEC;
#endif
- return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot,
- uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos)));
+ return (kern_mmap(td, &(struct mmap_req){
+ .mr_hint = (uintptr_t)uap->addr,
+ .mr_len = uap->len,
+ .mr_prot = prot,
+ .mr_flags = uap->flags,
+ .mr_fd = uap->fd,
+ .mr_pos = PAIR32TO64(off_t, uap->pos),
+ }));
}
#endif
diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c
--- a/sys/compat/linux/linux_mmap.c
+++ b/sys/compat/linux/linux_mmap.c
@@ -217,12 +217,12 @@
(bsd_flags & MAP_EXCL) == 0) {
mr_fixed = mr;
mr_fixed.mr_flags |= MAP_FIXED | MAP_EXCL;
- error = kern_mmap_req(td, &mr_fixed);
+ error = kern_mmap(td, &mr_fixed);
if (error == 0)
goto out;
}
- error = kern_mmap_req(td, &mr);
+ error = kern_mmap(td, &mr);
out:
LINUX_CTR2(mmap2, "return: %d (%p)", error, td->td_retval[0]);
diff --git a/sys/sys/syscallsubr.h b/sys/sys/syscallsubr.h
--- a/sys/sys/syscallsubr.h
+++ b/sys/sys/syscallsubr.h
@@ -201,12 +201,10 @@
enum uio_seg pathseg, int mode, dev_t dev);
int kern_mlock(struct proc *proc, struct ucred *cred, uintptr_t addr,
size_t len);
-int kern_mmap(struct thread *td, uintptr_t addr, size_t len, int prot,
- int flags, int fd, off_t pos);
+int kern_mmap(struct thread *td, const struct mmap_req *mrp);
int kern_mmap_racct_check(struct thread *td, struct vm_map *map,
vm_size_t size);
int kern_mmap_maxprot(struct proc *p, int prot);
-int kern_mmap_req(struct thread *td, const struct mmap_req *mrp);
int kern_mprotect(struct thread *td, uintptr_t addr, size_t size, int prot);
int kern_msgctl(struct thread *, int, int, struct msqid_ds *);
int kern_msgrcv(struct thread *, int, void *, size_t, long, int, long *);
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -179,8 +179,14 @@
sys_mmap(struct thread *td, struct mmap_args *uap)
{
- return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, uap->prot,
- uap->flags, uap->fd, uap->pos));
+ return (kern_mmap(td, &(struct mmap_req){
+ .mr_hint = (uintptr_t)uap->addr,
+ .mr_len = uap->len,
+ .mr_prot = uap->prot,
+ .mr_flags = uap->flags,
+ .mr_fd = uap->fd,
+ .mr_pos = uap->pos,
+ }));
}
int
@@ -197,23 +203,7 @@
}
int
-kern_mmap(struct thread *td, uintptr_t addr0, size_t len, int prot, int flags,
- int fd, off_t pos)
-{
- struct mmap_req mr = {
- .mr_hint = addr0,
- .mr_len = len,
- .mr_prot = prot,
- .mr_flags = flags,
- .mr_fd = fd,
- .mr_pos = pos
- };
-
- return (kern_mmap_req(td, &mr));
-}
-
-int
-kern_mmap_req(struct thread *td, const struct mmap_req *mrp)
+kern_mmap(struct thread *td, const struct mmap_req *mrp)
{
struct vmspace *vms;
struct file *fp;
@@ -442,9 +432,14 @@
int
freebsd6_mmap(struct thread *td, struct freebsd6_mmap_args *uap)
{
-
- return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, uap->prot,
- uap->flags, uap->fd, uap->pos));
+ return (kern_mmap(td, &(struct mmap_req){
+ .mr_hint = (uintptr_t)uap->addr,
+ .mr_len = uap->len,
+ .mr_prot = uap->prot,
+ .mr_flags = uap->flags,
+ .mr_fd = uap->fd,
+ .mr_pos = uap->pos,
+ }));
}
#endif
@@ -496,8 +491,14 @@
flags |= MAP_PRIVATE;
if (uap->flags & OMAP_FIXED)
flags |= MAP_FIXED;
- return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, flags,
- uap->fd, uap->pos));
+ return (kern_mmap(td, &(struct mmap_req){
+ .mr_hint = (uintptr_t)uap->addr,
+ .mr_len = uap->len,
+ .mr_prot = prot,
+ .mr_flags = flags,
+ .mr_fd = uap->fd,
+ .mr_pos = uap->pos,
+ }));
}
#endif /* COMPAT_43 */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 17, 12:01 PM (19 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15838456
Default Alt Text
D28292.diff (4 KB)
Attached To
Mode
D28292: Replace all uses of kern_mmap with kern_mmap_req
Attached
Detach File
Event Timeline
Log In to Comment