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_phys是物理地址,info->data_buff是线性地址
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是线性地址
![](http://img.zemanta.com/pixy.gif?x-id=dd2c4016-5796-856d-992a-25a4603b77c5)
相关文章推荐
- GDB compile with arm-none-linux-gnueabi Howto
- How to Work with the Network from the Linux Terminal
- How to configure Virtual Network Computing (VNC) to work with Red Hat Enterprise Linux?
- How to install gcc-arm-linux-gnueabihf on Ubuntu 12.04
- How to write a Linux USB Device Driver
- How To Use Linux epoll with Python
- How to Recover an SD Card With Linux
- How to get Expression Encoder to work with the latest Apple QuickTime (7.64.17.0 and greater)
- How to Sync Your Linux Server Time with Network Time Servers (NTP)
- 【译】Linux Ethernet Bonding Driver HOWTO (1)
- How do I set up a Microsoft Visual Studio project to work with MATLAB Compiler 4.0?
- Howto Enable and Use A2DP Sink on Ubuntu Linux with Bluez
- How to build and run ARM Linux on QEMU from scratch
- How to Install ATI/AMD Catalyst 13.4 Linux Driver in Ubuntu 10.04
- Linux Framebuffer Driver Writing HOWTO for 2.2 kernels
- How to Setup Rsync without password with SSH on UNIX / Linux?
- How to work with my desktop and laptop
- How to Get Help With a Command from the Linux Terminal
- How to Locate Web Elements with Selenium WebDriver?