···474748484949OpenBSD Notes:
5050-Requires a kernel capable of concurrent opening of /dev/xf86, if this is to be
5151-run while X is running. The following patch implements machdep.allowaperture=3
5252-to support this.
5353-5454-Index: arch/amd64/amd64/mem.c
5555-===================================================================
5656-RCS file: /cvs/src/sys/arch/amd64/amd64/mem.c,v
5757-retrieving revision 1.23
5858-diff -u -p -u -p -r1.23 mem.c
5959---- arch/amd64/amd64/mem.c 14 Mar 2015 03:38:46 -0000 1.23
6060-+++ arch/amd64/amd64/mem.c 26 May 2015 02:52:31 -0000
6161-@@ -93,8 +93,9 @@ mmopen(dev_t dev, int flag, int mode, st
6262- if (suser(p, 0) != 0 || !allowaperture)
6363- return (EPERM);
6464-6565-- /* authorize only one simultaneous open() */
6666-- if (ap_open_count > 0)
6767-+ /* authorize only one simultaneous open() unless
6868-+ * allowaperture=3 */
6969-+ if (ap_open_count > 0 && allowaperture < 3)
7070- return(EPERM);
7171- ap_open_count++;
7272- break;
7373-@@ -213,6 +214,7 @@ mmmmap(dev_t dev, off_t off, int prot)
7474- else
7575- return -1;
7676- case 2:
7777-+ case 3:
7878- /* Allow mapping of the whole 1st megabyte
7979- for x86emu */
8080- if (off <= BIOS_END || !amd64_pa_used(off))
5050+Requires a kernel capable of concurrent opening of /dev/xf86, via
5151+machdep.allowaperture=3.
+2-2
intel_mmio.c
···103103#ifdef __OpenBSD__
104104 int ap = open("/dev/xf86", O_RDWR);
105105 if (ap < 0) {
106106- fprintf(stderr, "Couldn't open /dev/xf86: %s\n",
107107- strerror(errno));
106106+ fprintf(stderr, "Couldn't open /dev/xf86: %s "
107107+ "(is machdep.allowaperture=3?)\n", strerror(errno));
108108 exit(1);
109109 }
110110