Re: kernel user dma buffers

From: David S. Miller (davem@redhat.com)
Date: Wed Feb 02 2000 - 02:39:22 EST


   Date: Wed, 02 Feb 2000 11:48:01 +1300
   From: david <sector2@ihug.co.nz>

   so i put this in the kernel 2.3.38 init/main.c
           dma.BufferKernAdd = vmalloc( dma.BufferSize ) ;
           dma.BufferPhysAdd = virt_to_phys(dma.BufferKernAdd) ;

It is illegal to try and run virt_to_phys() on vmalloc()'d buffers.
It only works for memory obtained from get_free_page() and kmalloc(),
or via traversal to the physical pages, so you could walk the kernel
page tables to obtain the kernel virtual address of the underlying
physical pages, then run virt_to_bus() on each page obtained from
that scan.

Look at drivers/char/bttv.c, it shows the supported way of performing
what you are trying to do.

Later,
David S. Miller
davem@redhat.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Feb 07 2000 - 21:00:07 EST