您的位置:首页 > 运维架构 > Linux

ARM Linux Driver how to work with DMA

2009-12-24 12:00 459 查看
下面是arm linux中一个申请DMA buffer的例子,DMA需要uncached virtual address space,同时映射的物理内存需要是连续的,所以需要特定的函数来帮助我们。

info->data_buff = dma_alloc_coherent(&pdev->dev, MAX_BUFF_SIZE,
				&info->data_buff_phys, GFP_KERNEL);
	if (info->data_buff == NULL) {
		dev_err(&pdev->dev, "failed to allocate dma buffer/n");
		return -ENOMEM;
	}

其中info->data_buff_phys是物理地址,info->data_buff是线性地址

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: