Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 2002 12:19:15 -0700 (PDT)
From:      Doug White <dwhite@resnet.uoregon.edu>
To:        Tom Tang <tangj@cs.ucdavis.edu>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: KLD mmap question
Message-ID:  <20020530121826.D71308-100000@resnet.uoregon.edu>
In-Reply-To: <Pine.LNX.4.33.0205301209280.6101-100000@pc1.cs.ucdavis.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 30 May 2002, Tom Tang wrote:

>   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...

Generally, after the machine is started, memory gets too fragmented to use
contigmalloc.

If you preload the module and do the contigmalloc at attach time it should
succeed.

Doug White                    |  FreeBSD: The Power to Serve
dwhite@resnet.uoregon.edu     |  www.FreeBSD.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020530121826.D71308-100000>