aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/os-support
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-10-19 20:18:13 +0000
committermarha <marha@users.sourceforge.net>2009-10-19 20:18:13 +0000
commitf490d83dad064de52a65a1c5a7e374a1a176f05a (patch)
tree35d69842a56af15a5ec82dd875dfd5a2f987ad9c /xorg-server/hw/xfree86/os-support
parentb567a3027bceabc0f1f42dd162268f06f15e8149 (diff)
downloadvcxsrv-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')
-rw-r--r--xorg-server/hw/xfree86/os-support/linux/lnx_axp.c16
-rw-r--r--xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c18
-rw-r--r--xorg-server/hw/xfree86/os-support/misc/SlowBcopy.c62
3 files changed, 57 insertions, 39 deletions
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_axp.c b/xorg-server/hw/xfree86/os-support/linux/lnx_axp.c
index 8571c048b..10b97b0d6 100644
--- a/xorg-server/hw/xfree86/os-support/linux/lnx_axp.c
+++ b/xorg-server/hw/xfree86/os-support/linux/lnx_axp.c
@@ -125,12 +125,12 @@ extern unsigned int _dense_inb(unsigned long);
extern unsigned int _dense_inw(unsigned long);
extern unsigned int _dense_inl(unsigned long);
-void (*_alpha_outb)(char, unsigned long) = _outb;
-void (*_alpha_outw)(short, unsigned long) = _outw;
-void (*_alpha_outl)(int, unsigned long) = _outl;
-unsigned int (*_alpha_inb)(unsigned long) = _inb;
-unsigned int (*_alpha_inw)(unsigned long) = _inw;
-unsigned int (*_alpha_inl)(unsigned long) = _inl;
+_X_EXPORT void (*_alpha_outb)(char, unsigned long) = _outb;
+_X_EXPORT void (*_alpha_outw)(short, unsigned long) = _outw;
+_X_EXPORT void (*_alpha_outl)(int, unsigned long) = _outl;
+_X_EXPORT unsigned int (*_alpha_inb)(unsigned long) = _inb;
+_X_EXPORT unsigned int (*_alpha_inw)(unsigned long) = _inw;
+_X_EXPORT unsigned int (*_alpha_inl)(unsigned long) = _inl;
static long _alpha_iobase_query(unsigned, int, int, int);
long (*_iobase)(unsigned, int, int, int) = _alpha_iobase_query;
@@ -138,16 +138,12 @@ long (*_iobase)(unsigned, int, int, int) = _alpha_iobase_query;
static long
_alpha_iobase(unsigned flags, int hose, int bus, int devfn)
{
-#ifdef __NR_pciconfig_iobase
if (bus < 0) {
bus = hose;
flags |= IOBASE_FROM_HOSE;
}
return syscall(__NR_pciconfig_iobase, flags, bus, devfn);
-#else
- return -ENOSYS
-#endif
}
static long
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c b/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c
index e751da2d0..c65e1cca4 100644
--- a/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c
+++ b/xorg-server/hw/xfree86/os-support/linux/lnx_ev56.c
@@ -94,28 +94,34 @@ writeDense32(int Value, pointer Base, register unsigned long Offset)
void
_dense_outb(char val, unsigned long port)
{
- if ((port & ~0xffff) == 0) return _outb(val, port);
-
+ if ((port & ~0xffff) == 0) {
+ _outb(val, port);
+ } else {
write_mem_barrier();
*(volatile CARD8 *)port = val;
+ }
}
void
_dense_outw(short val, unsigned long port)
{
- if ((port & ~0xffff) == 0) return _outw(val, port);
-
+ if ((port & ~0xffff) == 0) {
+ _outw(val, port);
+ } else {
write_mem_barrier();
*(volatile CARD16 *)port = val;
+ }
}
void
_dense_outl(int val, unsigned long port)
{
- if ((port & ~0xffff) == 0) return _outl(val, port);
-
+ if ((port & ~0xffff) == 0) {
+ _outl(val, port);
+ } else {
write_mem_barrier();
*(volatile CARD32 *)port = val;
+ }
}
unsigned int
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