git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git]
/
arch
/
parisc
/
lib
/
io.c
diff --git
a/arch/parisc/lib/io.c
b/arch/parisc/lib/io.c
index
27f6350
..
86fb6b0
100644
(file)
--- a/
arch/parisc/lib/io.c
+++ b/
arch/parisc/lib/io.c
@@
-21,7
+21,7
@@
void __memcpy_toio(unsigned long dest, unsigned long src, int count)
goto bytecopy;
while (dest & 3) {
writeb(*(char *)src, dest++);
goto bytecopy;
while (dest & 3) {
writeb(*(char *)src, dest++);
-
((char *)src)
++;
+
src
++;
count--;
}
while (count > 3) {
count--;
}
while (count > 3) {
@@
-33,7
+33,7
@@
void __memcpy_toio(unsigned long dest, unsigned long src, int count)
bytecopy:
while (count--) {
writeb(*(char *)src, dest++);
bytecopy:
while (count--) {
writeb(*(char *)src, dest++);
-
((char *)src)
++;
+
src
++;
}
}
}
}
@@
-62,17
+62,17
@@
void __memcpy_fromio(unsigned long dest, unsigned long src, int count)
/* Then check for misaligned start address */
if (src & 1) {
*(u8 *)dest = readb(src);
/* Then check for misaligned start address */
if (src & 1) {
*(u8 *)dest = readb(src);
-
((u8 *)src)
++;
-
((u8 *)dest)
++;
+
src
++;
+
dest
++;
count--;
if (count < 2) goto bytecopy;
}
if (src & 2) {
*(u16 *)dest = __raw_readw(src);
count--;
if (count < 2) goto bytecopy;
}
if (src & 2) {
*(u16 *)dest = __raw_readw(src);
-
((u16 *)src)++
;
-
((u16 *)dest)++
;
- count
-=
2;
+
src += 2
;
+
dest += 2
;
+ count
-=
2;
}
while (count > 3) {
}
while (count > 3) {
@@
-85,16
+85,16
@@
void __memcpy_fromio(unsigned long dest, unsigned long src, int count)
shortcopy:
while (count > 1) {
*(u16 *)dest = __raw_readw(src);
shortcopy:
while (count > 1) {
*(u16 *)dest = __raw_readw(src);
-
((u16 *)src)++
;
-
((u16 *)dest)++
;
- count
-=
2;
+
src += 2
;
+
dest += 2
;
+ count
-=
2;
}
bytecopy:
while (count--) {
*(char *)dest = readb(src);
}
bytecopy:
while (count--) {
*(char *)dest = readb(src);
-
((char *)src)
++;
-
((char *)dest)
++;
+
src
++;
+
dest
++;
}
}
}
}
@@
-125,12
+125,16
@@
void __memset_io(unsigned long dest, char fill, int count)
*/
void insb (unsigned long port, void *dst, unsigned long count)
{
*/
void insb (unsigned long port, void *dst, unsigned long count)
{
- while (((unsigned long)dst) & 0x3) {
+ unsigned char *p;
+
+ p = (unsigned char *)dst;
+
+ while (((unsigned long)p) & 0x3) {
if (!count)
return;
count--;
if (!count)
return;
count--;
- *
(unsigned char *) dst
= inb(port);
-
((unsigned char *) dst)
++;
+ *
p
= inb(port);
+
p
++;
}
while (count >= 4) {
}
while (count >= 4) {
@@
-140,14
+144,14
@@
void insb (unsigned long port, void *dst, unsigned long count)
w |= inb(port) << 16;
w |= inb(port) << 8;
w |= inb(port);
w |= inb(port) << 16;
w |= inb(port) << 8;
w |= inb(port);
- *(unsigned int *)
dst
= w;
-
((unsigned int *) dst)++
;
+ *(unsigned int *)
p
= w;
+
p += 4
;
}
while (count) {
--count;
}
while (count) {
--count;
- *
(unsigned char *) dst
= inb(port);
-
((unsigned char *) dst)
++;
+ *
p
= inb(port);
+
p
++;
}
}
}
}
@@
-162,11
+166,14
@@
void insb (unsigned long port, void *dst, unsigned long count)
void insw (unsigned long port, void *dst, unsigned long count)
{
unsigned int l = 0, l2;
void insw (unsigned long port, void *dst, unsigned long count)
{
unsigned int l = 0, l2;
+ unsigned char *p;
+
+ p = (unsigned char *)dst;
if (!count)
return;
if (!count)
return;
- switch (((unsigned long)
dst
) & 0x3)
+ switch (((unsigned long)
p
) & 0x3)
{
case 0x00: /* Buffer 32-bit aligned */
while (count>=2) {
{
case 0x00: /* Buffer 32-bit aligned */
while (count>=2) {
@@
-174,28
+181,28
@@
void insw (unsigned long port, void *dst, unsigned long count)
count -= 2;
l = cpu_to_le16(inw(port)) << 16;
l |= cpu_to_le16(inw(port));
count -= 2;
l = cpu_to_le16(inw(port)) << 16;
l |= cpu_to_le16(inw(port));
- *(unsigned int *)
dst
= l;
-
((unsigned int *) dst)++
;
+ *(unsigned int *)
p
= l;
+
p += 4
;
}
if (count) {
}
if (count) {
- *(unsigned short *)
dst
= cpu_to_le16(inw(port));
+ *(unsigned short *)
p
= cpu_to_le16(inw(port));
}
break;
case 0x02: /* Buffer 16-bit aligned */
}
break;
case 0x02: /* Buffer 16-bit aligned */
- *(unsigned short *)
dst
= cpu_to_le16(inw(port));
-
((unsigned short *) dst)++
;
+ *(unsigned short *)
p
= cpu_to_le16(inw(port));
+
p += 2
;
count--;
while (count>=2) {
count -= 2;
l = cpu_to_le16(inw(port)) << 16;
l |= cpu_to_le16(inw(port));
count--;
while (count>=2) {
count -= 2;
l = cpu_to_le16(inw(port)) << 16;
l |= cpu_to_le16(inw(port));
- *(unsigned int *)
dst
= l;
-
((unsigned int *) dst)++
;
+ *(unsigned int *)
p
= l;
+
p += 4
;
}
if (count) {
}
if (count) {
- *(unsigned short *)
dst
= cpu_to_le16(inw(port));
+ *(unsigned short *)
p
= cpu_to_le16(inw(port));
}
break;
}
break;
@@
-206,16
+213,16
@@
void insw (unsigned long port, void *dst, unsigned long count)
--count;
l = cpu_to_le16(inw(port));
--count;
l = cpu_to_le16(inw(port));
- *
(unsigned char *) dst
= l >> 8;
-
((unsigned char *) dst)
++;
+ *
p
= l >> 8;
+
p
++;
while (count--)
{
l2 = cpu_to_le16(inw(port));
while (count--)
{
l2 = cpu_to_le16(inw(port));
- *(unsigned short *)
dst
= (l & 0xff) << 8 | (l2 >> 8);
-
((unsigned short *) dst)++
;
+ *(unsigned short *)
p
= (l & 0xff) << 8 | (l2 >> 8);
+
p += 2
;
l = l2;
}
l = l2;
}
- *
(unsigned char *) dst
= l & 0xff;
+ *
p
= l & 0xff;
break;
}
}
break;
}
}
@@
-231,6
+238,9
@@
void insw (unsigned long port, void *dst, unsigned long count)
void insl (unsigned long port, void *dst, unsigned long count)
{
unsigned int l = 0, l2;
void insl (unsigned long port, void *dst, unsigned long count)
{
unsigned int l = 0, l2;
+ unsigned char *p;
+
+ p = (unsigned char *)dst;
if (!count)
return;
if (!count)
return;
@@
-240,8
+250,8
@@
void insl (unsigned long port, void *dst, unsigned long count)
case 0x00: /* Buffer 32-bit aligned */
while (count--)
{
case 0x00: /* Buffer 32-bit aligned */
while (count--)
{
- *(unsigned int *)
dst
= cpu_to_le32(inl(port));
-
((unsigned int *) dst)++
;
+ *(unsigned int *)
p
= cpu_to_le32(inl(port));
+
p += 4
;
}
break;
}
break;
@@
-249,51
+259,51
@@
void insl (unsigned long port, void *dst, unsigned long count)
--count;
l = cpu_to_le32(inl(port));
--count;
l = cpu_to_le32(inl(port));
- *(unsigned short *)
dst
= l >> 16;
-
((unsigned short *) dst)++
;
+ *(unsigned short *)
p
= l >> 16;
+
p += 2
;
while (count--)
{
l2 = cpu_to_le32(inl(port));
while (count--)
{
l2 = cpu_to_le32(inl(port));
- *(unsigned int *)
dst
= (l & 0xffff) << 16 | (l2 >> 16);
-
((unsigned int *) dst)++
;
+ *(unsigned int *)
p
= (l & 0xffff) << 16 | (l2 >> 16);
+
p += 4
;
l = l2;
}
l = l2;
}
- *(unsigned short *)
dst
= l & 0xffff;
+ *(unsigned short *)
p
= l & 0xffff;
break;
case 0x01: /* Buffer 8-bit aligned */
--count;
l = cpu_to_le32(inl(port));
break;
case 0x01: /* Buffer 8-bit aligned */
--count;
l = cpu_to_le32(inl(port));
- *(unsigned char *)
dst
= l >> 24;
-
((unsigned char *) dst)
++;
- *(unsigned short *)
dst
= (l >> 8) & 0xffff;
-
((unsigned short *) dst)++
;
+ *(unsigned char *)
p
= l >> 24;
+
p
++;
+ *(unsigned short *)
p
= (l >> 8) & 0xffff;
+
p += 2
;
while (count--)
{
l2 = cpu_to_le32(inl(port));
while (count--)
{
l2 = cpu_to_le32(inl(port));
- *(unsigned int *)
dst
= (l & 0xff) << 24 | (l2 >> 8);
-
((unsigned int *) dst)++
;
+ *(unsigned int *)
p
= (l & 0xff) << 24 | (l2 >> 8);
+
p += 4
;
l = l2;
}
l = l2;
}
- *
(unsigned char *) dst
= l & 0xff;
+ *
p
= l & 0xff;
break;
case 0x03: /* Buffer 8-bit aligned */
--count;
l = cpu_to_le32(inl(port));
break;
case 0x03: /* Buffer 8-bit aligned */
--count;
l = cpu_to_le32(inl(port));
- *
(unsigned char *) dst
= l >> 24;
-
((unsigned char *) dst)
++;
+ *
p
= l >> 24;
+
p
++;
while (count--)
{
l2 = cpu_to_le32(inl(port));
while (count--)
{
l2 = cpu_to_le32(inl(port));
- *(unsigned int *)
dst
= (l & 0xffffff) << 8 | l2 >> 24;
-
((unsigned int *) dst)++
;
+ *(unsigned int *)
p
= (l & 0xffffff) << 8 | l2 >> 24;
+
p += 4
;
l = l2;
}
l = l2;
}
- *(unsigned short *)
dst
= (l >> 8) & 0xffff;
-
((unsigned short *) dst)++
;
- *
(unsigned char *) dst
= l & 0xff;
+ *(unsigned short *)
p
= (l >> 8) & 0xffff;
+
p += 2
;
+ *
p
= l & 0xff;
break;
}
}
break;
}
}
@@
-307,10
+317,13
@@
void insl (unsigned long port, void *dst, unsigned long count)
*/
void outsb(unsigned long port, const void * src, unsigned long count)
{
*/
void outsb(unsigned long port, const void * src, unsigned long count)
{
+ const unsigned char *p;
+
+ p = (const unsigned char *)src;
while (count) {
count--;
while (count) {
count--;
- outb(*
(char *)src
, port);
-
((char *) src)
++;
+ outb(*
p
, port);
+
p
++;
}
}
}
}
@@
-323,40
+336,43
@@
void outsb(unsigned long port, const void * src, unsigned long count)
void outsw (unsigned long port, const void *src, unsigned long count)
{
unsigned int l = 0, l2;
void outsw (unsigned long port, const void *src, unsigned long count)
{
unsigned int l = 0, l2;
+ const unsigned char *p;
+
+ p = (const unsigned char *)src;
if (!count)
return;
if (!count)
return;
- switch (((unsigned long)
src
) & 0x3)
+ switch (((unsigned long)
p
) & 0x3)
{
case 0x00: /* Buffer 32-bit aligned */
while (count>=2) {
count -= 2;
{
case 0x00: /* Buffer 32-bit aligned */
while (count>=2) {
count -= 2;
- l = *(unsigned int *)
src
;
-
((unsigned int *) src)++
;
+ l = *(unsigned int *)
p
;
+
p += 4
;
outw(le16_to_cpu(l >> 16), port);
outw(le16_to_cpu(l & 0xffff), port);
}
if (count) {
outw(le16_to_cpu(l >> 16), port);
outw(le16_to_cpu(l & 0xffff), port);
}
if (count) {
- outw(le16_to_cpu(*(unsigned short*)
src
), port);
+ outw(le16_to_cpu(*(unsigned short*)
p
), port);
}
break;
case 0x02: /* Buffer 16-bit aligned */
}
break;
case 0x02: /* Buffer 16-bit aligned */
- outw(le16_to_cpu(*(unsigned short*)
src
), port);
-
((unsigned short *) src)++
;
+ outw(le16_to_cpu(*(unsigned short*)
p
), port);
+
p += 2
;
count--;
while (count>=2) {
count -= 2;
count--;
while (count>=2) {
count -= 2;
- l = *(unsigned int *)
src
;
-
((unsigned int *) src)++
;
+ l = *(unsigned int *)
p
;
+
p += 4
;
outw(le16_to_cpu(l >> 16), port);
outw(le16_to_cpu(l & 0xffff), port);
}
if (count) {
outw(le16_to_cpu(l >> 16), port);
outw(le16_to_cpu(l & 0xffff), port);
}
if (count) {
- outw(le16_to_cpu(*(unsigned short
*)src
), port);
+ outw(le16_to_cpu(*(unsigned short
*)p
), port);
}
break;
}
break;
@@
-364,18
+380,18
@@
void outsw (unsigned long port, const void *src, unsigned long count)
/* I don't bother with 32bit transfers
* in this case, 16bit will have to do -- DE */
/* I don't bother with 32bit transfers
* in this case, 16bit will have to do -- DE */
- l = *
(unsigned char *) src
<< 8;
-
((unsigned char *) src)
++;
+ l = *
p
<< 8;
+
p
++;
count--;
while (count)
{
count--;
count--;
while (count)
{
count--;
- l2 = *(unsigned short *)
src
;
-
((unsigned short *) src)++
;
+ l2 = *(unsigned short *)
p
;
+
p += 2
;
outw(le16_to_cpu(l | l2 >> 8), port);
l = l2 << 8;
}
outw(le16_to_cpu(l | l2 >> 8), port);
l = l2 << 8;
}
- l2 = *(unsigned char *)
src
;
+ l2 = *(unsigned char *)
p
;
outw (le16_to_cpu(l | l2>>8), port);
break;
outw (le16_to_cpu(l | l2>>8), port);
break;
@@
-392,68
+408,73
@@
void outsw (unsigned long port, const void *src, unsigned long count)
void outsl (unsigned long port, const void *src, unsigned long count)
{
unsigned int l = 0, l2;
void outsl (unsigned long port, const void *src, unsigned long count)
{
unsigned int l = 0, l2;
+ const unsigned char *p;
+
+ p = (const unsigned char *)src;
if (!count)
return;
if (!count)
return;
- switch (((unsigned long)
src
) & 0x3)
+ switch (((unsigned long)
p
) & 0x3)
{
case 0x00: /* Buffer 32-bit aligned */
while (count--)
{
{
case 0x00: /* Buffer 32-bit aligned */
while (count--)
{
- outl(le32_to_cpu(*(unsigned int *)
src
), port);
-
((unsigned int *) src)++
;
+ outl(le32_to_cpu(*(unsigned int *)
p
), port);
+
p += 4
;
}
break;
case 0x02: /* Buffer 16-bit aligned */
--count;
}
break;
case 0x02: /* Buffer 16-bit aligned */
--count;
- l = *(unsigned short *)
src
;
-
((unsigned short *) src)++
;
+ l = *(unsigned short *)
p
;
+
p += 2
;
while (count--)
{
while (count--)
{
- l2 = *(unsigned int *)
src
;
-
((unsigned int *) src)++
;
+ l2 = *(unsigned int *)
p
;
+
p += 4
;
outl (le32_to_cpu(l << 16 | l2 >> 16), port);
l = l2;
}
outl (le32_to_cpu(l << 16 | l2 >> 16), port);
l = l2;
}
- l2 = *(unsigned short *)
src
;
+ l2 = *(unsigned short *)
p
;
outl (le32_to_cpu(l << 16 | l2), port);
break;
case 0x01: /* Buffer 8-bit aligned */
--count;
outl (le32_to_cpu(l << 16 | l2), port);
break;
case 0x01: /* Buffer 8-bit aligned */
--count;
-
- l = *(unsigned char *) src << 24;
- ((unsigned char *) src)++;
- l |= *(unsigned short *) src << 8;
- ((unsigned short *) src)++;
+
+ l = *p << 24;
+ p++;
+ l |= *(unsigned short *)p << 8;
+ p += 2;
+
while (count--)
{
while (count--)
{
- l2 = *(unsigned int *)
src
;
-
((unsigned int *) src)++
;
+ l2 = *(unsigned int *)
p
;
+
p += 4
;
outl (le32_to_cpu(l | l2 >> 24), port);
l = l2 << 8;
}
outl (le32_to_cpu(l | l2 >> 24), port);
l = l2 << 8;
}
- l2 = *
(unsigned char *) src
;
-
outl (le32_to_cpu(l | l2), port);
+ l2 = *
p
;
+ outl (le32_to_cpu(l | l2), port);
break;
case 0x03: /* Buffer 8-bit aligned */
--count;
break;
case 0x03: /* Buffer 8-bit aligned */
--count;
- l = *(unsigned char *) src << 24;
- ((unsigned char *) src)++;
+ l = *p << 24;
+ p++;
+
while (count--)
{
while (count--)
{
- l2 = *(unsigned int *)
src
;
-
((unsigned int *) src)++
;
+ l2 = *(unsigned int *)
p
;
+
p += 4
;
outl (le32_to_cpu(l | l2 >> 8), port);
l = l2 << 24;
}
outl (le32_to_cpu(l | l2 >> 8), port);
l = l2 << 24;
}
- l2
= *(unsigned short *) src
<< 16;
-
((unsigned short *) src)++
;
- l2 |= *
(unsigned char *) src
;
+ l2
= *(unsigned short *)p
<< 16;
+
p += 2
;
+ l2 |= *
p
;
outl (le32_to_cpu(l | l2), port);
break;
}
outl (le32_to_cpu(l | l2), port);
break;
}