Re: PCI question....

Martin Mares (mj@suse.cz)
Thu, 23 Dec 1999 19:51:39 +0100


Hi,

> 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....

(1) You need to use (read|write)[bwl] instead of just dereferencing
a pointer to any PCI memory region.
(2) If the memory region is marked as non-prefetchable, readb/writeb
should generate byte transactions. If it isn't marked as such,
the device is broken.

Have a nice fortnight

-- 
Martin `MJ' Mares <mj@ucw.cz> <mj@suse.cz> http://atrey.karlin.mff.cuni.cz/~mj/
"Outside of a dog, a book is man's best friend. Inside a dog, it's too dark to read."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/