From owner-freebsd-hackers Thu May 30 15:18:58 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from gladstone.uoregon.edu (gladstone.uoregon.edu [128.223.142.14]) by hub.freebsd.org (Postfix) with ESMTP id A5A7537B404 for ; Thu, 30 May 2002 15:18:54 -0700 (PDT) Received: from anholt (anholt@d184-101.uoregon.edu [128.223.184.101]) by gladstone.uoregon.edu (8.12.3/8.12.3) with ESMTP id g4UMIrAh017851 for ; Thu, 30 May 2002 15:18:53 -0700 (PDT) Subject: Re: KLD mmap question From: Eric Anholt To: freebsd-hackers@FreeBSD.ORG In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.3 Date: 30 May 2002 16:18:54 -0600 Message-Id: <1022797135.1008.3.camel@anholt.dyndns.org> Mime-Version: 1.0 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 2002-05-30 at 13:14, Tom Tang wrote: > Hello, > > I have a question about implementing mmap functions in > device drivers. Thinking it would be simple, I contigmalloc'd > a buffer of PAGE_SIZE and returned it using atop like other > mmap device implementations. However when my userland program > mmaps the device with offset 0, when I try accessing the returned > pointer, it returns me invalid memory address. Any help would > be appreciated... An associated question: while I was looking at the DRM's mmap for the shared memory area, I think I figured out that you didn't need memory that was going to be mmapped to be physically contiguous (since the device pager would get each page of it separately). Was I right? -- Eric Anholt http://gladstone.uoregon.edu/~eanholt/dri/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message