Commit a9425fb4 authored by Alexander Viro's avatar Alexander Viro Committed by David S. Miller

[SPARC]: Fix I/O accessor routines.

	* insb et.al. first argument is unsigned long, not void * (just look
at their callers).  There _is_ a variant that takes void __iomem *, but that's
ioread8_rep() and its friends.
	* exported the rest of these suckers (insl/outsl already had been).
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 381f1041
...@@ -975,60 +975,66 @@ int pcibios_assign_resource(struct pci_dev *pdev, int resource) ...@@ -975,60 +975,66 @@ int pcibios_assign_resource(struct pci_dev *pdev, int resource)
* We do not use horroble macroses here because we want to * We do not use horroble macroses here because we want to
* advance pointer by sizeof(size). * advance pointer by sizeof(size).
*/ */
void outsb(void * __iomem addr, const void *src, unsigned long count) { void outsb(unsigned long addr, const void *src, unsigned long count)
{
while (count) { while (count) {
count -= 1; count -= 1;
writeb(*(const char *)src, addr); outb(*(const char *)src, addr);
src += 1; src += 1;
addr += 1; /* addr += 1; */
} }
} }
void outsw(void * __iomem addr, const void *src, unsigned long count) { void outsw(unsigned long addr, const void *src, unsigned long count)
{
while (count) { while (count) {
count -= 2; count -= 2;
writew(*(const short *)src, addr); outw(*(const short *)src, addr);
src += 2; src += 2;
addr += 2; /* addr += 2; */
} }
} }
void outsl(void * __iomem addr, const void *src, unsigned long count) { void outsl(unsigned long addr, const void *src, unsigned long count)
{
while (count) { while (count) {
count -= 4; count -= 4;
writel(*(const long *)src, addr); outl(*(const long *)src, addr);
src += 4; src += 4;
addr += 4; /* addr += 4; */
} }
} }
void insb(void * __iomem addr, void *dst, unsigned long count) { void insb(unsigned long addr, void *dst, unsigned long count)
{
while (count) { while (count) {
count -= 1; count -= 1;
*(unsigned char *)dst = readb(addr); *(unsigned char *)dst = inb(addr);
dst += 1; dst += 1;
addr += 1; /* addr += 1; */
} }
} }
void insw(void * __iomem addr, void *dst, unsigned long count) { void insw(unsigned long addr, void *dst, unsigned long count)
{
while (count) { while (count) {
count -= 2; count -= 2;
*(unsigned short *)dst = readw(addr); *(unsigned short *)dst = inw(addr);
dst += 2; dst += 2;
addr += 2; /* addr += 2; */
} }
} }
void insl(void * __iomem addr, void *dst, unsigned long count) { void insl(unsigned long addr, void *dst, unsigned long count)
{
while (count) { while (count) {
count -= 4; count -= 4;
/* /*
* XXX I am sure we are in for an unaligned trap here. * XXX I am sure we are in for an unaligned trap here.
*/ */
*(unsigned long *)dst = readl(addr); *(unsigned long *)dst = inl(addr);
dst += 4; dst += 4;
addr += 4; /* addr += 4; */
} }
} }
......
...@@ -202,6 +202,10 @@ EXPORT_SYMBOL(sbus_ioremap); ...@@ -202,6 +202,10 @@ EXPORT_SYMBOL(sbus_ioremap);
#endif #endif
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
EXPORT_SYMBOL(ebus_chain); EXPORT_SYMBOL(ebus_chain);
EXPORT_SYMBOL(insb);
EXPORT_SYMBOL(outsb);
EXPORT_SYMBOL(insw);
EXPORT_SYMBOL(outsw);
EXPORT_SYMBOL(insl); EXPORT_SYMBOL(insl);
EXPORT_SYMBOL(outsl); EXPORT_SYMBOL(outsl);
EXPORT_SYMBOL(pci_alloc_consistent); EXPORT_SYMBOL(pci_alloc_consistent);
......
...@@ -134,12 +134,12 @@ static inline void __writel(u32 l, volatile void __iomem *addr) ...@@ -134,12 +134,12 @@ static inline void __writel(u32 l, volatile void __iomem *addr)
#define inl_p(__addr) inl(__addr) #define inl_p(__addr) inl(__addr)
#define outl_p(__l, __addr) outl(__l, __addr) #define outl_p(__l, __addr) outl(__l, __addr)
void outsb(void * __iomem addr, const void *src, unsigned long cnt); void outsb(unsigned long addr, const void *src, unsigned long cnt);
void outsw(void * __iomem addr, const void *src, unsigned long cnt); void outsw(unsigned long addr, const void *src, unsigned long cnt);
void outsl(void * __iomem addr, const void *src, unsigned long cnt); void outsl(unsigned long addr, const void *src, unsigned long cnt);
void insb(void * __iomem addr, void *dst, unsigned long count); void insb(unsigned long addr, void *dst, unsigned long count);
void insw(void * __iomem addr, void *dst, unsigned long count); void insw(unsigned long addr, void *dst, unsigned long count);
void insl(void * __iomem addr, void *dst, unsigned long count); void insl(unsigned long addr, void *dst, unsigned long count);
#define IO_SPACE_LIMIT 0xffffffff #define IO_SPACE_LIMIT 0xffffffff
......
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