aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>2002-09-19 18:56:55 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>2002-09-19 18:56:55 +0000
commit21ed01faf312bd33f6e4eae66e8c8f0c584c03c4 (patch)
treed3bdea9e5c096a1df76fa98db7ed062b6cc4fa95
parente2587e98e548f2949ad4c786abd9c81abdc9e5a9 (diff)
Notes
-rw-r--r--sys/compat/linux/linux_ioctl.c22
-rw-r--r--sys/compat/linux/linux_ioctl.h7
2 files changed, 29 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index 01099dc1caf5f..084d1440a61f4 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
*/
diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h
index 0d77e0d9ed61a..14cfe115d6673 100644
--- a/sys/compat/linux/linux_ioctl.h
+++ b/sys/compat/linux/linux_ioctl.h
@@ -32,6 +32,13 @@
#define _LINUX_IOCTL_H_
/*
+ * NVIDIA driver
+ */
+
+#define LINUX_IOCTL_NVIDIA_MIN 0x4600
+#define LINUX_IOCTL_NVIDIA_MAX 0x46ff
+
+/*
* disk
*/
#define LINUX_BLKROSET 0x125d