Skip to content

Commit

Permalink
asm-generic/io.h: add reads[bwl]/writes[bwl] helpers
Browse files Browse the repository at this point in the history
A bunch of arches define reads[bwl]/writes[bwl] helpers for accessing
memory mapped registers.  Since the Blackfin ones aren't specific to
Blackfin code, move them to the common asm-generic/io.h for people.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Mike Frysinger committed Jan 10, 2011
1 parent 21aa8ec commit efb2d31
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
30 changes: 0 additions & 30 deletions arch/blackfin/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,36 +158,6 @@ extern void dma_insb(unsigned long port, void *addr, unsigned short count);
extern void dma_insw(unsigned long port, void *addr, unsigned short count);
extern void dma_insl(unsigned long port, void *addr, unsigned short count);

static inline void readsl(const void __iomem *addr, void *buf, int len)
{
insl((unsigned long)addr, buf, len);
}

static inline void readsw(const void __iomem *addr, void *buf, int len)
{
insw((unsigned long)addr, buf, len);
}

static inline void readsb(const void __iomem *addr, void *buf, int len)
{
insb((unsigned long)addr, buf, len);
}

static inline void writesl(const void __iomem *addr, const void *buf, int len)
{
outsl((unsigned long)addr, buf, len);
}

static inline void writesw(const void __iomem *addr, const void *buf, int len)
{
outsw((unsigned long)addr, buf, len);
}

static inline void writesb(const void __iomem *addr, const void *buf, int len)
{
outsb((unsigned long)addr, buf, len);
}

/*
* Map some physical address range into the kernel address space.
*/
Expand Down
30 changes: 30 additions & 0 deletions include/asm-generic/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,36 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
}
#endif

static inline void readsl(const void __iomem *addr, void *buf, int len)
{
insl((unsigned long)addr, buf, len);
}

static inline void readsw(const void __iomem *addr, void *buf, int len)
{
insw((unsigned long)addr, buf, len);
}

static inline void readsb(const void __iomem *addr, void *buf, int len)
{
insb((unsigned long)addr, buf, len);
}

static inline void writesl(const void __iomem *addr, const void *buf, int len)
{
outsl((unsigned long)addr, buf, len);
}

static inline void writesw(const void __iomem *addr, const void *buf, int len)
{
outsw((unsigned long)addr, buf, len);
}

static inline void writesb(const void __iomem *addr, const void *buf, int len)
{
outsb((unsigned long)addr, buf, len);
}

#ifndef CONFIG_GENERIC_IOMAP
#define ioread8(addr) readb(addr)
#define ioread16(addr) readw(addr)
Expand Down

0 comments on commit efb2d31

Please sign in to comment.