Date: Thu, 19 Dec 1996 23:31:06 -0800 From: Amancio Hasty <hasty@rah.star-gate.com> To: Terry Lambert <terry@lambert.org> Cc: hackers@freebsd.org, multimedia@freebsd.org Subject: Re: mmap problems? Message-ID: <199612200731.XAA05257@rah.star-gate.com> In-Reply-To: Your message of "Thu, 19 Dec 1996 10:10:33 MST." <199612191710.KAA11716@phaeton.artisoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, Well, I noticed that "tv" manages to map successfully all the required memory. The mmap debugging output looks the same for every run including including the run in which tv fails to run due to not all the pages being mapped in. Regards, 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612200731.XAA05257>