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

Function device_dma_ops

components/drivers/dma/dma_pool.c:237–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235#endif /* RT_USING_OFW */
236
237static const struct rt_dma_map_ops *device_dma_ops(struct rt_device *dev)
238{
239 const struct rt_dma_map_ops *ops = dev->dma_ops;
240
241 if (ops)
242 {
243 return ops;
244 }
245
246#ifdef RT_USING_OFW
247 if (dev->ofw_node && (ops = ofw_device_dma_ops(dev)))
248 {
249 return ops;
250 }
251#endif
252
253 if (rt_dma_device_is_coherent(dev))
254 {
255 ops = &dma_map_coherent_ops;
256 }
257 else
258 {
259 ops = &dma_map_nocoherent_ops;
260 }
261
262 dev->dma_ops = ops;
263
264 return ops;
265}
266
267static rt_ubase_t dma_pool_alloc(struct rt_dma_pool *pool, rt_size_t size)
268{

Callers 4

rt_dma_allocFunction · 0.85
rt_dma_freeFunction · 0.85
rt_dma_sync_out_dataFunction · 0.85
rt_dma_sync_in_dataFunction · 0.85

Calls 2

ofw_device_dma_opsFunction · 0.85

Tested by

no test coverage detected