Jan> Ok, then what IS the proper way of accessing the PCI mem space?
Jan> There are some drivers (drivers/net/dgrs.c for instance) that
Jan> just do:
Jan> ulong *ptr = ioremap(physaddr, 256); ptr[3] = something;
Jan> Others use writel()/readl(), some define their own macros. Is
Jan> there a One True Way?
Jan> Does one need to worry about caching and cache flushing in case
Jan> of PCI mem space? Is that architecture dependent?
Inside the kernel there is one true way and that is readl/writel - you
can get away with direct access if you know that the driver is only
ever going to run on a system with sane PCI mem access. However, this
asumption is not good and readl/writel is strongly recommended (yup I
know some of my code in the current 2.2 tree doesn't but I actually
have updated versions of those drivers ready ;-)
Jes
-
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/