lkml.org 
[lkml]   [1999]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PCI question....


On Thu, 23 Dec 1999, Rogier Wolff wrote:

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

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

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

Regards,

Jeff





-
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.049 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site