Visit the LQ Articles and Editorials section
Go Back > Blogs > vimalkumar.s
User Name


Rate this Entry

memcpy to access pci memory/ io space

Posted 12-29-2008 at 02:37 AM by vimalkumar.s

Hi everyone,

I am writing linux driver for custom pci module. In various linux device driver books i studied it is mentioned that readb/readw/readl and writeb/writew/writel functions should be used to access pci memory space and inb/outb functions should be used to access pci io space.

I want to do bulk data transfer and also it is time critical. In this case I through instead of using writeb/outb and readb/inb in a for loop it is better to use memcpy() which will avoid a for loop and so reduces the data transfer time.

So, I like to know whether it is advisable to use memcpy() for doing pci memory read/write and in what way readb/inb differs from memcpy().

Thanks in advances for your suggestions.

Posted in Uncategorized
Views 2048 Comments 0
« Prev     Main     Next »
Total Comments 0




All times are GMT -5. The time now is 05:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration