Commit 7387be3373277005c171b9f1509e91fae2e430f3
Committed by
Linus Torvalds
1 parent
7833e7c961
Exists in
master
and in
7 other branches
asm-generic/io.h: add big endian versions of io{read,write}{16,32}
The asm-generic/iomap.h provides these functions already, but the non-generic fallback defines do not. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff
include/asm-generic/io.h
... | ... | @@ -188,11 +188,15 @@ |
188 | 188 | #ifndef CONFIG_GENERIC_IOMAP |
189 | 189 | #define ioread8(addr) readb(addr) |
190 | 190 | #define ioread16(addr) readw(addr) |
191 | +#define ioread16be(addr) be16_to_cpu(ioread16(addr)) | |
191 | 192 | #define ioread32(addr) readl(addr) |
193 | +#define ioread32be(addr) be32_to_cpu(ioread32(addr)) | |
192 | 194 | |
193 | 195 | #define iowrite8(v, addr) writeb((v), (addr)) |
194 | 196 | #define iowrite16(v, addr) writew((v), (addr)) |
197 | +#define iowrite16be(v, addr) iowrite16(be16_to_cpu(v), (addr)) | |
195 | 198 | #define iowrite32(v, addr) writel((v), (addr)) |
199 | +#define iowrite32be(v, addr) iowrite32(be32_to_cpu(v), (addr)) | |
196 | 200 | |
197 | 201 | #define ioread8_rep(p, dst, count) \ |
198 | 202 | insb((unsigned long) (p), (dst), (count)) |