DMA通道:多通道,互斥,使用

DMA, Direct Memory Access,是避开CPU直接处理的方法。

常见的PCIe卡,如网卡, PLX系列解调卡都在使用。

1 网卡,采用ring queue,环形缓冲队列来处理DMA传递上来的数据。这个缓冲,是为了缓冲DMA读上来的数据,以不浪费宝贵的DMA访问时间。即,为了保证DMA不停的去访问网卡,特意对DMA说,数据放我处缓冲,你忙去吧。

2 DMA通道。

DMA通道以编号方式存在,不能同时访问同一个通道[1]。

每个通道都对应一些特定功能。对于PC来说,这是Intel规定的。(FIXME)

例如,声卡用到DMA channel 1 [2]

3 Linux下的DMA通道可以动态分配。(FIXME)

Linux中DMA的定义参考 kernel/dma.h

例如,x86下定义

#define MAX_DMA_CHANNELS	8




参考:

1 http://www.pcguide.com/ref/mbsys/res/dma/funcConflicts-c.html

Like interrupts, DMA channels are single-device resources. If two devices try to usethe same DMA channel at the same time, information will get mixed up between the twodevices trying to use it, and any number of problems can be the result. DMA channelconflicts can be very difficult to diagnose.

2 http://www.pcguide.com/ref/mbsys/res/dma/num.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值