Fix a bug exposed by src/sys/vm/vm_mmap.c revision 1.192, devices can't

be mmap(2)'ed MAP_PRIVATE.

Approved by:	eik
This commit is contained in:
Marius Strobl 2004-08-31 15:28:12 +00:00
parent e5d6fe47d0
commit 99b40d715e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=117746
2 changed files with 19 additions and 0 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= afbinit
PORTVERSION= 1.0
PORTREVISION= 1
CATEGORIES= sysutils graphics
MASTER_SITES= ${MASTER_SITE_DEBIAN}
MASTER_SITE_SUBDIR= pool/contrib/a/afbinit

View file

@ -60,6 +60,24 @@ This patch is based on code marked:
if(ucode == NULL) {
fprintf(stderr, "Cannot malloc %d bytes for UCODE.\n",
ucheader.ucode_words << 2);
@@ -236,7 +237,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 +247,7 @@
kregs = mmap(0, 0x2000,
PROT_READ | PROT_WRITE,
- MAP_PRIVATE,
+ MAP_SHARED,
afb_fd,
0x0bc04000);
if (kregs == (void *)-1L) {
@@ -254,14 +255,26 @@
exit(1);
}