lkml.org 
[lkml]   [2000]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] isa_{read,write}{w,l} fixed
Philipp Rumpf wrote:
>
> > I do. And the patch is wrong. Physical addresses are unsigned long. Take the
> > errors as a chance to fix up the types in the driver.
>
> I disagree. A lot of drivers seem to use structs as a cheap way to get
> separate namespaces for their readl() / sbus_readl() offsets, and inconsistent
> behaviour between readb() and isa_readb() (as well as isa_readb() on ARM
> and isa_reab() on x86) would be unnecessarily confusing.

Two key points here --

* isa_xxx are only to ease the transition to newstyle ioremap. if you
are hacking code, go ahead and update it to use
ioremap/readX/writeX/iounmap.

* You can never directly use a struct to access an offset in MMIO
space. To do so is broken and bad bad bad. The only acceptable way is

my_struct = ioremap (...);
my_reg = readb(&my_struct->foo_register);

I much prefer to avoid structs, and use macros to access registers
instead:

my_reg = RTL_R8 (FooRegisterConstant);

Regards,

Jeff




--
Jeff Garzik | "Vegetarian" is the Indian word
Building 1024 | for 'lousy hunter.'
MandrakeSoft, Inc. |
-
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:56    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site