Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212992
b: refs/heads/master
c: 35dbc0e
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger authored and Arnd Bergmann committed Oct 18, 2010
1 parent 0c478d4 commit 5da4364
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d852a6afd91fc928128f59ebff381838c365e358
refs/heads/master: 35dbc0e020c6587f78a6c17693beca73aead7b54
26 changes: 26 additions & 0 deletions trunk/include/asm-generic/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#include <asm-generic/iomap.h>
#endif

#ifndef mmiowb
#define mmiowb() do {} while (0)
#endif

/*****************************************************************************/
/*
Expand All @@ -28,39 +30,51 @@
* differently. On the simple architectures, we just read/write the
* memory location directly.
*/
#ifndef __raw_readb
static inline u8 __raw_readb(const volatile void __iomem *addr)
{
return *(const volatile u8 __force *) addr;
}
#endif

#ifndef __raw_readw
static inline u16 __raw_readw(const volatile void __iomem *addr)
{
return *(const volatile u16 __force *) addr;
}
#endif

#ifndef __raw_readl
static inline u32 __raw_readl(const volatile void __iomem *addr)
{
return *(const volatile u32 __force *) addr;
}
#endif

#define readb __raw_readb
#define readw(addr) __le16_to_cpu(__raw_readw(addr))
#define readl(addr) __le32_to_cpu(__raw_readl(addr))

#ifndef __raw_writeb
static inline void __raw_writeb(u8 b, volatile void __iomem *addr)
{
*(volatile u8 __force *) addr = b;
}
#endif

#ifndef __raw_writew
static inline void __raw_writew(u16 b, volatile void __iomem *addr)
{
*(volatile u16 __force *) addr = b;
}
#endif

#ifndef __raw_writel
static inline void __raw_writel(u32 b, volatile void __iomem *addr)
{
*(volatile u32 __force *) addr = b;
}
#endif

#define writeb __raw_writeb
#define writew(b,addr) __raw_writew(__cpu_to_le16(b),addr)
Expand Down Expand Up @@ -122,6 +136,7 @@ static inline void outl(u32 b, unsigned long addr)
#define outw_p(x, addr) outw((x), (addr))
#define outl_p(x, addr) outl((x), (addr))

#ifndef insb
static inline void insb(unsigned long addr, void *buffer, int count)
{
if (count) {
Expand All @@ -132,7 +147,9 @@ static inline void insb(unsigned long addr, void *buffer, int count)
} while (--count);
}
}
#endif

#ifndef insw
static inline void insw(unsigned long addr, void *buffer, int count)
{
if (count) {
Expand All @@ -143,7 +160,9 @@ static inline void insw(unsigned long addr, void *buffer, int count)
} while (--count);
}
}
#endif

#ifndef insl
static inline void insl(unsigned long addr, void *buffer, int count)
{
if (count) {
Expand All @@ -154,7 +173,9 @@ static inline void insl(unsigned long addr, void *buffer, int count)
} while (--count);
}
}
#endif

#ifndef outsb
static inline void outsb(unsigned long addr, const void *buffer, int count)
{
if (count) {
Expand All @@ -164,7 +185,9 @@ static inline void outsb(unsigned long addr, const void *buffer, int count)
} while (--count);
}
}
#endif

#ifndef outsw
static inline void outsw(unsigned long addr, const void *buffer, int count)
{
if (count) {
Expand All @@ -174,7 +197,9 @@ static inline void outsw(unsigned long addr, const void *buffer, int count)
} while (--count);
}
}
#endif

#ifndef outsl
static inline void outsl(unsigned long addr, const void *buffer, int count)
{
if (count) {
Expand All @@ -184,6 +209,7 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
} while (--count);
}
}
#endif

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

0 comments on commit 5da4364

Please sign in to comment.