int ddi_dma_mem_alloc(ddi_dma_handle_t handle, size_t length,
ddi_device_acc_attr_t *accattrp, uint_t flags,
int (*waitfp) (caddr_t), caddr_t arg, caddr_t *kaddrp,
size_t *real_length, ddi_acc_handle_t *handlep);
ddi_dma_mem_alloc needs a dma handle. But I can't get a dma handle any way.
Actually, I need the pages to build the page tables used to translate
the guest io address to the virtual io address.
On Dec 2, 2007 5:47 PM, Michael Li <[EMAIL PROTECTED]> wrote:
> Baolu Lu 写道:
>
> > Hi,
> >
> > How can I allocate a locked page in the driver? The kmem_allocate
> > interface can't guarantee the physical continuity on that large. I
> > searched the kernel source tree, and some drivers, such as the ramdisk
> > driver, have some functions to allocate a hole page. But, does the
> > Solaris kernel has an interface to allocate a page? Or, if I want one,
> > what are the general steps to allocate? And, which interfaces should
> > be used?
> >
> > Thanks,
> > Allen
> > _______________________________________________
> > driver-discuss mailing list
> > [email protected]
> > http://mail.opensolaris.org/mailman/listinfo/driver-discuss
> >
> One way is to use ddi_dma_mem_alloc(9F). You can easily find the example
> code in NIC/WiFi driver.
>
> - Michael
>
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss