From owner-freebsd-hackers Fri Dec 20 00:19:35 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id AAA10862 for hackers-outgoing; Fri, 20 Dec 1996 00:19:35 -0800 (PST) Received: from rah.star-gate.com ([204.188.121.18]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id AAA10755; Fri, 20 Dec 1996 00:18:11 -0800 (PST) Received: from rah.star-gate.com (localhost.star-gate.com [127.0.0.1]) by rah.star-gate.com (8.7.6/8.7.3) with ESMTP id AAA05455; Fri, 20 Dec 1996 00:16:39 -0800 (PST) Message-Id: <199612200816.AAA05455@rah.star-gate.com> X-Mailer: exmh version 1.6.9 8/22/96 To: Terry Lambert cc: hackers@freebsd.org, multimedia@freebsd.org Subject: Re: mmap problems? In-reply-to: Your message of "Thu, 19 Dec 1996 10:10:33 MST." <199612191710.KAA11716@phaeton.artisoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 20 Dec 1996 00:16:39 -0800 From: Amancio Hasty Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk More info, After the mmap call from tv to the meteor driver , the system upon a page fault calls the meteor's mmap routine or rather the first time that I access the mmapped region. When tv fails to run, the call to mmap is successfull however the system only calls back the meteor's mmap routine once for the first page. Does this make sense to anyone out there ? Tnks, Amancio >From The Desk Of Terry Lambert : > > > You'll have to look carefully at the driver to see which is happening > > > (if either is the correct reason). > > [ ... ] > > Well, I did say "if". > > Personally, I'd: > > meteor_mmap(dev_t dev, int offset, int nprot) > { > > int unit; > meteor_reg_t *mtr; > > unit = UNIT(minor(dev)); > printf( "meteor_mmap: unit=%d of %d, offset=%d, nprot=%08x\n", > unit, NMETEOR, offset, nprot); > if (unit >= NMETEOR) /* at this point could this happen? * / > { > printf( "meteor_mmap: failed: unit exceeded possible units\n"); > return(-1); > } > > mtr = &(meteor[unit]); > > > if(nprot & PROT_EXEC) > { > printf("meteor_mmap: can't map a device PROT_EXEC!\n"); > return -1; > } > > printf("meteor_mmap: device pages(%08x)\n", mtr->alloc_pages * page_size); > if(offset >= mtr->alloc_pages * PAGE_SIZE) > { > printf("meteor_mmap: offset (%08x) exceeds device pages\n", offset); > return -1; > } > > return i386_btop(vtophys(mtr->bigbuf) + offset); > } > > This leaves a possible failure of (vtophys() + offset) to be valid; > you can check that, but it's unlikely (the pages are wired). > > > Terry Lambert > terry@lambert.org > --- > Any opinions in this posting are my own and not those of my present > or previous employers.