Re: [PATCH 05/27] asm-generic: add generic io.h

Geert Uytterhoeven
2009-05-04T07:07:36Z

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 2920 bytes --]

On Thu, Nov 6, 2008 at 15:38, Arnd Bergmann <arnd@arndb.de> wrote:> --- /dev/null> +++ b/include/asm-generic/io.h
> +static inline void insb(unsigned long addr, void *buffer, int count)> +{> + Â  Â  Â  if (count) {> + Â  Â  Â  Â  Â  Â  Â  u8 *buf = buffer;> + Â  Â  Â  Â  Â  Â  Â  do {> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  u8 x = inb(addr);> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  *buf++ = x;> + Â  Â  Â  Â  Â  Â  Â  } while (--count);> + Â  Â  Â  }> +}> +> +static inline void insw(unsigned long addr, void *buffer, int count)> +{> + Â  Â  Â  if (count) {> + Â  Â  Â  Â  Â  Â  Â  u16 *buf = buffer;> + Â  Â  Â  Â  Â  Â  Â  do {> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  u16 x = inw(addr);> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  *buf++ = x;> + Â  Â  Â  Â  Â  Â  Â  } while (--count);> + Â  Â  Â  }> +}> +> +static inline void insl(unsigned long addr, void *buffer, int count)> +{> + Â  Â  Â  if (count) {> + Â  Â  Â  Â  Â  Â  Â  u32 *buf = buffer;> + Â  Â  Â  Â  Â  Â  Â  do {> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  u32 x = inl(addr);> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  *buf++ = x;> + Â  Â  Â  Â  Â  Â  Â  } while (--count);> + Â  Â  Â  }> +}> +> +static inline void outsb(unsigned long addr, const void *buffer, int count)> +{> + Â  Â  Â  if (count) {> + Â  Â  Â  Â  Â  Â  Â  const u8 *buf = buffer;> + Â  Â  Â  Â  Â  Â  Â  do {> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  outb(*buf++, addr);> + Â  Â  Â  Â  Â  Â  Â  } while (--count);> + Â  Â  Â  }> +}> +> +static inline void outsw(unsigned long addr, const void *buffer, int count)> +{> + Â  Â  Â  if (count) {> + Â  Â  Â  Â  Â  Â  Â  const u16 *buf = buffer;> + Â  Â  Â  Â  Â  Â  Â  do {> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  outw(*buf++, addr);> + Â  Â  Â  Â  Â  Â  Â  } while (--count);> + Â  Â  Â  }> +}> +> +static inline void outsl(unsigned long addr, const void *buffer, int count)> +{> + Â  Â  Â  if (count) {> + Â  Â  Â  Â  Â  Â  Â  const u32 *buf = buffer;> + Â  Â  Â  Â  Â  Â  Â  do {> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  outl(*buf++, addr);> + Â  Â  Â  Â  Â  Â  Â  } while (--count);> + Â  Â  Â  }> +}
Do we ever call these with count == 0?
> +/*> + * Change "struct page" to physical address.> + */
Which `struct page'?
> +static inline void *__ioremap(unsigned long offset, unsigned long size,> + Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  unsigned long flags)> +{> + Â  Â  Â  return (void *) offset;> +}> +> +static inline void *ioremap(unsigned long offset, unsigned long size)> +{> + Â  Â  Â  return (void *) offset;> +}
Gr{oetje,eeting}s,
Geert
--Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. Butwhen I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvaldsÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éÝ¶\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dÊ‡Ú™ë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥