bus_dmamem_alloc confusion

Matthew Dillon dillon at apollo.backplane.com
Sun Oct 17 12:12:47 PDT 2004


: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 at xxxxxxxxxxxxx>





More information about the Kernel mailing list