Messages in this thread | | | Date | Tue, 21 Jul 2009 23:42:43 +0300 | From | Pekka Paalanen <> | Subject | Do cpu-endian MMIO accessors exist? |
| |
Hi,
This is for Nouveau, where the hardware is configured to have the same endianess as the cpu. Well, it's configured BE for PPC and LE otherwise.
I'm looking for to drop the following kind of #ifdefs:
#if defined(__powerpc__) static inline u32 nv_rd32(struct drm_device *dev, unsigned reg) { struct drm_nouveau_private *dev_priv = dev->dev_private; return in_be32((void __force __iomem *)dev_priv->mmio->handle + reg); } #else static inline u32 nv_rd32(struct drm_device *dev, unsigned reg) { struct drm_nouveau_private *dev_priv = dev->dev_private; return readl((void __force __iomem *)dev_priv->mmio->handle + reg); } #endif
Please, don't mind about the other ugliness, that will be fixed.
Do cpu-endian MMIO accessors exist? What should I use, or do I just have to use #ifdef __BIG_ENDIAN?
Thanks. Please, Cc me.
-- Pekka Paalanen http://www.iki.fi/pq/
| |