xref: /freebsd/lib/libsys/i386/i386_get_ioperm.2 (revision 4bc66c0f9f2c349af86cbf4e77f000b49d819fea)
1*4bc66c0fSBrooks Davis.\" Copyright (c) 1998 Jonathan Lemon
2*4bc66c0fSBrooks Davis.\" All rights reserved.
3*4bc66c0fSBrooks Davis.\"
4*4bc66c0fSBrooks Davis.\" Redistribution and use in source and binary forms, with or without
5*4bc66c0fSBrooks Davis.\" modification, are permitted provided that the following conditions
6*4bc66c0fSBrooks Davis.\" are met:
7*4bc66c0fSBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
8*4bc66c0fSBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
9*4bc66c0fSBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
10*4bc66c0fSBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
11*4bc66c0fSBrooks Davis.\"    documentation and/or other materials provided with the distribution.
12*4bc66c0fSBrooks Davis.\"
13*4bc66c0fSBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14*4bc66c0fSBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*4bc66c0fSBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*4bc66c0fSBrooks Davis.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17*4bc66c0fSBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*4bc66c0fSBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*4bc66c0fSBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*4bc66c0fSBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*4bc66c0fSBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*4bc66c0fSBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*4bc66c0fSBrooks Davis.\" SUCH DAMAGE.
24*4bc66c0fSBrooks Davis.\"
25*4bc66c0fSBrooks Davis.Dd July 27, 1998
26*4bc66c0fSBrooks Davis.Dt I386_GET_IOPERM 2
27*4bc66c0fSBrooks Davis.Os
28*4bc66c0fSBrooks Davis.Sh NAME
29*4bc66c0fSBrooks Davis.Nm i386_get_ioperm ,
30*4bc66c0fSBrooks Davis.Nm i386_set_ioperm
31*4bc66c0fSBrooks Davis.Nd manage per-process access to the i386 I/O port space
32*4bc66c0fSBrooks Davis.Sh LIBRARY
33*4bc66c0fSBrooks Davis.Lb libc
34*4bc66c0fSBrooks Davis.Sh SYNOPSIS
35*4bc66c0fSBrooks Davis.In machine/sysarch.h
36*4bc66c0fSBrooks Davis.Ft int
37*4bc66c0fSBrooks Davis.Fn i386_get_ioperm "unsigned int start" "unsigned int *length" "int *enable"
38*4bc66c0fSBrooks Davis.Ft int
39*4bc66c0fSBrooks Davis.Fn i386_set_ioperm "unsigned int start" "unsigned int length" "int enable"
40*4bc66c0fSBrooks Davis.Sh DESCRIPTION
41*4bc66c0fSBrooks DavisThe
42*4bc66c0fSBrooks Davis.Fn i386_get_ioperm
43*4bc66c0fSBrooks Davissystem call
44*4bc66c0fSBrooks Daviswill return the permission for the process' I/O port space in the
45*4bc66c0fSBrooks Davis.Fa *enable
46*4bc66c0fSBrooks Davisargument.
47*4bc66c0fSBrooks DavisThe port range starts at
48*4bc66c0fSBrooks Davis.Fa start
49*4bc66c0fSBrooks Davisand the number of contiguous entries will be returned in
50*4bc66c0fSBrooks Davis.Fa *length .
51*4bc66c0fSBrooks Davis.Pp
52*4bc66c0fSBrooks DavisThe
53*4bc66c0fSBrooks Davis.Fn i386_set_ioperm
54*4bc66c0fSBrooks Davissystem call
55*4bc66c0fSBrooks Daviswill set access to a range of I/O ports described by the
56*4bc66c0fSBrooks Davis.Fa start
57*4bc66c0fSBrooks Davisand
58*4bc66c0fSBrooks Davis.Fa length
59*4bc66c0fSBrooks Davisarguments to the state specified by the
60*4bc66c0fSBrooks Davis.Fa enable
61*4bc66c0fSBrooks Davisargument.
62*4bc66c0fSBrooks Davis.Sh RETURN VALUES
63*4bc66c0fSBrooks Davis.Rv -std
64*4bc66c0fSBrooks Davis.Sh ERRORS
65*4bc66c0fSBrooks DavisThe
66*4bc66c0fSBrooks Davis.Fn i386_get_ioperm
67*4bc66c0fSBrooks Davisand
68*4bc66c0fSBrooks Davis.Fn i386_set_ioperm
69*4bc66c0fSBrooks Davissystem calls
70*4bc66c0fSBrooks Daviswill fail if:
71*4bc66c0fSBrooks Davis.Bl -tag -width Er
72*4bc66c0fSBrooks Davis.It Bq Er EINVAL
73*4bc66c0fSBrooks DavisAn invalid range was specified by the
74*4bc66c0fSBrooks Davis.Fa start
75*4bc66c0fSBrooks Davisor
76*4bc66c0fSBrooks Davis.Fa length
77*4bc66c0fSBrooks Davisarguments.
78*4bc66c0fSBrooks Davis.It Bq Er EPERM
79*4bc66c0fSBrooks DavisThe caller of i386_set_ioperm was not the superuser.
80*4bc66c0fSBrooks Davis.El
81*4bc66c0fSBrooks Davis.Sh SEE ALSO
82*4bc66c0fSBrooks Davis.Xr io 4
83*4bc66c0fSBrooks Davis.Sh AUTHORS
84*4bc66c0fSBrooks DavisThis man page was written by
85*4bc66c0fSBrooks Davis.An Jonathan Lemon .
86