This changes the mmap() of the card's registers to use MAP_SHARED rather
than MAP_PRIVATE, derived from:

http://www.freebsd.org/cgi/getmsg.cgi?fetch=974795+0+/usr/local/www/db/text/2004/cvs-all/20040905.cvs-all
http://www.freebsd.org/cgi/cvsweb.cgi/ports/sysutils/afbinit/files/patch-afbinit.c.diff?r1=1.1&r2=1.2

Apparently, somewhere between 2.6.12 and 2.6.15, there was a similar
change in the Linux kernel...

Compiles, tested, and I'm currently running an Elite3D-m6 setup with
this.
--- afbinit-1.0/afbinit.c       2001-11-29 21:04:21.000000000 -0500
+++ afbinit-1.0-SHARED/afbinit.c        2006-01-15 17:27:03.000000000 -0500
@@ -236,7 +236,7 @@
        /* MMAP the registers. */
        uregs = mmap(0, 0x2000,
                     PROT_READ | PROT_WRITE,
-                    MAP_PRIVATE,
+                    MAP_SHARED,
                     afb_fd,
                     0x04000000);
        if (uregs == (void *)-1L) {
@@ -246,7 +246,7 @@
 
        kregs = mmap(0, 0x2000,
                     PROT_READ | PROT_WRITE,
-                    MAP_PRIVATE,
+                    MAP_SHARED,
                     afb_fd,
                     0x0bc04000);
        if (kregs == (void *)-1L) {

Reply via email to