diff options
author | mdodd <mdodd@FreeBSD.org> | 2002-09-19 18:56:55 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2002-09-19 18:56:55 +0000 |
commit | e6b61cc65a3415189321903efbd59dbc346b7fb5 (patch) | |
tree | d3bdea9e5c096a1df76fa98db7ed062b6cc4fa95 /sys/compat/linux/linux_ioctl.c | |
parent | 50d0cbdd14bc33d20a6c6686e125ea32007f7940 (diff) | |
download | FreeBSD-src-e6b61cc65a3415189321903efbd59dbc346b7fb5.zip FreeBSD-src-e6b61cc65a3415189321903efbd59dbc346b7fb5.tar.gz |
This patch extends the FreeBSD Linux compatibility layer to support
NVIDIA API calls; more specifically, it adds an ioctl() handler for
the range of possible NVIDIA ioctl numbers.
Submitted by: Christian Zander <zander@minion.de>
Diffstat (limited to 'sys/compat/linux/linux_ioctl.c')
-rw-r--r-- | sys/compat/linux/linux_ioctl.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 01099dc..084d144 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -68,6 +68,7 @@ static linux_ioctl_function_t linux_ioctl_sound; static linux_ioctl_function_t linux_ioctl_termio; static linux_ioctl_function_t linux_ioctl_private; static linux_ioctl_function_t linux_ioctl_special; +static linux_ioctl_function_t linux_ioctl_nvidia; static struct linux_ioctl_handler cdrom_handler = { linux_ioctl_cdrom, LINUX_IOCTL_CDROM_MIN, LINUX_IOCTL_CDROM_MAX }; @@ -83,6 +84,9 @@ static struct linux_ioctl_handler termio_handler = { linux_ioctl_termio, LINUX_IOCTL_TERMIO_MIN, LINUX_IOCTL_TERMIO_MAX }; static struct linux_ioctl_handler private_handler = { linux_ioctl_private, LINUX_IOCTL_PRIVATE_MIN, LINUX_IOCTL_PRIVATE_MAX }; +static struct linux_ioctl_handler nvidia_handler = +{ linux_ioctl_nvidia, LINUX_IOCTL_NVIDIA_MIN, LINUX_IOCTL_NVIDIA_MAX }; + DATA_SET(linux_ioctl_handler_set, cdrom_handler); DATA_SET(linux_ioctl_handler_set, console_handler); @@ -91,6 +95,7 @@ DATA_SET(linux_ioctl_handler_set, socket_handler); DATA_SET(linux_ioctl_handler_set, sound_handler); DATA_SET(linux_ioctl_handler_set, termio_handler); DATA_SET(linux_ioctl_handler_set, private_handler); +DATA_SET(linux_ioctl_handler_set, nvidia_handler); struct handler_element { @@ -126,6 +131,23 @@ linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args) } /* + * NVIDIA driver + */ + +static int +linux_ioctl_nvidia(struct proc *p, struct linux_ioctl_args *args) +{ + /* + * The range has already been checked, and the native NVIDIA ioctl() + * implementation will throw out any commands it does not recognize. + * There is no good reason why we should manually translate each and + * every one of the possible NVIDIA ioctl() commands. + */ + + return (ioctl(p, (struct ioctl_args *) args)); +} + +/* * termio related ioctls */ |