memcpy to access pci memory/ io space
Posted 12-29-2008 at 01: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.
regards,
S.VimalKumar.
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.
regards,
S.VimalKumar.
Total Comments 0