lkml.org 
[lkml]   [1999]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PCI question....
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/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.038 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site