DragonFly BSD
DragonFly kernel List (threaded) for 2004-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: bus_dmamem_alloc confusion


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 17 Oct 2004 12:10:56 -0700 (PDT)

:This is using the normal kernel slab allocator. The only think specialy
:handled in bus_dmamem_alloc is that it is avoiding page crossing.
:
:> 
:> and for an 8096 byte allocation, the addresses come back
:> 
:> Mem:  k=0xcc6b4000 b=0x14000 a=0x2000
:
:This is using contigmalloc, like all allocations over page size do.
:
:How do you try to mmap the page?
:
:Joerg

    Well, presumably via /dev/mem when given the physical address.  It's 
    usually better (but more complex) to do it via the device mmap API.
    The device can supply ficticious pages for the mapping and you don't
    have to give userland access to the very dangerous /dev/mem.

    But 0x14000 as an address is completely wrong.  If you want to put
    the code up somewhere for me to look at I'll be happy to take a look.
    contigmalloc() should work fine so my guess is that the issue is in how
    you are converting the pages from virtual to physical addresses.

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]