coherent_dma_mask :用来分配连续一致性dma。 dma_mask:在dma_map_single->dma_map_page,dma_capable用。 先看默认设置。后续可以通过pci_set_dma_mask/pci_set_consistent_dma_mask分别设置 设置: int pci_setup_device(struct pci_dev *dev) { u32 class; u16 cmd; u8 hdr_type; int pos = 0; stru...
这是通过调用 dma_set_mask_and_coherent() 来执行的:: 代码语言:javascript 代码运行次数:0 复制 Cloud Studio代码运行 intdma_set_mask_and_coherent(struct device*dev,u64 mask); 这将为流式 API(streaming )和一致性 API(coherent) 一起设置掩码。 如果您有一些特殊要求,则可以使用以下两个单独的调用来...
int dma_set_mask_and_coherent(struct device *dev, u64 mask); 这将为流式 API 和连贯 API 一起设置掩码。如果您有一些特殊要求,则可以使用以下两个单独的调用来代替:流映射的设置是通过调用 dma_set_mask() 来执行的: int dma_set_mask(struct device *dev, u64 mask); 通过调用 dma_set_coherent...
dma_set_coherent_mask(structdevice *dev, u64 mask) 检查是否可能使用该掩码,并更新设备参数(如果可能)。 返回:如果成功则返回0,否则返回负错误。 u64 dma_get_required_mask(structdevice *dev) 此API返回平台要求的掩码,通常意味着返回的掩码是覆盖所有内存所需的最小掩码。检查所需的掩码使具有可变描述符大...
* Set both the DMA mask and the coherent DMA mask to the same thing. * Note that we don't check the return value from dma_set_coherent_mask() * as the DMA API guarantees that the coherent DMA mask can be set to * the same or smaller than the streaming DMA mask. */ static inli...
dma_mask表示的是该设备通过DMA方式可寻址的物理地址范围,coherent_dma_mask表示所有设备通过DMA方式可寻址的公共的物理地址范围,因为不是所有的硬件设备都能够支持64bit的地址宽度。/include/linux/dma-mapping.h /** Set both the DMA mask and the coherent DMA mask to the same thing.* Note that we don...
dma_mask表示的是该设备通过DMA方式可寻址的物理地址范围,coherent_dma_mask表示所有设备通过DMA方式可寻址的公共的物理地址范围, 因为不是所有的硬件设备都能够支持64bit的地址宽度。 /include/linux/dma-mapping.h /** Set both the DMA mask and the coherent DMA mask to the same thing.* Note that we do...
1、用另外的mask 2、不使用DMA模式,采用普通I/O模式 3、忽略这个设备的存在,不对其进行初始化 一个可以寻址32 bit的设备,其初始化的示例代码如下: if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32))) { dev_warn(dev, "mydev: No suitable DMA available "); ...
| | |--->dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));//64BIT mask:~0ULL | | |if(host->flags & SDHCI_USE_ADMA) { | | |dma_addr_tdma; | | |void*buf; | | |if(!(host->flags & SDHCI_USE_64_BIT_DMA)) |
其中的函数dma_set_mask_and_coherent()用于对dma_mask和coherent_dma_mask赋值。 dma_mask表示的是该设备通过DMA方式可寻址的物理地址范围,coherent_dma_mask表示所有设备通过DMA方式可寻址的公共的物理地址范围, 因为不是所有的硬件设备都能够支持64bit的地址宽度。