diff options
author | msmith <msmith@FreeBSD.org> | 1997-12-15 06:09:11 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1997-12-15 06:09:11 +0000 |
commit | b8788313885de000a82071e85a16dd9da47b8e6e (patch) | |
tree | 846c6fe0b5128fdc83bd9977d37c2a86e9a73788 /sys | |
parent | fc1a3527882f5480b46677a1e8c40d09e9110080 (diff) | |
download | FreeBSD-src-b8788313885de000a82071e85a16dd9da47b8e6e.zip FreeBSD-src-b8788313885de000a82071e85a16dd9da47b8e6e.tar.gz |
As described by the submitter:
These patches enables us to play quake2 .
Support linux keyboard ioctl for setting RAW, MEDIUMRAW and XLATE.
Support linux virtual terminal operations:
OPENQRY, GETMODE, SETMODE, GETSTATE, ACTIVATE, and WAITACTIVE.
Submitted by: Amancio Hasty <hasty@rah.star-gate.com>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/linux/linux.h | 16 | ||||
-rw-r--r-- | sys/compat/linux/linux_ioctl.c | 55 | ||||
-rw-r--r-- | sys/i386/linux/linux.h | 16 | ||||
-rw-r--r-- | sys/i386/linux/linux_ioctl.c | 55 |
4 files changed, 140 insertions, 2 deletions
diff --git a/sys/alpha/linux/linux.h b/sys/alpha/linux/linux.h index ab05ee2..878ffea 100644 --- a/sys/alpha/linux/linux.h +++ b/sys/alpha/linux/linux.h @@ -167,6 +167,14 @@ struct trapframe; #define LINUX_SIG_UNBLOCK 1 #define LINUX_SIG_SETMASK 2 +/* keyboard defines */ +#define LINUX_KDGKBMODE 0x4B44 +#define LINUX_KDSKBMODE 0x4B45 + +#define LINUX_KBD_RAW 0 +#define LINUX_KBD_XLATE 1 +#define LINUX_KBD_MEDIUMRAW 2 + /* termio commands */ #define LINUX_TCGETS 0x5401 #define LINUX_TCSETS 0x5402 @@ -215,6 +223,14 @@ struct trapframe; #define LINUX_TIOCSERSWILD 0x5455 #define LINUX_TIOCGLCKTRMIOS 0x5456 #define LINUX_TIOCSLCKTRMIOS 0x5457 +#define LINUX_VT_OPENQRY 0x5600 +#define LINUX_VT_GETMODE 0x5601 +#define LINUX_VT_SETMODE 0x5602 +#define LINUX_VT_GETSTATE 0x5603 +#define LINUX_VT_ACTIVATE 0x5606 +#define LINUX_VT_WAITACTIVE 0x5607 + + /* arguments for tcflush() and LINUX_TCFLSH */ #define LINUX_TCIFLUSH 0 diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index aa9e844..dfe001d 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_ioctl.c,v 1.21 1997/11/06 19:28:55 phk Exp $ + * $Id: linux_ioctl.c,v 1.22 1997/11/17 04:00:32 ahasty Exp $ */ #include <sys/param.h> @@ -44,6 +44,7 @@ #include <sys/sockio.h> #include <machine/soundcard.h> +#include <machine/console.h> #include <i386/linux/linux.h> #include <i386/linux/linux_proto.h> @@ -836,6 +837,58 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args) } return ioctl(p, (struct ioctl_args *)args); + case LINUX_VT_OPENQRY: + + args->cmd = VT_OPENQRY; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_GETMODE: + + args->cmd = VT_GETMODE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_SETMODE: + + args->cmd = VT_SETMODE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_GETSTATE: + + args->cmd = VT_GETACTIVE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_ACTIVATE: + + args->cmd = VT_ACTIVATE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_WAITACTIVE: + + args->cmd = VT_WAITACTIVE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_KDGKBMODE: + + args->cmd = KDGKBMODE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_KDSKBMODE: + { + int kbdmode; + switch (args->arg) { + case LINUX_KBD_RAW: + kbdmode = K_RAW; + return (*func)(fp, KDSKBMODE, (caddr_t)&kbdmode, p); + case LINUX_KBD_XLATE: + kbdmode = K_XLATE; + return (*func)(fp, KDSKBMODE , (caddr_t)&kbdmode, p); + case LINUX_KBD_MEDIUMRAW: + kbdmode = K_RAW; + return (*func)(fp, KDSKBMODE , (caddr_t)&kbdmode, p); + default: + return EINVAL; + } + } } uprintf("LINUX: 'ioctl' fd=%d, typ=0x%x(%c), num=0x%x not implemented\n", args->fd, (args->cmd&0xffff00)>>8, diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h index ab05ee2..878ffea 100644 --- a/sys/i386/linux/linux.h +++ b/sys/i386/linux/linux.h @@ -167,6 +167,14 @@ struct trapframe; #define LINUX_SIG_UNBLOCK 1 #define LINUX_SIG_SETMASK 2 +/* keyboard defines */ +#define LINUX_KDGKBMODE 0x4B44 +#define LINUX_KDSKBMODE 0x4B45 + +#define LINUX_KBD_RAW 0 +#define LINUX_KBD_XLATE 1 +#define LINUX_KBD_MEDIUMRAW 2 + /* termio commands */ #define LINUX_TCGETS 0x5401 #define LINUX_TCSETS 0x5402 @@ -215,6 +223,14 @@ struct trapframe; #define LINUX_TIOCSERSWILD 0x5455 #define LINUX_TIOCGLCKTRMIOS 0x5456 #define LINUX_TIOCSLCKTRMIOS 0x5457 +#define LINUX_VT_OPENQRY 0x5600 +#define LINUX_VT_GETMODE 0x5601 +#define LINUX_VT_SETMODE 0x5602 +#define LINUX_VT_GETSTATE 0x5603 +#define LINUX_VT_ACTIVATE 0x5606 +#define LINUX_VT_WAITACTIVE 0x5607 + + /* arguments for tcflush() and LINUX_TCFLSH */ #define LINUX_TCIFLUSH 0 diff --git a/sys/i386/linux/linux_ioctl.c b/sys/i386/linux/linux_ioctl.c index aa9e844..dfe001d 100644 --- a/sys/i386/linux/linux_ioctl.c +++ b/sys/i386/linux/linux_ioctl.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux_ioctl.c,v 1.21 1997/11/06 19:28:55 phk Exp $ + * $Id: linux_ioctl.c,v 1.22 1997/11/17 04:00:32 ahasty Exp $ */ #include <sys/param.h> @@ -44,6 +44,7 @@ #include <sys/sockio.h> #include <machine/soundcard.h> +#include <machine/console.h> #include <i386/linux/linux.h> #include <i386/linux/linux_proto.h> @@ -836,6 +837,58 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args) } return ioctl(p, (struct ioctl_args *)args); + case LINUX_VT_OPENQRY: + + args->cmd = VT_OPENQRY; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_GETMODE: + + args->cmd = VT_GETMODE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_SETMODE: + + args->cmd = VT_SETMODE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_GETSTATE: + + args->cmd = VT_GETACTIVE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_ACTIVATE: + + args->cmd = VT_ACTIVATE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_VT_WAITACTIVE: + + args->cmd = VT_WAITACTIVE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_KDGKBMODE: + + args->cmd = KDGKBMODE; + return ioctl(p, (struct ioctl_args *)args); + + case LINUX_KDSKBMODE: + { + int kbdmode; + switch (args->arg) { + case LINUX_KBD_RAW: + kbdmode = K_RAW; + return (*func)(fp, KDSKBMODE, (caddr_t)&kbdmode, p); + case LINUX_KBD_XLATE: + kbdmode = K_XLATE; + return (*func)(fp, KDSKBMODE , (caddr_t)&kbdmode, p); + case LINUX_KBD_MEDIUMRAW: + kbdmode = K_RAW; + return (*func)(fp, KDSKBMODE , (caddr_t)&kbdmode, p); + default: + return EINVAL; + } + } } uprintf("LINUX: 'ioctl' fd=%d, typ=0x%x(%c), num=0x%x not implemented\n", args->fd, (args->cmd&0xffff00)>>8, |