> Question for PCI gurus: Is:
> void mybcopy( char *from, char *to, int amount)
> while ( amount-- )
> *to++ = *from++;
> guaranteed to perform byte transactions on a PCI device? (The device
> at hand doesn't support non-byte tranactions)
> "to" is probably on the PCI device, while "from" is usually in main
> memory, but might be cached closer to the CPU....
I don't claim to be a PCI guru, but...
* If you read a byte immediately after writing a byte, I think
you should be ok.
* Your entire routine above could possibly be replaced with memcpy_toio
* If memcpy_toio doesn't work for you because of some constraints, make
sure you are still using readl() and writel(), NOT direct memory
references. See Documentation/IO-mapping.txt.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to firstname.lastname@example.org
Please read the FAQ at http://www.tux.org/lkml/