freebsd-dev/lib/libc/i386/sys/i386_vm86.2

142 lines
4.0 KiB
Groff
Raw Normal View History

1998-07-28 03:39:04 +00:00
.\" Copyright (c) 1998 Jonathan Lemon
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
1999-08-28 00:22:10 +00:00
.\" $FreeBSD$
1998-07-28 03:39:04 +00:00
.\"
.Dd July 27, 1998
.Os
.Dt I386_VM86 2
.Sh NAME
.Nm i386_vm86
.Nd control vm86-related functions
.Sh LIBRARY
.Lb libc
1998-07-28 03:39:04 +00:00
.Sh SYNOPSIS
.In sys/types.h
.In machine/sysarch.h
.In machine/vm86.h
1998-07-28 03:39:04 +00:00
.Ft int
.Fn i386_vm86 "int function" "void *data"
.Sh DESCRIPTION
2002-12-18 12:39:25 +00:00
The
1998-07-28 03:39:04 +00:00
.Fn i386_vm86
2002-12-18 12:39:25 +00:00
system call
1998-07-28 03:39:04 +00:00
is used to call various vm86 related functions.
2002-12-19 09:40:28 +00:00
The
1998-07-28 03:39:04 +00:00
.Fa function
2002-12-19 09:40:28 +00:00
argument
1998-07-28 03:39:04 +00:00
can be one of the following values:
.Bl -tag -offset indent -width VM86_SET_VME
.It Dv VM86_INIT
This will initialize the kernel's vm86 parameter area for the
process, and permit the process to make vm86 calls.
2002-12-19 09:40:28 +00:00
The
1998-07-28 03:39:04 +00:00
.Fa data
2002-12-19 09:40:28 +00:00
argument
1998-07-28 03:39:04 +00:00
points to the following structure:
.Bd -literal
struct vm86_init_args {
int debug;
int cpu_type;
u_char int_map[32];
};
.Ed
.Pp
2002-12-19 09:40:28 +00:00
The
1998-07-28 03:39:04 +00:00
.Fa debug
2002-12-19 09:40:28 +00:00
argument
1998-07-28 03:39:04 +00:00
is used to turn on debugging code.
2002-12-19 09:40:28 +00:00
The
1998-07-28 03:39:04 +00:00
.Fa cpu_type
2002-12-19 09:40:28 +00:00
argument
1998-07-28 03:39:04 +00:00
controls the type of CPU being emulated, and is currently unimplemented.
2002-12-19 09:40:28 +00:00
The
1998-07-28 03:39:04 +00:00
.Fa int_map
2002-12-19 09:40:28 +00:00
argument
1998-07-28 03:39:04 +00:00
is a bitmap which determines whether vm86 interrupts should be handled
in vm86 mode, or reflected back to the process.
If the
1998-07-28 03:39:04 +00:00
.Em Nth
bit is set, the interrupt will be reflected to the process, otherwise
it will be dispatched by the vm86 interrupt table.
.It Dv VM86_INTCALL
This allows calls to be made to vm86 interrupt handlers by the process.
It effectively simulates an INT instruction.
.Fa data
should point to the following structure:
.Bd -literal
struct vm86_intcall_args {
int intnum;
struct vm86frame vmf;
};
.Ed
.Pp
.Fa intnum
specifies the operand of INT for the simulated call.
A value of 0x10, for example, would often be used to call into the VGA BIOS.
.Fa vmf
is used to initialize CPU registers according to the calling convention for
the interrupt handler.
.It Dv VM86_GET_VME
This is used to retrieve the current state of the Pentium(r) processor's
VME (Virtual-8086 Mode Extensions) flag, which is bit 0 of CR4.
.Fa data
should be initialized to point to the following:
.Bd -literal
struct vm86_vme_args {
int state; /* status */
};
.Ed
.Pp
.Fa state
will contain the state of the VME flag on return.
.\" .It Dv VM86_SET_VME
1998-07-28 03:39:04 +00:00
.El
.Pp
2001-07-15 07:53:42 +00:00
vm86 mode is entered by calling
1998-07-28 03:39:04 +00:00
.Xr sigreturn 2
with the correct machine context for vm86, and with the
.Dv PSL_VM
bit set.
Control returns to the process upon delivery of a signal.
1998-07-28 03:39:04 +00:00
.Sh RETURN VALUES
.Rv -std i386_vm86
1998-07-28 03:39:04 +00:00
.Sh ERRORS
2002-12-18 12:39:25 +00:00
The
1998-07-28 03:39:04 +00:00
.Fn i386_vm86
2002-12-18 12:39:25 +00:00
system call
1998-07-28 03:39:04 +00:00
will fail if:
.Bl -tag -width Er
1998-07-28 03:39:04 +00:00
.It Bq Er EINVAL
The kernel does not have vm86 support, or an invalid function was specified.
.It Bq Er ENOMEM
There is not enough memory to initialize the kernel data structures.
2000-12-29 14:08:20 +00:00
.El
1998-07-28 03:39:04 +00:00
.Sh AUTHORS
.An -nosplit
1998-07-28 03:39:04 +00:00
This man page was written by
.An Jonathan Lemon ,
and updated by
.An Bruce M Simpson .