lkml.org 
[lkml]   [2003]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: Memory mapped IO vs Port IO
From
On Fri, Sep 12, 2003 at 09:10:25AM -0700, Anthony Dominic Truong wrote:
> Andi Kleen wrote:
> > #ifdef CONFIG_MMIO
> > writel(... )
> > readl(...)
> > #else
> > outl( ... )
> > inl ( ...)
> > #endif
> >
> > to
> > if (dev->mmio) {
> > writel();
> > real();
> > } else {
> > outl();
> > inl();
> > }
> >
> > and you will have a hard time to benchmark the difference on any non
> > ancient system
> > in actual driver operation.
> >
> > -Andi
> >
> Hello,
> Wouldn't it be better if we set the IN and OUT function pointers to the
> right functions during driver init. based on the setting of dev->mmio.
> And throughout the driver, we just call the IN and OUT functions by
> their pointers. Then we don't have to do if (dev->mmio) every time.
> It's similar to the concept of virtual member function in C++.

I'd rather not see any more pointer dereferences or even branches than
absolutely necessary. Right now, readX/writeX and inX/outX are usually
inlines, and outX and writeX can be very fast. So I'd prefer either a
global CONFIG_MMIO option or consistent driver specific options that
explain what the difference between MMIO and port I/O actually is.

Jesse
-
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:48    [W:0.118 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site