Commit 15280e81 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Miquel Raynal

sparc64: add reads{b,w,l}/writes{b,w,l}

Some drivers need these for compile-testing. On most architectures
they come from asm-generic/io.h, but not on sparc64, which has its
own definitions.

Since we already have ioread*_rep()/iowrite*_rep() that have the
same behavior on sparc64 (i.e. all PCI I/O space is memory mapped),
we can rename the existing helpers and add macros to define them
to the same implementation.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Tested-by: default avatarBoris Brezillon <boris.brezillon@bootlin>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 0bbf47ea
......@@ -243,35 +243,42 @@ void insb(unsigned long, void *, unsigned long);
void insw(unsigned long, void *, unsigned long);
void insl(unsigned long, void *, unsigned long);
static inline void ioread8_rep(void __iomem *port, void *buf, unsigned long count)
static inline void readsb(void __iomem *port, void *buf, unsigned long count)
{
insb((unsigned long __force)port, buf, count);
}
static inline void ioread16_rep(void __iomem *port, void *buf, unsigned long count)
static inline void readsw(void __iomem *port, void *buf, unsigned long count)
{
insw((unsigned long __force)port, buf, count);
}
static inline void ioread32_rep(void __iomem *port, void *buf, unsigned long count)
static inline void readsl(void __iomem *port, void *buf, unsigned long count)
{
insl((unsigned long __force)port, buf, count);
}
static inline void iowrite8_rep(void __iomem *port, const void *buf, unsigned long count)
static inline void writesb(void __iomem *port, const void *buf, unsigned long count)
{
outsb((unsigned long __force)port, buf, count);
}
static inline void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count)
static inline void writesw(void __iomem *port, const void *buf, unsigned long count)
{
outsw((unsigned long __force)port, buf, count);
}
static inline void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count)
static inline void writesl(void __iomem *port, const void *buf, unsigned long count)
{
outsl((unsigned long __force)port, buf, count);
}
#define ioread8_rep(p,d,l) readsb(p,d,l)
#define ioread16_rep(p,d,l) readsw(p,d,l)
#define ioread32_rep(p,d,l) readsl(p,d,l)
#define iowrite8_rep(p,d,l) writesb(p,d,l)
#define iowrite16_rep(p,d,l) writesw(p,d,l)
#define iowrite32_rep(p,d,l) writesl(p,d,l)
/* Valid I/O Space regions are anywhere, because each PCI bus supported
* can live in an arbitrary area of the physical address range.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment