All of lore.kernel.org
 help / color / mirror / Atom feed
* Do cpu-endian MMIO accessors exist?
@ 2009-07-21 20:42 Pekka Paalanen
  2009-07-21 20:59 ` Jiri Slaby
  0 siblings, 1 reply; 21+ messages in thread
From: Pekka Paalanen @ 2009-07-21 20:42 UTC (permalink / raw)
  To: linux-kernel

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/

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2009-07-27  5:00 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-21 20:42 Do cpu-endian MMIO accessors exist? Pekka Paalanen
2009-07-21 20:59 ` Jiri Slaby
2009-07-21 21:15   ` Arnd Bergmann
2009-07-21 21:33     ` Christoph Hellwig
2009-07-21 22:01       ` Arnd Bergmann
2009-07-22 17:11         ` Pekka Paalanen
2009-07-22 21:19           ` Arnd Bergmann
2009-07-23 16:23             ` Pekka Paalanen
2009-07-22 21:20           ` Arnd Bergmann
2009-07-21 21:56     ` Jiri Slaby
2009-07-21 22:05       ` Arnd Bergmann
2009-07-22  7:24         ` Jiri Slaby
2009-07-22  7:24           ` Jiri Slaby
2009-07-22  8:35           ` Arnd Bergmann
2009-07-22  8:35             ` Arnd Bergmann
2009-07-22  8:43             ` Alan Cox
2009-07-22  8:43               ` Alan Cox
2009-07-22 13:44               ` Arnd Bergmann
2009-07-22 13:44                 ` Arnd Bergmann
2009-07-27  5:00                 ` Paul Mundt
2009-07-27  5:00                   ` Paul Mundt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.