MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dma_free

Function dma_free

components/drivers/dma/dma_pool.c:387–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385}
386
387static void dma_free(struct rt_device *dev, rt_size_t size,
388 void *cpu_addr, rt_ubase_t dma_handle, rt_ubase_t flags)
389{
390 struct rt_dma_pool *pool;
391
392 region_pool_lock();
393
394 rt_list_for_each_entry(pool, &dma_pool_nodes, list)
395 {
396 if (dma_handle >= pool->region.start &&
397 dma_handle <= pool->region.end)
398 {
399 rt_iounmap(cpu_addr);
400
401 dma_pool_free(pool, dma_handle, size);
402
403 break;
404 }
405 }
406
407 region_pool_unlock();
408}
409
410void *rt_dma_alloc(struct rt_device *dev, rt_size_t size,
411 rt_ubase_t *dma_handle, rt_ubase_t flags)

Callers 2

ofw_dma_map_freeFunction · 0.70
rt_dma_freeFunction · 0.70

Calls 4

region_pool_lockFunction · 0.85
rt_iounmapFunction · 0.85
dma_pool_freeFunction · 0.85
region_pool_unlockFunction · 0.85

Tested by

no test coverage detected