From 99b40d715ecda6ec745213e0d4406dd08947db01 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Tue, 31 Aug 2004 15:28:12 +0000 Subject: 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 --- sysutils/afbinit/files/patch-afbinit.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'sysutils/afbinit/files') diff --git a/sysutils/afbinit/files/patch-afbinit.c b/sysutils/afbinit/files/patch-afbinit.c index a26aac113849..bc2b2857c452 100644 --- a/sysutils/afbinit/files/patch-afbinit.c +++ b/sysutils/afbinit/files/patch-afbinit.c @@ -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); } -- cgit v1.2.3