mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-16 14:02:10 +00:00
sparc64: update IO access functions in PeeCeeI
The PeeCeeI.c code used in*() + out*() for IO access. But these are in little endian and the native (big) endian result was required which resulted in some bit-shifting. Shift the code over to use the __raw_*() variants all over. This simplifies the code as we can drop the calls to le16_to_cpu() and le32_to_cpu(). And it should be a little faster too. With this change we now uses the same type of IO access functions in all of the file. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d650471a39
commit
6b8b5507ed
@ -15,7 +15,7 @@ void outsb(unsigned long __addr, const void *src, unsigned long count)
|
|||||||
const u8 *p = src;
|
const u8 *p = src;
|
||||||
|
|
||||||
while (count--)
|
while (count--)
|
||||||
outb(*p++, addr);
|
__raw_writeb(*p++, addr);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(outsb);
|
EXPORT_SYMBOL(outsb);
|
||||||
|
|
||||||
@ -93,21 +93,21 @@ void insb(unsigned long __addr, void *dst, unsigned long count)
|
|||||||
u8 *pb = dst;
|
u8 *pb = dst;
|
||||||
|
|
||||||
while ((((unsigned long)pb) & 0x3) && count--)
|
while ((((unsigned long)pb) & 0x3) && count--)
|
||||||
*pb++ = inb(addr);
|
*pb++ = __raw_readb(addr);
|
||||||
pi = (u32 *)pb;
|
pi = (u32 *)pb;
|
||||||
while (count >= 4) {
|
while (count >= 4) {
|
||||||
u32 w;
|
u32 w;
|
||||||
|
|
||||||
w = (inb(addr) << 24);
|
w = (__raw_readb(addr) << 24);
|
||||||
w |= (inb(addr) << 16);
|
w |= (__raw_readb(addr) << 16);
|
||||||
w |= (inb(addr) << 8);
|
w |= (__raw_readb(addr) << 8);
|
||||||
w |= (inb(addr) << 0);
|
w |= (__raw_readb(addr) << 0);
|
||||||
*pi++ = w;
|
*pi++ = w;
|
||||||
count -= 4;
|
count -= 4;
|
||||||
}
|
}
|
||||||
pb = (u8 *)pi;
|
pb = (u8 *)pi;
|
||||||
while (count--)
|
while (count--)
|
||||||
*pb++ = inb(addr);
|
*pb++ = __raw_readb(addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(insb);
|
EXPORT_SYMBOL(insb);
|
||||||
@ -121,21 +121,21 @@ void insw(unsigned long __addr, void *dst, unsigned long count)
|
|||||||
u32 *pi;
|
u32 *pi;
|
||||||
|
|
||||||
if (((unsigned long)ps) & 0x2) {
|
if (((unsigned long)ps) & 0x2) {
|
||||||
*ps++ = le16_to_cpu(inw(addr));
|
*ps++ = __raw_readw(addr);
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
pi = (u32 *)ps;
|
pi = (u32 *)ps;
|
||||||
while (count >= 2) {
|
while (count >= 2) {
|
||||||
u32 w;
|
u32 w;
|
||||||
|
|
||||||
w = (le16_to_cpu(inw(addr)) << 16);
|
w = __raw_readw(addr) << 16;
|
||||||
w |= (le16_to_cpu(inw(addr)) << 0);
|
w |= __raw_readw(addr) << 0;
|
||||||
*pi++ = w;
|
*pi++ = w;
|
||||||
count -= 2;
|
count -= 2;
|
||||||
}
|
}
|
||||||
ps = (u16 *)pi;
|
ps = (u16 *)pi;
|
||||||
if (count)
|
if (count)
|
||||||
*ps = le16_to_cpu(inw(addr));
|
*ps = __raw_readw(addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(insw);
|
EXPORT_SYMBOL(insw);
|
||||||
@ -148,7 +148,7 @@ void insl(unsigned long __addr, void *dst, unsigned long count)
|
|||||||
if ((((unsigned long)dst) & 0x3) == 0) {
|
if ((((unsigned long)dst) & 0x3) == 0) {
|
||||||
u32 *pi = dst;
|
u32 *pi = dst;
|
||||||
while (count--)
|
while (count--)
|
||||||
*pi++ = le32_to_cpu(inl(addr));
|
*pi++ = __raw_readl(addr);
|
||||||
} else {
|
} else {
|
||||||
u32 l = 0, l2, *pi;
|
u32 l = 0, l2, *pi;
|
||||||
u16 *ps;
|
u16 *ps;
|
||||||
@ -158,11 +158,11 @@ void insl(unsigned long __addr, void *dst, unsigned long count)
|
|||||||
case 0x2:
|
case 0x2:
|
||||||
ps = dst;
|
ps = dst;
|
||||||
count -= 1;
|
count -= 1;
|
||||||
l = le32_to_cpu(inl(addr));
|
l = __raw_readl(addr);
|
||||||
*ps++ = l;
|
*ps++ = l;
|
||||||
pi = (u32 *)ps;
|
pi = (u32 *)ps;
|
||||||
while (count--) {
|
while (count--) {
|
||||||
l2 = le32_to_cpu(inl(addr));
|
l2 = __raw_readl(addr);
|
||||||
*pi++ = (l << 16) | (l2 >> 16);
|
*pi++ = (l << 16) | (l2 >> 16);
|
||||||
l = l2;
|
l = l2;
|
||||||
}
|
}
|
||||||
@ -173,13 +173,13 @@ void insl(unsigned long __addr, void *dst, unsigned long count)
|
|||||||
case 0x1:
|
case 0x1:
|
||||||
pb = dst;
|
pb = dst;
|
||||||
count -= 1;
|
count -= 1;
|
||||||
l = le32_to_cpu(inl(addr));
|
l = __raw_readl(addr);
|
||||||
*pb++ = l >> 24;
|
*pb++ = l >> 24;
|
||||||
ps = (u16 *)pb;
|
ps = (u16 *)pb;
|
||||||
*ps++ = ((l >> 8) & 0xffff);
|
*ps++ = ((l >> 8) & 0xffff);
|
||||||
pi = (u32 *)ps;
|
pi = (u32 *)ps;
|
||||||
while (count--) {
|
while (count--) {
|
||||||
l2 = le32_to_cpu(inl(addr));
|
l2 = __raw_readl(addr);
|
||||||
*pi++ = (l << 24) | (l2 >> 8);
|
*pi++ = (l << 24) | (l2 >> 8);
|
||||||
l = l2;
|
l = l2;
|
||||||
}
|
}
|
||||||
@ -190,11 +190,11 @@ void insl(unsigned long __addr, void *dst, unsigned long count)
|
|||||||
case 0x3:
|
case 0x3:
|
||||||
pb = (u8 *)dst;
|
pb = (u8 *)dst;
|
||||||
count -= 1;
|
count -= 1;
|
||||||
l = le32_to_cpu(inl(addr));
|
l = __raw_readl(addr);
|
||||||
*pb++ = l >> 24;
|
*pb++ = l >> 24;
|
||||||
pi = (u32 *)pb;
|
pi = (u32 *)pb;
|
||||||
while (count--) {
|
while (count--) {
|
||||||
l2 = le32_to_cpu(inl(addr));
|
l2 = __raw_readl(addr);
|
||||||
*pi++ = (l << 8) | (l2 >> 24);
|
*pi++ = (l << 8) | (l2 >> 24);
|
||||||
l = l2;
|
l = l2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user