Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/freebsd32/freebsd32_misc.c
Show First 20 Lines • Show All 496 Lines • ▼ Show 20 Lines | freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap) | ||||
int prot; | int prot; | ||||
prot = uap->prot; | prot = uap->prot; | ||||
#if defined(__amd64__) | #if defined(__amd64__) | ||||
if (i386_read_exec && (prot & PROT_READ)) | if (i386_read_exec && (prot & PROT_READ)) | ||||
prot |= PROT_EXEC; | prot |= PROT_EXEC; | ||||
#endif | #endif | ||||
return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, | return (kern_mmap(td, &(struct mmap_req){ | ||||
uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos))); | .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 | #ifdef COMPAT_FREEBSD6 | ||||
int | int | ||||
freebsd6_freebsd32_mmap(struct thread *td, | freebsd6_freebsd32_mmap(struct thread *td, | ||||
struct freebsd6_freebsd32_mmap_args *uap) | struct freebsd6_freebsd32_mmap_args *uap) | ||||
{ | { | ||||
int prot; | int prot; | ||||
prot = uap->prot; | prot = uap->prot; | ||||
#if defined(__amd64__) | #if defined(__amd64__) | ||||
if (i386_read_exec && (prot & PROT_READ)) | if (i386_read_exec && (prot & PROT_READ)) | ||||
prot |= PROT_EXEC; | prot |= PROT_EXEC; | ||||
#endif | #endif | ||||
return (kern_mmap(td, (uintptr_t)uap->addr, uap->len, prot, | return (kern_mmap(td, &(struct mmap_req){ | ||||
uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos))); | .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 | #endif | ||||
int | int | ||||
freebsd32_setitimer(struct thread *td, struct freebsd32_setitimer_args *uap) | freebsd32_setitimer(struct thread *td, struct freebsd32_setitimer_args *uap) | ||||
{ | { | ||||
struct itimerval itv, oitv, *itvp; | struct itimerval itv, oitv, *itvp; | ||||
struct itimerval32 i32; | struct itimerval32 i32; | ||||
▲ Show 20 Lines • Show All 3,302 Lines • Show Last 20 Lines |