lkml.org 
[lkml]   [2002]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectPCI bus access method
Date
Hi!

I'm curious about which one of the following code
segments is executed faster. They are in an interrupt
handler, the readings and writings are done on the PCI bus.

__u32 tmp;
int i;
for (i=0;i<128;i++) {
tmp=readb(dev->dpmem+i);
if (!tmp) continue;
writeb(0,dev->dpmem+i);
some_code;
}

256 PCI bus access in the worst case, but fewer code

or

__u32 tmp;
int i,j;
char *p=&tmp;
for (i=0;i<128;i+=4) {
tmp=readl(dev->dpmem+i);
if (!tmp) continue;
writel(0, dev->dpmem+i);
for (j=0;j<4;j++)
if (*(p+j)) {
some_code;
}
}

64 PCI bus access in the worst case but more code

Thanks,

Gabor

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

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