Re: bus_dmamem_alloc confusion

看板DFBSD_kernel作者時間21年前 (2004/10/23 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串8/9 (看更多)
On Thu, Oct 21, 2004 at 09:50:52PM -0700, Matthew Dillon wrote: > > :Exactly > : > : fdM = open("/dev/mem", O_RDWR); > : ... > : virt = mmap(0, mem.length, > : PROT_READ | PROT_WRITE, > : MAP_PRIVATE | MAP_ANON, > : fdM, > : (off_t)mem.baddr); > : > :where mem.baddr is the physical address passed back by the kernel. > > MAP_PRIVATE? If you intend to write to the memory you definitely > do not want a private mapping, that will do a copy-on-write for any > modifications you make via the map and not actually modify the physical > memory you mapped. Use MAP_SHARED. > > MAP_ANON? That's a contradiction in terms. This isn't anonymous > memory. Don't use MAP_ANON. You 'da man. That was the problem. I wonder why this worked on Free/Net? Thanks again! -- Chuck Tuffli Agilent Technologies
文章代碼(AID): #11UKiF00 (DFBSD_kernel)
討論串 (同標題文章)
文章代碼(AID): #11UKiF00 (DFBSD_kernel)