> we also need to get rid of bus_to_virt().

Hi Steve!  Haven't forgotten about that.  At the end of this
message is the interface to what I'm working on just now.
As in, coded but not debugged.

This interface sort of combines kmem_cache() options
(flags like SLAB_POISON, GFP_ATOMIC) with the
pci_alloc_consistent() approach.  The routine that would
be used instead of bus_to_virt() currently needs a name
change -- pci_pool_dmamap() doesn't quite cut it.  The
first implementation can't be as functional as the slab
code, but I hope some later version can use this API to
get to some shared code.

Sounds like on MIPS, as on x86, that badly named
function could be in <arch/pci.h> (?) as a macro that
just returns its argument, and all would be well.

The way I currently have it implemented, the cost of
that function on other platforms will be about linear
in the number of pages allocated in that pci_pool.
That's the obvious quick'n'dirty implementation; I'd
gladly see a better one, hashed or otherwise.

- Dave


/*
 * like a pci-consistent kmem_cache_t that aligns (small) memory blocks
 * use pci_alloc_consistent() directly to allocate big (page size) blocks
 */
struct pci_pool;

extern struct pci_pool *
pci_pool_create (const char *name, struct pci_dev *pdev,
  int size, int align, int flags);

extern void
pci_pool_destroy (struct pci_pool *pool);

extern void *
pci_pool_alloc (struct pci_pool *pool, int flags, dma_addr_t *handle);

extern void *
pci_pool_dmamap (struct pci_pool *pool, dma_addr_t handle);

extern void
pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t handle);




_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to