-.\" $OpenBSD: xf86.4,v 1.18 2015/01/15 20:37:36 schwarze Exp $
+.\" $OpenBSD: xf86.4,v 1.19 2015/05/28 20:53:05 jcs Exp $
.\"
.\" Copyright (c) 1998 Matthieu Herrb
.\" All rights reserved.
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: January 15 2015 $
+.Dd $Mdocdate: May 28 2015 $
.Dt XF86 4
.Os
.Sh NAME
has access to the aperture driver can also access part of the kernel
memory.
This mode is not supported on alpha or sparc64.
+.It 3
+the aperture driver allows multiple processes to concurrently access
+.Xr pci 4
+configuration registers and the whole first megabyte of physical memory.
.El
.Sh SEE ALSO
.Xr Xorg 1 ,
-/* $OpenBSD: mem.c,v 1.27 2015/02/10 22:44:35 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.28 2015/05/28 20:53:05 jcs Exp $ */
/* $NetBSD: mem.c,v 1.26 2000/03/29 03:48:20 simonb Exp $ */
/*
/* open counter for aperture */
#ifdef APERTURE
static int ap_open_count = 0;
-static pid_t ap_open_pid = -1;
extern int allowaperture;
#endif
if (suser(p, 0) != 0 || !allowaperture)
return (EPERM);
- /* authorize only one simultaneous open() from the same pid */
- if (ap_open_count > 0 && p->p_pid != ap_open_pid)
+ /* authorize only one simultaneous open() unless
+ * allowaperture=3 */
+ if (ap_open_count > 0 && allowaperture < 3)
return(EPERM);
ap_open_count++;
- ap_open_pid = p->p_pid;
return (0);
#endif
case 12:
{
#ifdef APERTURE
- if (minor(dev) == 4) {
+ if (minor(dev) == 4)
ap_open_count = 0;
- ap_open_pid = -1;
- }
#endif
return (0);
}
-/* $OpenBSD: mem.c,v 1.23 2015/03/14 03:38:46 jsg Exp $ */
+/* $OpenBSD: mem.c,v 1.24 2015/05/28 20:53:05 jcs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
if (suser(p, 0) != 0 || !allowaperture)
return (EPERM);
- /* authorize only one simultaneous open() */
- if (ap_open_count > 0)
+ /* authorize only one simultaneous open() unless
+ * allowaperture=3 */
+ if (ap_open_count > 0 && allowaperture < 3)
return(EPERM);
ap_open_count++;
break;
else
return -1;
case 2:
+ case 3:
/* Allow mapping of the whole 1st megabyte
for x86emu */
if (off <= BIOS_END || !amd64_pa_used(off))
-/* $OpenBSD: mem.c,v 1.13 2015/02/10 22:44:35 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.14 2015/05/28 20:53:05 jcs Exp $ */
/* $NetBSD: mem.c,v 1.11 2003/10/16 12:02:58 jdolecek Exp $ */
/*
if (suser(p, 0) != 0 || !allowaperture)
return (EPERM);
- /* authorize only one simultaneous open() */
- if (ap_open_count > 0)
+ /* authorize only one simultaneous open() unless
+ * allowaperture=3 */
+ if (ap_open_count > 0 && allowaperture < 3)
return(EPERM);
ap_open_count++;
break;
/* $NetBSD: mem.c,v 1.31 1996/05/03 19:42:19 christos Exp $ */
-/* $OpenBSD: mem.c,v 1.43 2015/02/10 22:44:35 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.44 2015/05/28 20:53:05 jcs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
if (suser(p, 0) != 0 || !allowaperture)
return (EPERM);
- /* authorize only one simultaneous open() */
- if (ap_open_count > 0)
+ /* authorize only one simultaneous open() unless
+ * allowaperture=3 */
+ if (ap_open_count > 0 && allowaperture < 3)
return(EPERM);
ap_open_count++;
break;
else
return -1;
case 2:
+ case 3:
/* Allow mapping of the whole 1st megabyte
for x86emu */
if (off <= BIOS_END ||
-/* $OpenBSD: mem.c,v 1.20 2015/02/10 22:44:35 miod Exp $ */
+/* $OpenBSD: mem.c,v 1.21 2015/05/28 20:53:05 jcs Exp $ */
/* $NetBSD: mem.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */
/*
if (suser(p, 0) != 0 || !allowaperture)
return (EPERM);
- /* authorize only one simultaneous open() */
- if (ap_open_count > 0)
+ /* authorize only one simultaneous open() unless
+ * allowaperture=3 */
+ if (ap_open_count > 0 && allowaperture < 3)
return(EPERM);
ap_open_count++;
break;