diff options
author | marha <marha@users.sourceforge.net> | 2009-10-19 20:18:13 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-10-19 20:18:13 +0000 |
commit | f490d83dad064de52a65a1c5a7e374a1a176f05a (patch) | |
tree | 35d69842a56af15a5ec82dd875dfd5a2f987ad9c /xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c | |
parent | b567a3027bceabc0f1f42dd162268f06f15e8149 (diff) | |
download | vcxsrv-f490d83dad064de52a65a1c5a7e374a1a176f05a.tar.gz vcxsrv-f490d83dad064de52a65a1c5a7e374a1a176f05a.tar.bz2 vcxsrv-f490d83dad064de52a65a1c5a7e374a1a176f05a.zip |
Updated to xorg-server-1.7.0.902
Diffstat (limited to 'xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c')
-rw-r--r-- | xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c | 62 |
1 files changed, 39 insertions, 23 deletions
diff --git a/xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c b/xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c index 182a3e6ec..0021b5544 100644 --- a/xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c +++ b/xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c @@ -59,10 +59,16 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) #ifdef linux +unsigned long _bus_base(void); + +#define useSparse() (!_bus_base()) + #define SPARSE (7) #else +#define useSparse() 0 + #define SPARSE 0 #endif @@ -70,32 +76,42 @@ xf86SlowBcopy(unsigned char *src, unsigned char *dst, int len) void xf86SlowBCopyFromBus(unsigned char *src, unsigned char *dst, int count) { - unsigned long addr; - long result; - - addr = (unsigned long) src; - while( count ){ - result = *(volatile int *) addr; - result >>= ((addr>>SPARSE) & 3) * 8; - *dst++ = (unsigned char) (0xffUL & result); - addr += 1<<SPARSE; - count--; - outb(0x80, 0x00); - } + if (useSparse()) + { + unsigned long addr; + long result; + + addr = (unsigned long) src; + while (count) { + result = *(volatile int *) addr; + result >>= ((addr>>SPARSE) & 3) * 8; + *dst++ = (unsigned char) (0xffUL & result); + addr += 1<<SPARSE; + count--; + outb(0x80, 0x00); + } + } + else + xf86SlowBcopy(src, dst, count); } - + void xf86SlowBCopyToBus(unsigned char *src, unsigned char *dst, int count) { - unsigned long addr; - - addr = (unsigned long) dst; - while(count) { - *(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101; - src++; - addr += 1<<SPARSE; - count--; - outb(0x80, 0x00); - } + if (useSparse()) + { + unsigned long addr; + + addr = (unsigned long) dst; + while (count) { + *(volatile unsigned int *) addr = (unsigned short)(*src) * 0x01010101; + src++; + addr += 1<<SPARSE; + count--; + outb(0x80, 0x00); + } + } + else + xf86SlowBcopy(src, dst, count); } #endif |