Re: bus_dmamem_alloc confusion

看板DFBSD_kernel作者時間21年前 (2004/10/18 03:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/9 (看更多)
: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@backplane.com>
文章代碼(AID): #11SiYp00 (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #11SiYp00 (DFBSD_kernel)