lkml.org 
[lkml]   [2009]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 05/27] asm-generic: add generic io.h
From
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. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
\
 
 \ /
  Last update: 2009-05-04 09:09    [W:1.922 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site