mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
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>
This commit is contained in:
parent
e2587e98e5
commit
21ed01faf3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103651
@ -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
|
||||
{
|
||||
@ -125,6 +130,23 @@ linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args)
|
||||
return (ENOIOCTL);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
@ -31,6 +31,13 @@
|
||||
#ifndef _LINUX_IOCTL_H_
|
||||
#define _LINUX_IOCTL_H_
|
||||
|
||||
/*
|
||||
* NVIDIA driver
|
||||
*/
|
||||
|
||||
#define LINUX_IOCTL_NVIDIA_MIN 0x4600
|
||||
#define LINUX_IOCTL_NVIDIA_MAX 0x46ff
|
||||
|
||||
/*
|
||||
* disk
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user