NetBSD Problem Report #1650
From gnats Wed Oct 18 19:21:47 1995
Received: from bloom-beacon.MIT.EDU by pain.lcs.mit.edu (8.6.9/8.6.9) with ESMTP id TAA03130 for <gnats-bugs@gnats.netbsd.org>; Wed, 18 Oct 1995 19:18:07 -0400
Message-Id: <199510182307.TAA01314@pattern.arlington.ma.us>
Date: Wed, 18 Oct 1995 19:07:45 -0400
From: John Kohl <jtk@kolvir.arlington.ma.us>
Reply-To: jtk@kolvir.arlington.ma.us
To: gnats-bugs@gnats.netbsd.org
Subject: i386 libarch man pages need <sys/types.h>
X-Send-Pr-Version: 3.95
>Number: 1650
>Category: lib
>Synopsis: i386 libarch man pages need <sys/types.h>
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: lib-bug-people
>State: closed
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Wed Oct 18 19:35:01 +0000 1995
>Closed-Date: Fri Jan 05 14:51:46 +0000 1996
>Last-Modified: Fri Jan 05 14:59:08 +0000 1996
>Originator: John Kohl
>Release: NetBSD-1.1_ALPHA
>Organization:
NetBSD Kernel Hackers `R` Us
>Environment:
System: NetBSD pattern 1.1_ALPHA NetBSD 1.1_ALPHA (PATTERN) #192: Tue Oct 17 23:54:10 EDT 1995 jtk@pattern:/u1/NetBSD-current/src/sys/arch/i386/compile/PATTERN i386
>Description:
the man pages on i386_* functions in libarch could use a bit of polish.
Suggestions below.
>How-To-Repeat:
Read the pages.
>Fix:
diff -c /usr/src/lib/libarch/i386/i386_get_ioperm.2 lib/libarch/i386/i386_get_ioperm.2
*** /usr/src/lib/libarch/i386/i386_get_ioperm.2 Sun Oct 15 06:24:26 1995
--- lib/libarch/i386/i386_get_ioperm.2 Wed Oct 18 19:04:44 1995
***************
*** 30,36 ****
.\" SUCH DAMAGE.
.\"
.\" from: @(#)fork.2 6.5 (Berkeley) 3/10/91
! .\" $Id: i386_get_ioperm.2,v 1.1 1995/10/15 02:29:09 mycroft Exp $
.\"
.Dd October 14, 1995
.Dt I386_GET_IOPERM 2
--- 30,36 ----
.\" SUCH DAMAGE.
.\"
.\" from: @(#)fork.2 6.5 (Berkeley) 3/10/91
! .\" $NetBSD$
.\"
.Dd October 14, 1995
.Dt I386_GET_IOPERM 2
***************
*** 40,45 ****
--- 40,46 ----
.Nm i386_set_ioperm
.Nd manage i386 per-process I/O permission bitmap
.Sh SYNOPSIS
+ .Fd #include <sys/types.h>
.Fd #include <machine/sysarch.h>
.Ft int
.Fn i386_get_ioperm "u_long *iomap"
***************
*** 54,59 ****
--- 55,74 ----
sets the I/O permission bitmap from the data pointed to by
.Ar iomap .
This call is restricted to the super-user.
+ .Pp
+ The permission bitmap contains
+ 1024
+ bits in 32 longwords.
+ If bit
+ .Va n
+ is clear in the bitmap, then access is granted to I/O port
+ .Va n .
+ If bit
+ .Va n
+ is set in the bitmap, then an attempt to access I/O port
+ .Va n
+ results in delivery of a SIGBUS signal unless the process's I/O
+ permission level would grant I/O access.
.Sh RETURN VALUES
Upon successful completion,
.Fn i386_get_ioperm
***************
*** 76,80 ****
--- 91,106 ----
.It Bq Er EPERM
The caller was not the super-user.
.El
+ .Sh BUGS
+ The bitmap should really cover 65536 bits, but that's just too big for
+ allocation in a kernel structure. If you need access to ports beyond
+ 1024,
+ use
+ .Xr i386_iopl 2 .
+ .Sh SEE ALSO
+ .Xr i386_iopl 2
.Sh REFERENCES
i386 Microprocessor Programmer's Reference Manual, Intel
+ .Sh WARNING
+ You can really hose your machine if you enable user-level I/O and
+ write to hardware ports without care.
diff -c /usr/src/lib/libarch/i386/i386_get_ldt.2 lib/libarch/i386/i386_get_ldt.2
*** /usr/src/lib/libarch/i386/i386_get_ldt.2 Fri Oct 13 20:38:20 1995
--- lib/libarch/i386/i386_get_ldt.2 Wed Oct 18 19:05:11 1995
***************
*** 30,36 ****
.\" SUCH DAMAGE.
.\"
.\" from: @(#)fork.2 6.5 (Berkeley) 3/10/91
! .\" $Id: i386_get_ldt.2,v 1.2 1993/10/09 00:59:10 cgd Exp $
.\"
.Dd September 20, 1993
.Dt I386_GET_LDT 2
--- 30,36 ----
.\" SUCH DAMAGE.
.\"
.\" from: @(#)fork.2 6.5 (Berkeley) 3/10/91
! .\" $NetBSD$
.\"
.Dd September 20, 1993
.Dt I386_GET_LDT 2
***************
*** 40,45 ****
--- 40,46 ----
.Nm i386_set_ldt
.Nd manage i386 per-process Local Descriptor Table entries
.Sh SYNOPSIS
+ .Fd #include <sys/types.h>
.Fd #include <machine/segments.h>
.Fd #include <machine/sysarch.h>
.Ft int
diff -c /usr/src/lib/libarch/i386/i386_iopl.2 lib/libarch/i386/i386_iopl.2
*** /usr/src/lib/libarch/i386/i386_iopl.2 Sun Oct 15 06:24:27 1995
--- lib/libarch/i386/i386_iopl.2 Wed Oct 18 19:04:19 1995
***************
*** 30,36 ****
.\" SUCH DAMAGE.
.\"
.\" from: @(#)fork.2 6.5 (Berkeley) 3/10/91
! .\" $Id: i386_iopl.2,v 1.1 1995/10/15 02:29:11 mycroft Exp $
.\"
.Dd October 14, 1995
.Dt I386_IOPL 2
--- 30,36 ----
.\" SUCH DAMAGE.
.\"
.\" from: @(#)fork.2 6.5 (Berkeley) 3/10/91
! .\" $NetBSD$
.\"
.Dd October 14, 1995
.Dt I386_IOPL 2
***************
*** 39,44 ****
--- 39,45 ----
.Nm i386_iopl
.Nd change the i386 I/O privilege level
.Sh SYNOPSIS
+ .Fd #include <sys/types.h>
.Fd #include <machine/sysarch.h>
.Ft int
.Fn i386_iopl "int iopl"
***************
*** 62,66 ****
--- 63,73 ----
.It Bq Er EPERM
The caller was not the super-user.
.El
+ .Sh SEE ALSO
+ .Xr i386_set_ioperm 2 ,
+ .Xr i386_get_ioperm 2 .
.Sh REFERENCES
i386 Microprocessor Programmer's Reference Manual, Intel
+ .Sh WARNING
+ You can really hose your machine if you enable user-level I/O and
+ write to hardware ports without care.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: pk
State-Changed-When: Fri Jan 5 09:51:46 EST 1996
State-Changed-Why:
Patch applied verbatim:
i386_get_ioperm.2 (v1.2); i386_get_ldt.2 (v1.3); i386_iopl.2 (v1.2);
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.