Changeset View
Changeset View
Standalone View
Standalone View
sys/compat/linuxkpi/common/src/linux_compat.c
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
#include <sys/eventhandler.h> | #include <sys/eventhandler.h> | ||||
#include <sys/fcntl.h> | #include <sys/fcntl.h> | ||||
#include <sys/file.h> | #include <sys/file.h> | ||||
#include <sys/filio.h> | #include <sys/filio.h> | ||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/mman.h> | #include <sys/mman.h> | ||||
#include <sys/stack.h> | #include <sys/stack.h> | ||||
#include <sys/sysent.h> | |||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <sys/user.h> | #include <sys/user.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/pmap.h> | #include <vm/pmap.h> | ||||
#include <vm/vm_object.h> | #include <vm/vm_object.h> | ||||
#include <vm/vm_page.h> | #include <vm/vm_page.h> | ||||
#include <vm/vm_pager.h> | #include <vm/vm_pager.h> | ||||
▲ Show 20 Lines • Show All 896 Lines • ▼ Show 20 Lines | if (size > 0) { | ||||
*/ | */ | ||||
task->bsd_ioctl_data = data; | task->bsd_ioctl_data = data; | ||||
task->bsd_ioctl_len = size; | task->bsd_ioctl_len = size; | ||||
data = (void *)LINUX_IOCTL_MIN_PTR; | data = (void *)LINUX_IOCTL_MIN_PTR; | ||||
} else { | } else { | ||||
/* fetch user-space pointer */ | /* fetch user-space pointer */ | ||||
data = *(void **)data; | data = *(void **)data; | ||||
} | } | ||||
#if defined(__amd64__) | #if defined(__amd64__) | ||||
kib: I would also changed this preprocessor check to something along COMPAT_FREEBSD32. I am not… | |||||
if (td->td_proc->p_elf_machine == EM_386) { | if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { | ||||
/* try the compat IOCTL handler first */ | /* try the compat IOCTL handler first */ | ||||
if (fop->compat_ioctl != NULL) { | if (fop->compat_ioctl != NULL) { | ||||
error = -OPW(fp, td, fop->compat_ioctl(filp, | error = -OPW(fp, td, fop->compat_ioctl(filp, | ||||
cmd, (u_long)data)); | cmd, (u_long)data)); | ||||
} else { | } else { | ||||
error = ENOTTY; | error = ENOTTY; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,715 Lines • Show Last 20 Lines |
I would also changed this preprocessor check to something along COMPAT_FREEBSD32. I am not sure what exactly this should be. It is not about FreeBSD COMPAT32 exactly, but it is about executing compat32 ioctl handlers.