/* * OHCI deals with three types of memory: * - data used only by the HCD ... kmalloc is fine * - async and periodic schedules, shared by HC and HCD ... these * need to use dma_pool or dma_alloc_coherent * - driver buffers, read/written by HC ... the hcd glue or the * device driver provides us with dma addresses * * There's also "register" data, which is memory mapped. * No memory seen by this driver (or any HCD) may be paged out.
*/
staticint ohci_mem_init (struct ohci_hcd *ohci)
{ /* * HCs with local memory allocate from localmem_pool so there's * no need to create the below dma pools.
*/ if (ohci_to_hcd(ohci)->localmem_pool) return 0;
if (hcd->localmem_pool)
td = gen_pool_dma_zalloc_align(hcd->localmem_pool, sizeof(*td), &dma, 32); else
td = dma_pool_zalloc(hc->td_cache, mem_flags, &dma); if (td) { /* in case hc fetches it, make it look dead */
td->hwNextTD = cpu_to_hc32 (hc, dma);
td->td_dma = dma; /* hashed in td_fill */
} return td;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.